measureme icon indicating copy to clipboard operation
measureme copied to clipboard

Validate `unsafe` blocks are actually giving us a performance improvement

Open wesleywiser opened this issue 6 years ago • 1 comments

We have various places in measureme where we do low-level unsafe operations for efficiency. Example:

https://github.com/rust-lang/measureme/blob/8d2d4fdaebc07757cf5cbf9b931be72d10dc9d8c/measureme/src/raw_event.rs#L103-L113

We should validate that these places are actually improving performance over their safe counterparts.

wesleywiser avatar Dec 10 '19 15:12 wesleywiser

Not exactly the same but other experiences like https://github.com/BurntSushi/fst/commit/7440fa7a5da2f39e8387336006a8c23375d774a1 suggest that moving from unsafe to safe code for byte-level conversions like these may not provide a measurable (heh) penalty.

workingjubilee avatar Aug 20 '20 02:08 workingjubilee