perf: replace WeakMap caches with faster mechanism
#309
+100
−12
WeakMap caches with faster mechanism
#309