Closed demoray closed 4 months ago
Using not_expired requires calling elapsed for every entry in the hashset, which requires a syscall. By calling duration_since, we only have a single syscall regardless of how many entries are in the map.
not_expired
elapsed
duration_since
I ran into this in some of my own code. thanks!
Using
not_expired
requires callingelapsed
for every entry in the hashset, which requires a syscall. By callingduration_since
, we only have a single syscall regardless of how many entries are in the map.