boostorg / boostorg/parser

Performance in debug mode degraded by slow std::string::const_iterator constructor

Open
#298 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
182
Forks
28
PR merge metrics
No merged PRs in 30d

Description

Unfortunately, boost.parser is very slow in debug mode.
Fortunately, this would be rather easy to change.

I have colleagues complaining because the Boost.Parser based parser takes forever in debug mode. I fired up VTune and quickly found that more than 60% of the total runtime is spent in the constructor and destructor of std::string::const_iterator. Boost.Parser is written under the assumption (it seems) that copying an iterator is basically free, which is probably true in release mode. But in MSVC/Debug it is a very expensive operation.

Looking at the code, I got the impression that in most places, nothing would be lost passing the iterators as const-ref instead of by-value. And the debug runtime would dramatically improve. Would you be open to change to const-ref for most iterator arguments? If so, I'd consider creating a Pull request doing this. Or am I missing a use case where the pass-by-value is beneficial?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.