-
Notifications
You must be signed in to change notification settings - Fork 183
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
Do Background Processing to Determine Performance #139
Comments
While I'm waiting on review for the slug support stuff, I'm taking a look into this. |
So I have it (mostly) working, but the structure of a whole bunch of code needs to change because this fundamentally makes This is especially bad because there are a bunch of callsites to |
So a few thoughts on this first pass-through:
I think almost all of the web worker stuff can be moved into this particular call:
We can kill two birds with one stone: Collect a list of all the function calls that occur with their arguments (what happens now) and get a count of how many function calls occur (which needs to occur). I would then move the rest of runCode() to occur after the viability of the code has been determined.
|
As for the first point, I am actually calling the draw function: https://github.com/phleet/canvas-editor/blob/cb74ee4e56a21920406ec06e2d7e5929659b8c0a/js/worker.js#L34. This could be done alternatively by modifying |
Oh! Yeah, that's not a bad idea, actually. |
Actually, appending |
Naturally. |
Fixed over here: http://phabricator.khanacademy.org/D105 |
Right now infinite loops (or incredibly complex programs) will just cause the web page to hang. The only viable solution is to run a neutered version of the code inside a web worker to make sure that it won't hang forever (or, at least, a very long time). We can move much of the code execution logic (and JSHint) into there, which will help, at least.
We should determine what a good threshold is. 1 second of run time? If we're expecting instant compilation we're going to have to be pretty aggressive about this.
The text was updated successfully, but these errors were encountered: