Hi!
I've been experimenting again with adding a global cache in Owi (because I think measuring hashconsing performances without it makes less sense). I think it would be very nice if Smtml could provide a second cache implementation that would be persistent (immutable). Currently, I have to use the cache like this :
let cache = Smtml.Cache.Strong.create 64
let cache_mutex = Mutex.create ()
let check (S (solver_module, s)) pc =
let cached =
Mutex.protect cache_mutex (fun () -> Smtml.Cache.Strong.find_opt cache pc)
in
match cached with
| Some sat -> sat
| None ->
let module Solver = (val solver_module) in
let sat = Solver.check_set s pc in
Mutex.protect cache_mutex (fun () -> Smtml.Cache.Strong.replace cache pc sat);
sat
Whereas, using a persistent cache I could 1. use an Atomic.t instead of a Mutex.t 2. avoid the first lock (i.e. when I'm simply reading the cache). I'm not sure it would be better, but that may very well be the case.
Hi!
I've been experimenting again with adding a global cache in Owi (because I think measuring hashconsing performances without it makes less sense). I think it would be very nice if Smtml could provide a second cache implementation that would be persistent (immutable). Currently, I have to use the cache like this :
Whereas, using a persistent cache I could 1. use an
Atomic.tinstead of aMutex.t2. avoid the first lock (i.e. when I'm simply reading the cache). I'm not sure it would be better, but that may very well be the case.