Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up`string` can cause parsing to be slow with `verbose_error` #15
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
m4rw3r
Feb 28, 2016
Owner
The string parser could be made to just return the Error::Expected on the differing character. This might even allow for removal of the verbose_error feature completely since Error will not contain any heap-allocated data.
This will result in slightly less useful error messages from the string parser, since it will not display the full string. In addition to this the error position returned from the string parser would be set to the unexpected character instead of the start of the match (the current behaviour). This could break some buffer-usage where it is expected to restart the parsing from the start of the attempted string match instead of restarting from the offending character.
|
The This will result in slightly less useful error messages from the |
m4rw3r
referenced this issue
Feb 28, 2016
Closed
Debug mode (feature) including backtraces in errors #23
m4rw3r
added this to the 0.3 milestone
Feb 28, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
m4rw3r
Feb 28, 2016
Owner
Another possibility is to only allow 'static lifetime on the string to match against, but this will probably be too limiting.
Combining #23 with just reporting the offending character (ie. you get a full back-trace pointing to the string parser) will most likely solve the issue where you actually need to see which string it is trying to match.
|
Another possibility is to only allow Combining #23 with just reporting the offending character (ie. you get a full back-trace pointing to the |
m4rw3r commentedNov 27, 2015
Problem
stringallocates a copy of the string it was trying to match on error inverbose_errormode. This can cause really bad performance when eg. trying to match multiple different tags using nestedor-combinators (used in the mp4-benchmark from nom_benchmarks).