-
Notifications
You must be signed in to change notification settings - Fork 15
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
Performance Improvement Ideas #58
Comments
Posting my initial thoughts here. Keep in mind that some of this is speculation and isn't a reason to at least give it a shot:
I don't think minification improves performance for anything but transfer over the wire. If it's loading from
AFAIK, most JS VMs will not compile a function at all until it is executed. I'd need to run more benchmarks to be sure about it, though.
I can see what I can do about this. I've got a couple ideas, but just to clarify before I spend too much time on it,
This would probably be pretty cool, but I wonder if the effort would be worth it. We could check the benefit by precompiling a spec run with and without unfocused specs (that is, literally remove unfocused specs from the spec code) and timing the compilation time. Then run each of those and check the runtimes. My hypothesis is that they would differ only slightly and that the RSpec load time would dwarf it no matter what we do.
This might have a pretty big performance impact for failing specs. Exceptions are probably the worst-performing thing you can do in a JS VM. Generating an exception, throwing it, and catching it all cause deoptimizations — which is bad enough on its own, but the process of unwinding the stack and generating that stack trace is also slow inside the VM itself. JRuby (at least pre-9k) suffers from this same problem and for almost the same reason. MRI has internal optimizations for generating stack traces (so you can call |
@jgaskins - Thanks for the info. I'll close this now the the main next step will be to get rid of the metadata exception throws to get trace info. |
@jgaskins - Just so you know, the exception throwing I mentioned above used to happen for every example, not just failing ones. It was being used to give RSpec metadata about where each example is (RSpec normally uses |
@jgaskins - https://github.com/karma-runner/karma-closure is doing number 4. In my case, I'd have to do it with a webpack/opal loader because I decided getting into the guts of Karma with https://github.com/wied03/karma-opal-rspec/ was a losing proposition. |
A lot of time gets spent loading the example groups and examples that will be tested.
The text was updated successfully, but these errors were encountered: