-
Notifications
You must be signed in to change notification settings - Fork 12
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 Increases #17
Comments
Define slow as compared to, say, every other implementation on the market. Now - you're right. I just tried to parse KJD and not only did it take On Wed, Dec 7, 2011 at 03:45, Colin Noga
|
Well, I can work on the speed increases later, I’m still becoming familiar with ruby for now. I only started it like, 4 days ago in order to help a friend write a rails site for his Go ladder. So, uh, have patience. |
Neat. On Wed, Dec 7, 2011 at 22:36, Colin Noga
|
Documentation updating, fixing the output inside an iterator issue, and the overloaded initializers. Plus any fixes you need to properly parse KJD. An easy thing to do to make the API more friendly would be the property methods - it’s just busy work, after all. The speed increases are the most important update that doesn’t necessarily need to go in 2.0 |
The SGF parser is slllloooow.
Specifically...
SGF::Parser#next_character:
[email protected]? && @stream.sysread(1) is really slow. The stream methods are poor choices because they don’t get cached at all. You’d find exponential improvements in speed by reading the whole thing to a buffer at once, and then just slicing it or iterating over it.
SGF::Parser#parse_property
is really slow, due to the while loops in parse_comment, parse_multi_property and parse_generic_property. Please use built in string methods instead, they are much faster than your pure ruby implementation. Since you should now be reading to a buffer, you don’t need to go over ever character individually - expect huge speed ups.
SGF::Parser#still_inside_node?
steam methods AND while loop. lucky this doesn’t get called much.
Generally, reworking the parser to work with built-ins on a buffered read should do two things:
The text was updated successfully, but these errors were encountered: