merlin icon indicating copy to clipboard operation
merlin copied to clipboard

Merlin's time-space trade-off

Open pitag-ha opened this issue 2 years ago • 3 comments

The Merlin file caches currently stay alive for 5 min. Why 5 min? I'd love to know the impact on both time and space when changing that number.

Action points:

  • [x] Refine the Merlin telemetry to capture memory usage as well.
  • [x] Prepare a Merlin branch (without merging) that lets that number be set by the editor.
  • [ ] Ask Jane Street to add the following logic to their Emacs plug-in: Set the number to 60 by default, but let the user configure it back down to 5 again (in case of memory issues).
  • [ ] Observe the change in latency and memory.

pitag-ha avatar Jun 26 '23 12:06 pitag-ha

I'm wondering if it would be a good idea to add (optional?) data about cache hit/misses to merlin responses. It would be similar performance data as "timing" field. I think it would be helpful for telemetry, and we could use it in merl-an to verify caching and provide statistics of cache usage in benchmarks.

3Rafal avatar Jul 01 '23 17:07 3Rafal

Currently, the info about cache hits/misses is dumped into the Merlin log-file. I agree that for merl-an, it would be simpler if it was added to the Merlin telemetry directly. Making that optional sounds like a good idea to me.

pitag-ha avatar Jul 03 '23 09:07 pitag-ha

Btw, another thing that could be interesting to add is whether the ocamlmerlin server is fresh on the request, i.e. whether it's the first request on that server or not. That information would reveal whether the cache was missed because the server has crashed or for other reasons.

pitag-ha avatar Jul 03 '23 10:07 pitag-ha