Skip to content
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

Slow project.js / app/views/show.js.erb #931

Closed
stefan-langenmaier opened this issue Jun 27, 2013 · 7 comments
Closed

Slow project.js / app/views/show.js.erb #931

stefan-langenmaier opened this issue Jun 27, 2013 · 7 comments

Comments

@stefan-langenmaier
Copy link
Contributor

platform: 2.3.1 # supported: 2.2.4, 2.3.2
backlogs: 1.0.2 but this part of the code is the same as with the current 1.0.3 # supported: 1.0.5
ruby: 1.9.3 # supported: 1.9.3, 2.0.0

The rendering of the backlogs tab is slow here because the server has to load project.js which is created with app/views/show.js.erb if I see it correctly. This file takes about 7s out of the 8-9s total loading time on my test system.

In this file the following code part is responsible for about 90% of that time.

=begin
 a release can contain stories of all projects which it is visible
 but droppables are only self_and_descendants of the current view to avoid user confusion by vanishing stories
=end
    project_releases = Hash[Project.visible.find(:all).map{|project|
      [
        project.id.to_s,
        project.shared_releases.open.visible.reject{|r|
          !@project.projects_in_shared_product_backlog.include? project
          }.collect{|v| v.id.to_s }
      ] if project
    }]

The installation has about 25k issues, with about 500 projects that can be nested up to 4 levels deep.

Is anyone else having similar problems? Are there configuration options to improve the speed, if not all sprint/version sharing modes are used? Can the code be optimized?

As I can see in this commit the code is there for a reason. What would happen if it got removed?

@bohansen
Copy link
Contributor

bohansen commented Jul 4, 2013

Haven't had that many projects, but it looks like a case of bad scaling with lots of projects. I have done a small performance improvement, but we might have to consider another way of fetching this information.
It determines which stories are allowed to be moved into which release on the backlogs page.
You might try latest master and see if it helps anything.

@stefan-langenmaier
Copy link
Contributor Author

I think there is a small improvement (or actually big, about ~1s) relative to the whole loading process. Nevertheless I just haven't enough data to really verify performance changes.

The only thing I can verify is that it is still slow/not fast and that's caused by the project.js request as you can see in the attached screenshot.

firebug-backlogs-after-patch

bohansen added a commit that referenced this issue Jul 29, 2013
…ovement for #868 and improvement on total loading time for #931 and #938.
bohansen added a commit that referenced this issue Jul 29, 2013
@bohansen
Copy link
Contributor

I have a few improvements. Could you test latest master?

bohansen added a commit that referenced this issue Jul 30, 2013
…ses avoid costly subselects if unnecessary. It was quite bad on performance when adding new sprints. (see #931 and #938)
@stefan-langenmaier
Copy link
Contributor Author

Yes that's a huge speed improvement. No problems for me so far. I see if I can get it tested by more people.

@bohansen
Copy link
Contributor

Excellent, I have made a new release. Out of curiosity how much did it improve? I don't have as big a database to test :).

@stefan-langenmaier
Copy link
Contributor Author

The specific code is now 10 times faster and the whole page loads in a fifth of the time (for my data).

backlogs-after-patch

@bohansen
Copy link
Contributor

Cool, I saw something similar from 3-4 seconds to 400ms for the show.js. There are definitely still places which could be improved, but I think we got bang for the buck with this one :). Thanks for the analysis and testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants