-
Notifications
You must be signed in to change notification settings - Fork 94
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
Update threephase package #173
Conversation
How long did initialization take before this optimization? |
More than 20 seconds with multi-thread acceleration. |
Thanks for doing this! I just got back from US Nationals, and will take a look at this once I'm on a laptop. Did you see that the travisci build failed? Any idea why? |
To answer your other question, random state 4x4 is excluded from the GWT build in this file https://github.com/cubing/tnoodle/blob/master/scrambles/src/scrambles.gwt.xml I remember that 4x4 took ~15 minutes in Chrome on my laptop and maybe 15 seconds per scramble. I'm really excited to see how it performs with your changes! |
c.set(i); | ||
for (int j=0; j<48; j++) { | ||
int idx = c.get(); | ||
occ[idx>>>5] |= (1<<(idx&0x1f)); | ||
raw2sym[idx] = count << 6 | syminv[j]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is your code, but I would put more parens here, it's not obvious to me what the order of operations is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"raw2sym" is a temporary array for accelerating the initialization of the Center1 move table by replacing the "int getsym()" function. After the initialization of the move table, the "raw2sym" table can be removed as the "int getsym()" function won't be called much times later.
The initialization time of the javascript version is about 4~5 seconds on my laptop with some javascript-based optimization. |
Wow, that's awesome! 4-5 seconds is huge. What sort of javascript optimizations are you making? Are you able to build tnoodle-android locally? Try out "./tmt make -p tnoodle-android". |
I just ran a vanilla tnoodle build, and it looks like it's hitting this issue too: https://travis-ci.org/cubing/tnoodle/builds/21301678, so this doesn't look like it has anything to do with your changes. I'll look into this. |
I did some magic to |
Well, I've integrated the converted and optimized javascript version into cstimer(http://www.cstimer.net/new/). You can check the uncompressed version at: |
http://2.cstimer.sinaapp.com/js/scramblers/scramble_444.js is the optimized version, or the unoptimized version? Can you send me links to both, so I can diff them and compare? What do we need to do to get tnoodle/gwt to produce the best javascript by default? GWT has good support for overriding functions/methods with hand written javascript if need be. |
It's the optimized version. The unoptimized version can be generated via tnoodle(./tmt make dist -p tnoodlejs). I removed most of the redundant functions and operations, such as "depth << 24 >> 24" => "depth" because "depth" is always < 128 although the type of "depth" is "byte" in java. |
This is working great for me. Really awesome work. I've added a comment here https://github.com/cubing/tnoodle/issues/114#issuecomment-51654014 to look into changing tnoodle so that we produce better javascript by default, but that might be a hard problem to solve. |
Update threephase package to be way faster at generating pruning tables.
After optimization, the initialization time of threephase is now less than 7 seconds on my laptop.
BTW, once I try to compile it into javascript, the generated .js file doesn't contain the threephase package. Do you know how to compile it with threephase package included?