Merlin's time-space trade-off
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.
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.
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.
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.