Skip to content

Commit

Permalink
Merge pull request #751 from ejgallego/better_hash_state
Browse files Browse the repository at this point in the history
[coq] [memo] Better parameters for polymorphic state hashing
  • Loading branch information
ejgallego authored Jun 5, 2024
2 parents 1439571 + 0614c4c commit 4ce6614
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
- [fleche] Preserve view hint across document changes. With this
change, we get local continuous checking mode when the view-port
heuristic is enabled (@ejgallego, #748)
- [memo] More precise hashing for Coq states, this improves cache
performance quite a bit (@ejgallego, #751)

# coq-lsp 0.1.10: Hasta el 40 de Mayo _en effect_...
----------------------------------------------------
Expand Down
7 changes: 6 additions & 1 deletion coq/state.ml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ let compare (x : t) (y : t) =
else 1

let equal x y = compare x y = 0
let hash x = Hashtbl.hash x

let hash x =
(* OCaml's defaults are 10, 100, but not so good for us, much improved
settings are below (best try so far) *)
let meaningful, total = (64, 256) in
Hashtbl.hash_param meaningful total x

let mode ~st =
Option.map
Expand Down

0 comments on commit 4ce6614

Please sign in to comment.