简体   繁体   中英

Loading\Querying large Serialized objects

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.

显然,您应该将序列化的内容移动到数据库中,这样会更有效率。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM