Closed Bug 1104062 Opened 10 years ago Closed 10 years ago

Optimize or remove thCloneJobs.resetCounts

Categories

(Tree Management :: Treeherder, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mdoglio, Assigned: camd)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

Attachments

(1 file)

49 bytes, text/x-github-pull-request
mdoglio
: review+
Details | Review
According to the profiler this function is very expensive in terms of cpu. I'm not sure what its purpose is. After commenting this function I was able to load 120 pushes without getting the unresponsive script dialog.
Keywords: perf
Blocks: 1067846, 1071081
No longer blocks: 1071081
Priority: -- → P1
Looking at resetCounts(), it appears that we walk over ALL resultsets for EACH resultset. So that is a multiplier that's in incredible waste of time. This may not be the ONLY inefficiency, but it's one of them.
Assignee: nobody → cdawson
Status: NEW → ASSIGNED
This PR changes the ``resetCounts`` function to operate on only a single ``resultset`` rather than ALL resultsets in the ``resultSetMap``. And that function is now only called once per resultset after all the platforms have been updated. Previously, this function was called on ALL ``resultsets`` each time a ``platform`` within a ``resultset`` was updated. 10 resultsets X 30 platforms = 3000 calls. As you loaded more ``resultsets``, this was compounded. Now this is called once for a resultset only when that resultset is updated (or initially loaded).
Attached file ui PR
Attachment #8535103 - Flags: review?(mdoglio)
Attachment #8535103 - Flags: review?(mdoglio) → review+
Commits pushed to master at https://github.com/mozilla/treeherder-ui https://github.com/mozilla/treeherder-ui/commit/9ed0ab43b59043e7bbc33a802fc8c1b92c3892f6 Bug 1104062 - only update counts once per resultset on changes https://github.com/mozilla/treeherder-ui/commit/89b6362bd0c378cac26ed87071889d6ea9c10957 Merge pull request #299 from mozilla/optimize-resetcounts Bug 1104062 - only update counts once per resultset on changes
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Commits pushed to master at https://github.com/mozilla/treeherder https://github.com/mozilla/treeherder/commit/57c6318cece400d4a6414de157c7b1ab6db9381e Bug 1104062 - only update counts once per resultset on changes https://github.com/mozilla/treeherder/commit/dd31025b8cca9121a17a6c07f24c89c735dc0871 Merge pull request #299 from mozilla/optimize-resetcounts Bug 1104062 - only update counts once per resultset on changes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: