Hey everyone, this is quick post from my phone.
I am reading Nim in Action and I have noticed that the algorithm module includes the sort proc which takes a procvar comparator.
As a C programmer I am well aware of qsort performance issues due to indirection, cache misses etc from the virtual function call.
Is the Nim sort in the same boat here, or can the compiler, say inline the comparison?
Thx :)
Yes, there is some performance decrease due to compare proc, but not too much, maybe about 25 % as I remember.
See
Ok, I guess if I need an extremely fast sort I can create my own version based on the stdlib implementation that uses generics or templates.
Thank you!