-
Notifications
You must be signed in to change notification settings - Fork 224
Speed up template matching for webwork-rep-to-static #2341
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
Speed up template matching for webwork-rep-to-static #2341
Conversation
|
Yes, there are a few complicated expressions I'd love to get a handle on. This is one of them. Not sure I've ever totally understood it, and hoped that it might even become (already is?) obsolete as we get better stuff back from servers. Anyway, I'm not sure I totally understand its purpose, so I'd like to ask @Alex-Jordan to have a hard look as part of a review. Looks good to me, in principle, but I've not done a full review yet. |
|
Commenting about the changes to the old line 2571:
|
|
|
|
Wanted to get this in now. Questions:
Can't see that this has happened. Will wait to do further work until I hear about this. Testing outputs of sample chapter (HTML, LaTeX). This must be happening in the assembly phase when constructing the static version (since it is a preview for HTML use). The "?" is new, and I don't think we want it. There's another exercise that shows this also. -<li id="extracted-webwork-75-1-1-1-1-1"><div class="para" id="extracted-webwork-75-1-1-1-1-1-1">Red</div></li>
-<li id="extracted-webwork-75-1-1-1-1-2"><div class="para" id="extracted-webwork-75-1-1-1-1-2-1">Blue</div></li>
-<li id="extracted-webwork-75-1-1-1-1-3"><div class="para" id="extracted-webwork-75-1-1-1-1-3-1">Green</div></li>
+<li id="extracted-webwork-75-1-1-1-1-1"><div class="para" id="extracted-webwork-75-1-1-1-1-1-1">?</div></li>
+<li id="extracted-webwork-75-1-1-1-1-2"><div class="para" id="extracted-webwork-75-1-1-1-1-2-1">Red</div></li>
+<li id="extracted-webwork-75-1-1-1-1-3"><div class="para" id="extracted-webwork-75-1-1-1-1-3-1">Blue</div></li>
+<li id="extracted-webwork-75-1-1-1-1-4"><div class="para" id="extracted-webwork-75-1-1-1-1-4-1">Green</div></li>+\item{}?%
\item{}Red%
\item{}Blue%
\item{}Green% |
|
It looks like the added Side note: the older mechanism in PG for creating a popup list only presents the choices the author wrote. Authors did not like seeing the HTML select element be pre-populated with the first of their answer options, so authors started making '?' be their first option. Fine for HTML rendering, but not for static PTX. Why have a bullet choice that is a '?'? A newer mechanism for doing this lets PG authors write only the actual choices, and separately uses a placeholder text attribute for the '?'. When that is used, we (PTX) do not worry about the unwanted '?' showing up. If all/most PG problems could evolve to use this newer method, we could remove this awkward question mark filter from here. But I think that is a future project. |
|
Would it be possible to get this one sorted? I'd love to get this speed-up in soon for everybody building WW problems. |
b55eb20 to
4db8405
Compare
|
Did a force push with the updated clause in the |
|
Thanks! Should merge soon. |
|
Excellent! Thanks for another speed-up. I'll let @sean-fitzpatrick know! |
|
I'm looking forward to trying it out! |
|
Down to 3 and a half minutes! |
The match logic for 'webwork-rep-to-static' was causing significant slowdowns. This reimplements to favor quick matching and then filtering on the matched elements.
Produces clean diffs on webwork sample chapter and reduces build time from ~10s to under 8s.
On APEX Calculus, this and get_publisher_varaible reduce the build time of APEX from ~20m to ~2.5m.