Sorting jobs is time consuming

Bug #564703 reported by Marc Legris
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Checkbox
Fix Released
Wishlist
Javier Collado

Bug Description

Feature request:
When checkbox runs initially it gathers information on the machine it is running on. If this information could be stored so it only runs once this would save time. Some machines take as long as 10 minutes to run this task.

Related branches

Changed in oem-qa-checkbox:
assignee: nobody → Javier Collado (javier.collado)
importance: Undecided → Wishlist
status: New → Confirmed
affects: oem-qa-checkbox → checkbox
visibility: private → public
Revision history for this message
Marc Tardif (cr3) wrote :

The time spent during initial data gathering is mostly split between resources and jobs. As far as resources are concerned, you might like to run each of the commands under the resources.txt* file in the base checkbox package. If these are reasonably quick, then the problem is not with the resources. As far as jobs are concerned, the current algorithm for topologically sorting jobs has an order of growth of O(n^2), ie quadratic. This means that Checkbox becomes significantly slower as the number of jobs increases.

Please let me know if any of the resource commands take a significant amount of time to make sure that the problem is really with the gathering of jobs. Thanks!

Changed in checkbox:
status: Confirmed → Incomplete
Revision history for this message
Marc Tardif (cr3) wrote :

For your convenience, simply provide the output from running the following commands:

time /usr/share/checkbox/scripts/cpuinfo_resource >/dev/null
time /usr/share/checkbox/scripts/cdimage_resource >/dev/null
time /usr/share/checkbox/scripts/dpkg_resource >/dev/null
time /usr/share/checkbox/scripts/gconf_resource >/dev/null
time /usr/share/checkbox/scripts/lsb_resource >/dev/null
time /usr/share/checkbox/scripts/meminfo_resource >/dev/null
time /usr/share/checkbox/scripts/module_resource >/dev/null
time /usr/share/checkbox/scripts/package_resource >/dev/null
time /usr/share/checkbox/scripts/udev_resource >/dev/null
time /usr/share/checkbox/scripts/uname_resource >/dev/null

Revision history for this message
Marc Legris (maaarc-deactivatedaccount-deactivatedaccount-deactivatedaccount-deactivatedaccount-deactivatedaccount) wrote :

time /usr/share/checkbox/scripts/cpuinfo_resource >/dev/null

real 0m0.026s
user 0m0.016s
sys 0m0.012s

time /usr/share/checkbox/scripts/cdimage_resource >/dev/null

real 0m0.035s
user 0m0.028s
sys 0m0.008s

time /usr/share/checkbox/scripts/dpkg_resource >/dev/null

real 0m0.048s
user 0m0.028s
sys 0m0.020s

time /usr/share/checkbox/scripts/gconf_resource >/dev/null

real 0m0.109s
user 0m0.084s
sys 0m0.016s

time /usr/share/checkbox/scripts/lsb_resource >/dev/null

real 0m0.158s
user 0m0.136s
sys 0m0.020s

time /usr/share/checkbox/scripts/meminfo_resource >/dev/null

real 0m0.035s
user 0m0.024s
sys 0m0.008s

time /usr/share/checkbox/scripts/module_resource >/dev/null

real 0m0.022s
user 0m0.020s
sys 0m0.004s

time /usr/share/checkbox/scripts/package_resource >/dev/null

real 0m0.136s
user 0m0.116s
sys 0m0.020s

time /usr/share/checkbox/scripts/udev_resource >/dev/null

real 0m0.314s
user 0m0.208s
sys 0m0.112s

time /usr/share/checkbox/scripts/uname_resource >/dev/null

real 0m0.026s
user 0m0.024s
sys 0m0.004s

Revision history for this message
Marc Legris (maaarc-deactivatedaccount-deactivatedaccount-deactivatedaccount-deactivatedaccount-deactivatedaccount) wrote :

Even though the above commands execute quite fast, checkbox still takes about 10 minutes to "gather information about your system" on certain machines.

Revision history for this message
Javier Collado (javier.collado) wrote :

Please have a look at the merge proposal

Revision history for this message
Ara Pulido (ara) wrote :

Javier, is this still happening?

I have seen that you expressed some concerns about the patch proposed.

Revision history for this message
Marc Legris (maaarc-deactivatedaccount-deactivatedaccount-deactivatedaccount-deactivatedaccount-deactivatedaccount) wrote :

looks like it not the gathering resources that is causing the delay, but the sorting of tests. Maybe instead of displaying "gathering resources" it can instead display "compiling tests" or something similar.

Changed in checkbox:
status: Incomplete → Confirmed
summary: - Store inital data gathering
+ Sorting jobs is time consuming
Daniel Manrique (roadmr)
Changed in checkbox:
status: Confirmed → Fix Released
Revision history for this message
Daniel Manrique (roadmr) wrote :

Recent improvements to Checkbox have pretty much taken care of this problem.

A job cache was implemented, this is used when doing job sorting, and basically implements the same functionality as Javier's merge proposal.

Then, file syncing/flushing is disabled during the gathering phase, for an additional speed boost.

As a result, the gathering phase for the default checklist went down from 47 seconds to a bit over 7 seconds.

I'll mark this Fix Released.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.