/// <summary> /// Creates this with the specified method. /// </summary> public LruTaxonomyWriterCache(int cacheSize, LRUType lruType) { // TODO (Facet): choose between NameHashIntCacheLRU and NameIntCacheLRU. // For guaranteed correctness - not relying on no-collisions in the hash // function, NameIntCacheLRU should be used: // On the other hand, NameHashIntCacheLRU takes less RAM but if there // are collisions (which we never found) two different paths would be // mapped to the same ordinal... if (lruType == LRUType.LRU_HASHED) { this.cache = new NameHashInt32CacheLru(cacheSize); } else { this.cache = new NameInt32CacheLru(cacheSize); } }
/// <summary> /// Creates this with the specified method. /// </summary> public LruTaxonomyWriterCache(int cacheSize, LRUType lruType) { // TODO (Facet): choose between NameHashIntCacheLRU and NameIntCacheLRU. // For guaranteed correctness - not relying on no-collisions in the hash // function, NameIntCacheLRU should be used: // On the other hand, NameHashIntCacheLRU takes less RAM but if there // are collisions (which we never found) two different paths would be // mapped to the same ordinal... if (lruType == LRUType.LRU_HASHED) { this.cache = new NameHashIntCacheLRU(cacheSize); } else { this.cache = new NameIntCacheLRU(cacheSize); } }