开发者

Loading\Querying large Serialized objects

开发者 https://www.devze.com 2023-02-11 14:13 出处:网络
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 specifi

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消