perf: inline the hash accessor of Name (#12583)
This PR inlines the accessor for the computed hash field of `Name`. This ensures that accessing the value is basically always just a single load instead of doing a full function call.
This commit is contained in:
parent
ae15d787c1
commit
1f03e32520
1 changed files with 1 additions and 1 deletions
|
|
@ -4685,7 +4685,7 @@ inductive Name where
|
|||
with
|
||||
/-- A hash function for names, which is stored inside the name itself as a
|
||||
computed field. -/
|
||||
@[computed_field] hash : Name → UInt64
|
||||
@[computed_field, inline] hash : Name → UInt64
|
||||
| .anonymous => .ofNatLT 1723 (of_decide_eq_true rfl)
|
||||
| .str p s => mixHash p.hash s.hash
|
||||
| .num p v => mixHash p.hash (dite (LT.lt v UInt64.size) (fun h => UInt64.ofNatLT v h) (fun _ => UInt64.ofNatLT 17 (of_decide_eq_true rfl)))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue