-
Notifications
You must be signed in to change notification settings - Fork 554
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
Report generation really really slow #191
Comments
Not sure out of the blue. Please note that JRuby support is not official yet, although essentially it should work and I've had reports of such. As a linuxer I can't comment on Windows-related issues though. Maybe you could open up the (simplecov) source code (especially of the html formatter) and sprinkle in some puts statements to see which methods are taking so long and if there's some weird recursion going on. |
OK I wanted to know if it was a known case and also have an end point if some others have the same issue. Just to pick a blind guess I would say there is a call somewhere which, in JRuby, is translated into some nasty string concatenation. The way the time keeps increasing would match this kind of problem. On Monday I'll try to put some logs here and there to identify the problematic method, until then I don't have access to the required configuration. I'll keep you informed. |
OK so I've been tracing which part of the code was so damn slow and identified it in theses lines in simplecov-html File.open(File.join(output_path, "index.html"), "w+") do |file|
file.puts template('layout').result(binding)
end I've been testing separately the call to |
OK so the solution came from this post on StackOverflow: http://stackoverflow.com/questions/8064175/writing-unix-line-breaks-on-windows-with-jruby |
As far as I remember the binary flag has quite a different meaning in Ruby on Windows vs. on Unix. I think it'd be better to have it open it in "wb+" only on Windows, possibly even only on JRuby. Do you have some way to test MRI behaviour with wb+ on Windows? Pull request would be great :) |
Here is the pull-request: simplecov-ruby/simplecov-html#16 |
FYI I used this post to detect Windows: http://stackoverflow.com/questions/4871309/what-is-the-correct-way-to-detect-if-ruby-is-running-on-windows |
recommend closing in favour of the linked PR. |
I'm working on a Windows/JRuby project and the time to generate the HTML report is growing exponentially compared to the size of the project.
At this point I'm talking about 79 files in total, 1147 relevant lines and 333 tests (RSpec) and once the tests are done (about 1 minute) the report needs around 10 minutes to be written.
Is there something in the way we organize the files that would explain this ? I don't really think so because I've been working on a way bigger application (Mac/MRI) and it only needed a few dozen seconds. What's you opinion ?
The text was updated successfully, but these errors were encountered: