Last Comment Bug 676412 - xpcshell test "unit/test_nsIProcess.js" is slow on Windows
: xpcshell test "unit/test_nsIProcess.js" is slow on Windows
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: unspecified
: x86_64 Linux
: -- normal (vote)
: ---
Assigned To: William Lachance (:wlach)
: Nathan Froyd [:froydnj]
Depends on:
  Show dependency treegraph
Reported: 2011-08-03 15:58 PDT by William Lachance (:wlach)
Modified: 2011-08-17 10:16 PDT (History)
3 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

split out the process stress test into a seperate file and skip it on win7 (4.78 KB, patch)
2011-08-09 14:35 PDT, William Lachance (:wlach)
benjamin: review+
Details | Diff | Splinter Review

Description William Lachance (:wlach) 2011-08-03 15:58:52 PDT
As part of the GoFaster project (to reduce build times), I've been profiling the various xpcshell tests. The "unit/test_nsIProcess.js" is about 13 seconds slower on our windows test slaves than on my Linux machine, a difference which I've pinned down almost entirely to this bit of code:

  for (var i = 0; i < 1000; i++) {
    var process = Components.classes[";1"]
    process.init(file);, [], 0);

I gather we are doing a mini stress test here, but how important is it that we do 1000 iterations of this? Would 100 suffice?
Comment 1 William Lachance (:wlach) 2011-08-03 15:59:39 PDT
Hey Mike, from what I can gather from 'hg blame', you're the author of the code I'm talking about above. Do you have any thoughts on it?
Comment 2 Mike Hommey [:glandium] 2011-08-03 23:01:33 PDT
From my experimentation back when i wrote the test initially, the bug it's trying to find would only trigger once in a while, and 1000 got it reliably, while 100 didn't. I haven't tried other values in between, and I haven't bothered because 1000 was fast enough... on Linux. I forgot that Windows was slow to fork processes...

Now, looking at the code that the test verifies (bug 543441 ; turns out the bug number in the corresponding commit was wrong :( ), it actually doesn't apply to windows, so we could actually skip the test on windows.
Comment 3 William Lachance (:wlach) 2011-08-09 14:35:21 PDT
Created attachment 551891 [details] [diff] [review]
split out the process stress test into a seperate file and skip it on win7
Comment 4 William Lachance (:wlach) 2011-08-09 14:42:09 PDT
Comment on attachment 551891 [details] [diff] [review]
split out the process stress test into a seperate file and skip it on win7

Hi Benjamin,

glandium suggested I assign this to you to review, as you're the module owner.
Comment 5 William Lachance (:wlach) 2011-08-15 13:27:04 PDT
I should add that I tested this commit by running the xpcshell tests on try against all platforms. Still passes!
Comment 6 Jonathan Griffin (:jgriffin) 2011-08-15 13:40:24 PDT
Landed as
Comment 7 William Lachance (:wlach) 2011-08-17 10:16:29 PDT
Awesome, thanks!

Note You need to log in before you can comment on or make changes to this bug.