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

optimizing xml loading (spirit grammars) #1028

Closed
springmeyer opened this issue Jan 13, 2012 · 5 comments
Closed

optimizing xml loading (spirit grammars) #1028

springmeyer opened this issue Jan 13, 2012 · 5 comments

Comments

@springmeyer
Copy link
Member

A surprising amount of load_map() time/calls are spent with color_factory::init_from_string() (and expression::compile()).

The reason is that the grammars a being created per parse. We need to create the grammars once. We could create them globally (and perhaps leverage boost::thread_specific_ptr) but in this case it is easy to make them members of the map_parser.

The grammar getting created/destroyed (I think):

springmeyer pushed a commit that referenced this issue Feb 25, 2012
… (TODO - still need to handle text/shield expressions)
@springmeyer
Copy link
Member Author

next step (before this can be closed) is to figure out how to pass grammars to the from_xml() implementations in text_placement and formatting (/cc @herm ).

@springmeyer
Copy link
Member Author

progress evident: majority of time spent has now shifted from the creation of the grammar to the actual phrase_parse:

@springmeyer
Copy link
Member Author

but, where expressions are not re-using the grammar is still twice a slow:

@herm
Copy link
Member

herm commented Mar 2, 2012

Perhaps we could create a new data structure to handle xml processing. It could store the grammar with correct encoding settings. This data structure could be passed to all function calls and it would be easier to expose it in python. See also #1041.

@springmeyer
Copy link
Member Author

@herm - that sounds good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants