Ticket #140 (new enhancement)
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
Note: See
TracTickets for help on using
tickets.
