Performance regression of log mode
I have bisected a performance regression of log mode. It is introduced in #60 which uses weak hash table for implementing garbage collection.
My current guess is that in log mode we do not keep the events, which leads to some of the strings in the string cache quickly getting evicted. (cache thrashing)
I think we should fix it ASAP as tracexec will be used for build system profiling with the upcoming OTEL integration.
We can probably fix this by replacing the weak hash table cache with moka cache, which supports TTL and TTI policies that are more suitable here than the weak hash table.
Or we can keep a sliding window of last K events in the log mode to keep some entries of weak hash table alive as as short term workaround.