From f010bc6ebc58d35d01a0e8fbcc2d0255f20c1e0f Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Sun, 23 Nov 2014 13:48:50 +0100 Subject: [PATCH] move misc/Cache to core/CCCache --- _oasis | 4 ++-- benchs/run_benchs.ml | 22 ++++++++++++---------- misc/cache.ml => core/CCCache.ml | 0 misc/cache.mli => core/CCCache.mli | 0 4 files changed, 14 insertions(+), 12 deletions(-) rename misc/cache.ml => core/CCCache.ml (100%) rename misc/cache.mli => core/CCCache.mli (100%) diff --git a/_oasis b/_oasis index e95bd4f5..f76776a2 100644 --- a/_oasis +++ b/_oasis @@ -48,7 +48,7 @@ Library "containers" CCHeap, CCList, CCOpt, CCPair, CCFun, CCHash, CCKList, CCInt, CCBool, CCArray, CCOrd, CCIO, CCRandom, CCKTree, CCTrie, CCString, CCHashtbl, - CCFlatHashtbl, CCSexp, CCMap + CCFlatHashtbl, CCSexp, CCMap, CCCache BuildDepends: bytes Library "containers_string" @@ -76,7 +76,7 @@ Library "containers_pervasives" Library "containers_misc" Path: misc Pack: true - Modules: Cache, FHashtbl, FlatHashtbl, Hashset, + Modules: FHashtbl, FlatHashtbl, Hashset, Heap, LazyGraph, PersistentGraph, PHashtbl, SkipList, SplayTree, SplayMap, Univ, Bij, PiCalculus, RAL, UnionFind, SmallSet, AbsSet, CSM, diff --git a/benchs/run_benchs.ml b/benchs/run_benchs.ml index 2443cfbb..925ae450 100644 --- a/benchs/run_benchs.ml +++ b/benchs/run_benchs.ml @@ -127,8 +127,10 @@ module Vec = struct end module Cache = struct + module C = CCCache + let make_fib c = - let f = Cache.with_cache_rec c + let f = C.with_cache_rec c (fun fib n -> match n with | 0 -> 0 | 1 -> 1 @@ -137,22 +139,22 @@ module Cache = struct ) in fun x -> - Cache.clear c; + C.clear c; f x let bench_fib n = let l = - [ "replacing_fib (128)", make_fib (Cache.replacing 128), n - ; "LRU_fib (128)", make_fib (Cache.lru 128), n - ; "replacing_fib (16)", make_fib (Cache.replacing 16), n - ; "LRU_fib (16)", make_fib (Cache.lru 16), n - ; "unbounded", make_fib (Cache.unbounded 32), n + [ "replacing_fib (128)", make_fib (C.replacing 128), n + ; "LRU_fib (128)", make_fib (C.lru 128), n + ; "replacing_fib (16)", make_fib (C.replacing 16), n + ; "LRU_fib (16)", make_fib (C.lru 16), n + ; "unbounded", make_fib (C.unbounded 32), n ] in let l = if n <= 20 - then [ "linear_fib (5)", make_fib (Cache.linear 5), n - ; "linear_fib (32)", make_fib (Cache.linear 32), n - ; "dummy_fib", make_fib Cache.dummy, n + then [ "linear_fib (5)", make_fib (C.linear 5), n + ; "linear_fib (32)", make_fib (C.linear 32), n + ; "dummy_fib", make_fib C.dummy, n ] @ l else l in diff --git a/misc/cache.ml b/core/CCCache.ml similarity index 100% rename from misc/cache.ml rename to core/CCCache.ml diff --git a/misc/cache.mli b/core/CCCache.mli similarity index 100% rename from misc/cache.mli rename to core/CCCache.mli