实际上前一种方法也能从引用数据缓存中获益。
Actually the former approach can also benefit from the reference data caches.
由于引用是数据结构的一部分,所以它有一个好的缓存位置。
Since the reference is part of the data structure, it has good cache locality.
对于各输入记录,缓存引用数据将通过交叉检查来查找结果。
For each input record, the cached-referenced data is cross-checked to find the result.
因为引用数据十分稳定,它们被缓存在前端,能基于其ID属性快速定位到它们。
Because the reference data is pretty stable, they are cached at the front end and can be quickly looked up based on their ID properties.
只读引用数据可以被保持在内存缓存中。
相反地,应该使用内存中的哈希表来缓存数据,并且在会话中保存一个对此数据进行引用的键。
Instead, use an in memory hash table to cache the data and just keep a key to the data in the session.
是否可使用软引用的关键在于,应用程序是否可从大量缓存的数据恢复。
The key to whether a soft reference can be used is whether an application can recover from the loss of the data being cached.
最佳方法就是移除强引用的涉及到的缓存,图片对象,以及其它可以在之后使用时还可以重新创建的数据对象。
The best way to do this is to remove strong references to caches, image objects, and other data objects that can be recreated later.
最佳方法就是移除强引用的涉及到的缓存,图片对象,以及其它可以在之后使用时还可以重新创建的数据对象。
The best way to do this is to remove strong references to caches, image objects, and other data objects that can be recreated later.
应用推荐