News for hackers. Stuff that matters.
Re:Comparing C and C++ usage and performance with a real wor... by humanrebar on Sunday September 03, 2017 @11:42AM (#15161998)
Interesting project!

The C++ version uses many memory allocations. Using allocators some in the C++ program would certainly cut down on the number of allocations. It would also be interesting to see if doing so also improved performance.

Similarly, it would be interesting to see if using the C++17 string_view (or the gsl version if C++17 isn't available to you) instead of `const string &` parameters affected performance.

Finally. I see that in most (all?) cases, objects are returned by value, not returned through reference parameters or pointers. It's interesting to see that that choice didn't compare poorly to a C implementation.

There are no comments on this comment yet.