tzlaine / parser

A C++ parser combinator library.
Boost Software License 1.0
69 stars 12 forks source link

Look at the current implementation around `scoped_trace_t`; optimize if necessary #152

Closed tzlaine closed 3 months ago

tzlaine commented 4 months ago

From Peter Dimov in the Boost review:

the top function becomes the constructor of scoped_trace_t. (It's probably not getting inlined.)

Looks like the tracing functionality costs a lot even when off.

If this is still the case, the flag that carries the information for whether or not to trace may need to become a template parameter.

tzlaine commented 4 months ago

This appears not to be necessary (see the commit on the branch above). I modified scoped_trace_t to be empty when weare doing a no-trace parse, but it made no difference in my perf tests.

tzlaine commented 4 months ago

The template change was in fact necessary.