Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix performance issue in Wikifier.parse #190

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dmchurch
Copy link

@dmchurch dmchurch commented Sep 9, 2018

The Wikifier.textPrimitives.unquoted method of parsing quoted strings is very slow when dealing with long strings that look like variable names, since it has to test each initial substring to see if it qualifies as "unquoted". This fixes the problem by removing all quoted strings from the input before parsing and restoring them after all of the calls to alter().

This can be tested by calling another passage as a macro and passing a very long variable-looking name inside a string, for example;

<<SomePassage "$this_is_a_very_long_variable_name">>

The Wikifier.textPrimitives.unquoted method of parsing quoted strings is very slow when dealing with long strings that look like variable names, since it has to test each initial substring to see if it qualifies as "unquoted". This fixes the problem by removing all quoted strings from the input before parsing and restoring them after all of the calls to alter().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant