Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for LRU (0.01 sec)

  1. internal/lru/lru.go

    package lru
    
    // golang -lru
    // https://github.com/hashicorp/golang-lru
    import (
    	"sync"
    	"time"
    )
    
    // EvictCallback is used to get a callback when a cache entry is evicted
    type EvictCallback[K comparable, V any] func(key K, value V)
    
    // LRU implements a thread-safe LRU with expirable entries.
    type LRU[K comparable, V any] struct {
    	size      int
    	evictList *LruList[K, V]
    	items     map[K]*Entry[K, V]
    	onEvict   EvictCallback[K, V]
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Fri Apr 25 08:22:26 UTC 2025
    - 12.5K bytes
    - Viewed (0)
  2. tests/lru_test.go

    	lru := lru.NewLRU[string, int](0, nil, time.Hour)
    	lru.Add("key1", 1)
    	lru.Add("key2", 2)
    	lru.Add("key3", 3)
    
    	if _, ok := lru.Get("key1"); !ok {
    		t.Errorf("Expected key1 to exist, but it was evicted")
    	}
    }
    
    func TestLRU_Add_Eviction(t *testing.T) {
    	lru := lru.NewLRU[string, int](0, nil, time.Second*2)
    	lru.Add("key1", 1)
    	lru.Add("key2", 2)
    	lru.Add("key3", 3)
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Sun May 25 07:40:40 UTC 2025
    - 10.4K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/cache/CacheEvictionTest.java

                Integer key = entry.getKey();
                cache.invalidate(key);
              }
            });
      }
    
      public void testEviction_lru() {
        // test lru within a single segment
        IdentityLoader<Integer> loader = identityLoader();
        LoadingCache<Integer, Integer> cache =
            CacheBuilder.newBuilder().concurrencyLevel(1).maximumSize(10).build(loader);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 18:46:00 UTC 2025
    - 15K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/cache/CacheExpirationTest.java

                .ticker(ticker)
                .build(loader);
        runRemovalScheduler(cache, removalListener, loader, ticker, KEY_PREFIX, EXPIRING_TIME);
      }
    
      public void testExpirationOrder_access() {
        // test lru within a single segment
        FakeTicker ticker = new FakeTicker();
        IdentityLoader<Integer> loader = identityLoader();
        LoadingCache<Integer, Integer> cache =
            CacheBuilder.newBuilder()
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Wed Jul 16 17:42:14 UTC 2025
    - 18.7K bytes
    - Viewed (0)
  5. README.md

    - **Collections** (`org.codelibs.core.collection`) - Enhanced collection utilities, array operations, and specialized map/set implementations including LRU caches and case-insensitive collections
    - **I/O Operations** (`org.codelibs.core.io`) - File handling, resource management, stream utilities, and traversal utilities for efficient resource processing
    Registered: Fri Sep 05 20:58:11 UTC 2025
    - Last Modified: Sun Aug 31 02:56:02 UTC 2025
    - 12.7K bytes
    - Viewed (0)
  6. docs/en/docs/advanced/settings.md

    ### Creating the `Settings` only once with `lru_cache` { #creating-the-settings-only-once-with-lru-cache }
    
    Reading a file from disk is normally a costly (slow) operation, so you probably want to do it only once and then reuse the same settings object, instead of reading it for each request.
    
    But every time we do:
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 12.2K bytes
    - Viewed (0)
  7. src/main/java/org/codelibs/fess/crawler/transformer/FessTransformer.java

     * and field configuration handling during the document transformation process.
     */
    public interface FessTransformer {
    
        /**
         * Synchronized LRU cache for storing parent URL encodings.
         * Maps session+parent URL keys to their corresponding character encodings.
         */
        Map<String, String> parentEncodingMap = Collections.synchronizedMap(new LruHashMap<>(1000));
    
    Registered: Thu Sep 04 12:52:25 UTC 2025
    - Last Modified: Thu Jul 17 08:28:31 UTC 2025
    - 13.8K bytes
    - Viewed (0)
  8. src/main/java/org/codelibs/fess/helper/UserInfoHelper.java

            }).orElse(StringUtil.EMPTY_STRINGS);
        }
    
        /**
         * Retrieves or creates the result document IDs cache from the session.
         * The cache is implemented as an LRU map to limit memory usage.
         *
         * @param session the HTTP session
         * @return the result document IDs cache map
         */
        private Map<String, String[]> getResultDocIdsCache(final HttpSession session) {
    Registered: Thu Sep 04 12:52:25 UTC 2025
    - Last Modified: Thu Aug 07 03:06:29 UTC 2025
    - 14.9K bytes
    - Viewed (0)
  9. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/cache/DiskLruCache.kt

       *
       *   o CLEAN lines track a cache entry that has been successfully published and may be read. A
       *     publish line is followed by the lengths of each of its values.
       *
       *   o READ lines track accesses for LRU.
       *
       *   o REMOVE lines track entries that have been deleted.
       *
       * The journal file is appended to as cache operations occur. The journal may occasionally be
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed May 28 23:28:25 UTC 2025
    - 34.7K bytes
    - Viewed (0)
  10. go.mod

    	github.com/hashicorp/errwrap v1.1.0 // indirect
    	github.com/hashicorp/go-multierror v1.1.1 // indirect
    	github.com/hashicorp/go-uuid v1.0.3 // indirect
    	github.com/hashicorp/golang-lru v1.0.2 // indirect
    	github.com/jcmturner/aescts/v2 v2.0.0 // indirect
    	github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
    	github.com/jcmturner/gofork v1.7.6 // indirect
    	github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect
    Registered: Sun Sep 07 19:28:11 UTC 2025
    - Last Modified: Sat Sep 06 17:33:19 UTC 2025
    - 12.3K bytes
    - Viewed (0)
Back to top