I have a serialized class of 30MB stored externally which contains lookup values. Each time a webservice request is received, I need to load the serialized file to memory and do a lookup for a specific key against this serialized class. This operation is time consuming as well开发者_如何学编程 as resource intensive, which badly affects the application performance.
Please help me to sort this out.
Clearly you should move your Serialized contents to a Database, that will be more efficient.
Try loading the Lookup values in the serialized class to Application object. Before this the values in the serialized class need to be loaded to System.Collections.Generic.HashSet
Also don't forget to override the hashcode function. For added performance, pregenerate your hashcode in your constructor.
精彩评论