Re:Parsing JSON in 500 lines of Rust
by arp242 on Wednesday February 19, 2025 @04:52AM
(#43100415)
I guess it's faster with sudo because the regular account has some resource limits, or something? Didn't mention which system is being used (Linux? macOS? Something else?) but I can't repro on my Linux system, where performance is identical:
[ Parent
| on HN ]
Re:Parsing JSON in 500 lines of Rust
by nhatcher on Wednesday February 19, 2025 @07:30AM
(#43101341)
Wild guess, but different versions of Rust for the users?
Re:Parsing JSON in 500 lines of Rust
by danbulant on Wednesday February 19, 2025 @10:48AM
(#43103352)
Too fast of a compile time, different versions would recompile the whole dep tree. And even just the end code would take more than .02s
One run is not statistically significant %) Try running 10 times each, throw away the fastest and the slowest, indicate the average and min/max among the remaining runs.
Any random background processes might slow the system slightly during the initial run. A slightly better state of the page cache on the second run could play a role, too. Flushing the FS cache before each run might be a good idea; doing cat file.json > /dev/null could be an equally good idea.