Try to improve Camino.Map.Justified.lookup performance #8

Closed
opened 2025-05-02 16:20:06 -04:00 by xand · 1 comment
Owner

In Camino.Map.Justified:

  • Change Key to something like TraceResult from Data.Map.Internal.
  • Have member record a trace of the key lookup.
  • Rewrite lookup to follow the trace recorded in Key by member.

This could avoid repeating potentially expensive comparisons each time someone calls lookup on a known key.

In `Camino.Map.Justified`: - [ ] Change `Key` to something like `TraceResult` from `Data.Map.Internal`. - [ ] Have `member` record a trace of the key lookup. - [ ] Rewrite `lookup` to follow the trace recorded in `Key` by `member`. This could avoid repeating potentially expensive comparisons each time someone calls `lookup` on a known key.
xand self-assigned this 2025-05-02 16:20:06 -04:00
Author
Owner

The main caveat I can see is that operations which change the traces in the underlying Map would render these trace-based Keys invalid.

Right now this is a non-issue as the JustMap API exposes no such operations. But it would make it much harder to add them in the future.

The main caveat I can see is that operations which change the traces in the underlying `Map` would render these trace-based `Key`s invalid. Right now this is a non-issue as the `JustMap` API exposes no such operations. But it would make it much harder to add them in the future.
xand 2025-05-14 13:37:53 -04:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
xand/camino#8
No description provided.