Permalink
Browse files

User.getBuilds() is crazy-expensive, since it iterates over all build…

…s. Restrict it to the most recent builds.
  • Loading branch information...
1 parent 3cfd2ef commit 5f64e483e9375632c71e94b927a400173897d35c @huybrechts committed Jan 6, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 core/src/main/java/hudson/model/User.java
@@ -384,7 +384,7 @@ public String getDisplayName() {
public RunList getBuilds() {
List<AbstractBuild> r = new ArrayList<AbstractBuild>();
for (AbstractProject<?,?> p : Jenkins.getInstance().getAllItems(AbstractProject.class))
- for (AbstractBuild<?,?> b : p.getBuilds())
+ for (AbstractBuild<?,?> b : p.getBuilds().newBuilds())
if(b.hasParticipant(this))
r.add(b);
return RunList.fromRuns(r);

0 comments on commit 5f64e48

Please sign in to comment.