All Projects → c-cube → maki

c-cube / maki

Licence: BSD-2-Clause license
[beta] persistent memoization of computations, e.g. for repeatable tests and benchmarks

Programming Languages

ocaml
1615 projects
Makefile
30231 projects

Projects that are alternatives of or similar to maki

Cachier
Persistent, stale-free, local and cross-machine caching for Python functions.
Stars: ✭ 359 (+2143.75%)
Mutual labels:  caching, memoization
LruClockCache
A low-latency LRU approximation cache in C++ using CLOCK second-chance algorithm. Multi level cache too. Up to 2.5 billion lookups per second.
Stars: ✭ 35 (+118.75%)
Mutual labels:  caching, memoization
Immutable Tuple
Immutable finite list objects with constant-time equality testing (===) and no memory leaks.
Stars: ✭ 29 (+81.25%)
Mutual labels:  memoization, persistent
Cached
Rust cache structures and easy function memoization
Stars: ✭ 530 (+3212.5%)
Mutual labels:  caching, memoization
Frontend Computer Science
A list of Computer Science topics important for a Front-End Developer to learn 📝
Stars: ✭ 113 (+606.25%)
Mutual labels:  caching, memoization
Cacheout
A caching library for Python
Stars: ✭ 238 (+1387.5%)
Mutual labels:  caching, memoization
Joblib
Computing with Python functions.
Stars: ✭ 2,620 (+16275%)
Mutual labels:  caching, memoization
bkt
bkt is a subprocess caching utility, available as a command line binary and a Rust library.
Stars: ✭ 117 (+631.25%)
Mutual labels:  caching, memoization
mnemonik
Simple memoization extension function for Kotlin https://en.wikipedia.org/wiki/Memoization
Stars: ✭ 40 (+150%)
Mutual labels:  memoization
memoize-fs
memoize/cache in file system solution for Node.js
Stars: ✭ 25 (+56.25%)
Mutual labels:  memoization
performance-dashboard
Magento 2 Performance Dashboard
Stars: ✭ 60 (+275%)
Mutual labels:  caching
the-apache-ignite-book
All code samples, scripts and more in-depth examples for The Apache Ignite Book. Include Apache Ignite 2.6 or above
Stars: ✭ 65 (+306.25%)
Mutual labels:  memoization
grav-plugin-advanced-pagecache
Grav AdvancedPageCache Plugin
Stars: ✭ 19 (+18.75%)
Mutual labels:  caching
Cartographer
Persistent multiplayer map of pins and stories.
Stars: ✭ 43 (+168.75%)
Mutual labels:  persistent
superhighway84
USENET-inspired, uncensorable, decentralized internet discussion system running on IPFS & OrbitDB
Stars: ✭ 437 (+2631.25%)
Mutual labels:  merkle-dag
hazelcast-csharp-client
Hazelcast .NET Client
Stars: ✭ 98 (+512.5%)
Mutual labels:  caching
Foundatio.Samples
Foundatio Samples
Stars: ✭ 34 (+112.5%)
Mutual labels:  caching
webuntis
A API library that makes it easy to access the Webuntis JSON RPC 2.0 API
Stars: ✭ 22 (+37.5%)
Mutual labels:  caching
monad-memo
Memoization monad transformer
Stars: ✭ 29 (+81.25%)
Mutual labels:  memoization
infinispan-spring-boot
Infinispan Spring Boot starter. Use this starter in your Spring Boot applications to help you use Infinispan+Spring integration in embedded and client/server mode
Stars: ✭ 61 (+281.25%)
Mutual labels:  caching

maki

Persistent incremental computations, for repeatable tests and benchmarks.

Status: beta

build status

For more details, see the initial design document (obsolete) and the blog post

Examples

Simple memoizing of a recursive function

let fib =
  let rec fib n = Maki.(
      mk1 ~name:"fib" Hash.int Codec.int ~lifetime:Lifetime.one_minute
        ~f:(fun x -> if x <= 1
          then return_ok 1
          else (fib (x-1) >>= fun x1 ->
            fib (x-2) >|= fun x2 -> x1+x2))
        n
    ) in
  fib;;

fib 42 ;;
(* returns [Ok 42] *)

Concatenating file, but memoizing the result as long as they do not change

open Lwt.Infix;;

let concat =
  Maki.(mk2 ~name:"concat" Hash.file_ref Hash.file_ref Codec.string ~lifetime:Lifetime.one_hour
    ~f:(fun f1 f2 ->
      let open E in
      read_file f1 >>= fun content1 ->
      read_file f2 >>= fun content2 ->
      return_ok (content1 ^ content2)))
;;

let x1 = Maki.(File_ref.make "foo1" >>= fun f1 -> File_ref.make "foo2" >>= concat f1);;

(* cached *)
let x2 = Maki.(File_ref.make "foo1" >>= fun f1 -> File_ref.make "foo2" >>= concat f1);;

(* now change contnet of file "foo1", so this should change too *)
let x3 = Maki.(File_ref.make "foo1" >>= fun f1 -> File_ref.make "foo2" >>= concat f1);;

Documentation

See http://c-cube.github.io/maki/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].