Skip to main content

Timeline for Optimizing List<string> performance

Current License: CC BY-SA 3.0

21 events
when toggle format what by license comment
Jan 5, 2014 at 23:41 comment added siva.k One thing to watch for using the HttpContext.Current.Cache is that there is an overhead as the dictionary populates and depending on the amount of items in your cache that alone can become expensive. You may be better off using something else like Lucene.Net which can store its index in RAM, or even a static List<string> that gets repopulated on app recycle.
Jan 5, 2014 at 23:20 history edited Jamal CC BY-SA 3.0
deleted 10 characters in body; edited tags
Mar 13, 2013 at 18:56 history edited svick CC BY-SA 3.0
rm tag from title
Mar 14, 2012 at 15:53 vote accept Paul
Mar 13, 2012 at 21:15 answer added Daniel Winks timeline score: 0
Mar 13, 2012 at 8:48 comment added Lars-Erik Ah, bummer. Embarrasing. Anyway, the part about modification should still hold true.
Mar 12, 2012 at 9:35 comment added Guffa @Lars-Erik: You read the specification wrong. The fact that static members of the class (all zero of them) are thread safe doesn't mean that a static variable holding an instance of the class is thread safe. Neither the variable nor the class instance is thread safe.
Mar 8, 2012 at 23:45 answer added Chris timeline score: 3
Mar 8, 2012 at 17:41 answer added breischl timeline score: 2
Mar 8, 2012 at 13:07 comment added Lars-Erik A public static List<T> is threadsafe. Instance members are not guaranteed to be. But either way, as long as the collection is not modified during runtime, it does not matter. msdn.microsoft.com/en-us/library/6sh2ey19.aspx (see Thread Safety near bottom above Community Content)
Mar 8, 2012 at 2:23 comment added Louis Rhys @Darin what would be the thread-safe alternative?
Mar 7, 2012 at 22:06 comment added jk. sounds like the perfect use for a en.wikipedia.org/wiki/Directed_acyclic_word_graph
Mar 7, 2012 at 20:39 history tweeted twitter.com/#!/StackCodeReview/status/177493756797390849
Mar 7, 2012 at 17:39 comment added Jesse C. Slicer Not sure I'm too keen on the recursion there, even if it should only be a single loop-around. I'd replace return GetProducts(); with the (also-repeat, might want to DRY it out) cached = HttpContext.Current.Cache["MyApp-Products"];.
Mar 7, 2012 at 17:34 answer added L.B timeline score: 12
Mar 7, 2012 at 17:30 answer added Robert Levy timeline score: 16
Mar 7, 2012 at 17:28 history migrated from stackoverflow.com (revisions)
Mar 7, 2012 at 17:20 answer added Amy B timeline score: 4
Mar 7, 2012 at 17:16 answer added Marc Gravell timeline score: 17
Mar 7, 2012 at 17:13 comment added Darin Dimitrov Were you aware that the List<T> type that you are using as backend is not thread safe? You should really take that into account when attempting to use it in a multi-threaded environment such as ASP.NET.
Mar 7, 2012 at 17:11 history asked Paul CC BY-SA 3.0