I wrote simple test
When
I guess the overhead of HttpRuntime.Cache is sync
I try to change initial capacity of HashTable/Dictionary? but with no success.
Does anyone know what is the reason of this turbo HttpContext.Current.Items? May I create this kind of object to custom cache implementation(of course with sync imply).
The reason cache is sluggish is because it is thread safe - as you guessed.
Underlying type for HttpContext.Current.Items
is a plain Hashtable
. Perhaps if you put a snippet of your code, I would be able to explain the difference with the 3rd item.