Sorry, false alarm! I was misled by the `nim` command's help text:
--opt:none|speed|size optimize not at all or for speed|size
Note: use -d:release for a release build!
Run
**I took this to mean that ``-d:release`` was *sufficient* to get a fully
optimized release build. Nope!** Once I started to look at the x86 disassembly
it was painfully non-optimal. 🤮
I changed the flags to `-d:release --opt:size --stackTrace:off --lineTrace:off
--assertions:off --checks:off`, and everything got about 20 times faster... Now
the code is spending almost all its time in `kevent` waiting for I/O, as it
should be.
**Question:** Is this the optimal set of flags for a release build? Is there an
easy way to toggle between debug and release builds, without having to edit a
bunch of lines in my `nim.cfg` file?