SharedMem takes capacity as parameter
commitbfae24910a01d9b9b832560c354fecd3f3092d98
authorLucian Wischik <ljw@fb.com>
Wed, 4 Mar 2020 06:12:42 +0000 (3 22:12 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 4 Mar 2020 06:26:44 +0000 (3 22:26 -0800)
tree1e42a210fb53244fb65a0fa667b19a9c4863519c
parente3cc2de7eb0ffcd4502ece8dbd0d21e9ada0a309
SharedMem takes capacity as parameter

Summary:
Prior to this diff, (1) every SharedMem.LocalCache used a Hashtbl capacity of 1000, (2) every SharedMem.WithCache used a local Hashstbl cache of capacity 1000.

I think that each cache will benefit from being able to adjust its own size.

This diff changes capacity to be something you configure on a per-cache basis.

I left them all at their existing values of 1000. Tweaks can be done in a future state.

(Except: I altered the capacity of Parser_options_provider to just 1 because that's all there'll ever be!)

Reviewed By: arxanas

Differential Revision: D20124735

fbshipit-source-id: a9afbacd51e5bc7065f6bde5cebec5008ca722d0
12 files changed:
hphp/hack/src/decl/decl_heap.ml
hphp/hack/src/decl/decl_heap.mli
hphp/hack/src/decl/shallow_classes_heap.ml
hphp/hack/src/heap/sharedMem.ml
hphp/hack/src/naming/naming_heap.ml
hphp/hack/src/providers/ast_provider.ml
hphp/hack/src/providers/file_provider.ml
hphp/hack/src/providers/fixme_provider.ml
hphp/hack/src/providers/linearization_provider.ml
hphp/hack/src/providers/parser_options_provider.ml
hphp/hack/src/typing/typing_classes_heap.ml
hphp/hack/test/unit/heap/test_sharedmem.ml