简体   繁体   English

加载\\查询大型序列化对象

[英]Loading\Querying large Serialized objects

I have a serialized class of 30MB stored externally which contains lookup values. 我在外部存储了一个30MB的序列化类,其中包含查找值。 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. 每次收到Web服务请求时,我都需要将序列化的文件加载到内存中,并针对该序列化的类查找特定的密钥。 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. 尝试将序列化类中的Lookup值加载到Application对象。 Before this the values in the serialized class need to be loaded to System.Collections.Generic.HashSet 在此之前,需要将序列化类中的值加载到System.Collections.Generic.HashSet

Also don't forget to override the hashcode function. 同样不要忘记重写哈希码功能。 For added performance, pregenerate your hashcode in your constructor. 为了提高性能,请在构造函数中预先生成哈希码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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