10 Jun 2017
Tags:
C++
Over two weeks ago, I posted an article about by-value parameters in the loop and transform
idioms. Included in one of the plots was an anomaly that, when I considered it more closely, blew up the analysis. In fact, I’ve spent most of the past two weeks following up on the implications of this seemingly small anomaly. Ultimately, it’s given me reason to question the reliability of microbenchmarks in a wide range of circumstances. And after two weeks of work, using a variety of tools, I remain unclear about the underlying phenomenon. I’m writing a series of posts to clarify what I’ve learned to date and to set my future agenda.
more ...
24 May 2017
Tags:
C++
Unique strings—null-terminated strings uniquely identified by their char const *
—are the simplest type considered in this series of posts. Constructing, copying, moving, and assigning these strings are trivial operations on a single pointer. No destructor code is required.
more ...
22 May 2017
Tags:
C++
The benchmarks comparing transform
to a
loop also highlighted the substantial contribution that copying values made to their performance. Copying costs become especially noticeable for complex types, such as standard strings too long to fit in the short string optimization.
more ...
03 May 2017
Tags:
C++
The last post presented the baseline C++ code and its generated machine code. Now it’s time to compare the code generated by the std::transform
idiom and see how well it fares.
more ...