News for hackers. Stuff that matters.
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:

  % cargo run --release
  [..]
  Parsing speed: 103761177.00 Bytes/s
  Parsing speed: 103.76 MB/s
  Parsing speed: 0.10 GB/s

  % doas cargo run --release
  [..]
  Parsing speed: 105401032.21 Bytes/s
  Parsing speed: 105.40 MB/s
  Parsing speed: 0.11 GB/
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
Re:Parsing JSON in 500 lines of Rust by nine_k on Wednesday February 19, 2025 @01:07PM (#43105252)
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.