1. 11

  2. 3

    Nice! I left a comment on the post too, but you don’t need to do that configuration: cargo build includes -g already, by default. cargo build --verbose will show you all the flags.

    Oh, and benchmarking should probably be done with optimizations on…

    1. 1

      oh dang, nice. I suspected something like this might have been the case after I published the blog post. Thanks for letting me know about --verbose. I’m going to rerun the benchmarks with optimizations now.

      EDIT: yup, ten times faster with optimizations.

      $ time target/release/noise
      real    0m0.120s
      user    0m0.111s
      sys     0m0.007s
    2. 2

      People always assume mutexes are slow, but locking and unlocking are actually super fast operations. The slowness only comes in if there is contention between threads, and you have threads waiting a long time for each other. Mutexes themselves are relatively quick, 4x faster than an uncached fetch from main memory if you trust Peter Norvig’s chart.