atomic-server icon indicating copy to clipboard operation
atomic-server copied to clipboard

in-mem cache for constructed properties

Open joepio opened this issue 4 years ago • 2 comments

Many calls rely on Properties. Every time you set some value using a string, for example. This means that the get_property method in Storelike is called a ton of times. This method currenlty relies on fetching a resource and converting it to a Property.

It's pretty fast, but it can be way faster if we memoize the Properties in a Hashmap.

joepio avatar Jan 02 '21 15:01 joepio

This is definitely the biggest bottleneck at the moment for parsing JSON-AD resources, including Commits. Takes 4ms in debug mode with tracing.

Screenshot 2022-04-25 at 22 03 57

joepio avatar Apr 25 '22 20:04 joepio

Implementations:

  • https://crates.io/crates/memoize -> Probably won't work as a method.
  • https://github.com/jaemk/cached -> Also won't accept Self, which Storelike::get_property(&self, subject) currently does.

joepio avatar Aug 24 '22 13:08 joepio