Ticket #140 (new enhancement)

Opened 19 months ago

Last modified 7 months ago

Benchmark if passing "const std::string &" or just "std::string" is better

Reported by: olly Owned by: nobody
Priority: lowest Milestone: 1.1.0
Component: Other Version: SVN trunk
Severity: minor Keywords:
Cc: Blocked By:
Operating System: All Blocking:

Description (last modified by richard) (diff)

Most modern compilers seem to implement std::string using PIMPL, so the class is just a single pointer and pass-by-value may be more efficient.

MSVC is the notable exception I'm currently aware of. Macro magic is one possible solution. Or perhaps benchmarking will reveal moving helps non-MSVC without penalising MSVC much.

Either way, most of the library passes by const ref, but some of the internals pass by value, and we should standardise!

Change History

Changed 19 months ago by olly

  • blocking set to 120

Changed 9 months ago by olly

  • blocking changed from 120 to 160

We're certainly not going to change the internals of 1.0.x in such a sweeping way at this point, but it would be worth benchmarking this before 1.1.0 if we can.

Changed 9 months ago by trac

  • platform set to All

Changed 7 months ago by richard

  • description modified (diff)
  • milestone set to 1.1

Changed 7 months ago by richard

  • blocking deleted
Note: See TracTickets for help on using tickets.