[RESOLVED] NoScript 2.0 and 2.0.1rc1 performance problems

Bug reports and enhancement requests
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: [RESOLVED] NoScript 2.0 and 2.0.1rc1 performance problem

Post by Giorgio Maone »

al_9x wrote:!@ - is not running with script off
Ouch, quite expected since I took the sandbox away.
al_9x wrote:on the hotmail https inbox page, default.aspx, the @!* surrogate runs on 5 frames (including root) in 2.0.9.9:
[...]
and only on the root (default.aspx) in 2.1.0rc5
... both on Fx 3.6 and 4.0? The former may have an explanation, the latter would be weirder.
al_9x wrote: [*] tried @* while at it. In 2.0.9.9 it runs on the first three, not on the ad frames. Presumably that's a bug, should it run on all 5? In 2.1.0rc5 it runs on the same three frames but the surrogate dumps out 'about:blank' for document.URL of InboxLight.aspx and HistoryFrame.aspx. Is that a sign of a problem?[/list]
Again, are we talking about 3.6, 4.0 or both?
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: [RESOLVED] NoScript 2.0 and 2.0.1rc1 performance problem

Post by al_9x »

the previous post was about 3.6.16

in Fx 4.0.0 & NS 2.1.0rc5, !@* runs on the first 3 frames vs. just the root in 3.6.16

@* behaves the same as in 3.6.16, except with NS 2.1.0rc5 document.URL dumps show the real urls for frame #2 and #3, as opposed to about:blank
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: [RESOLVED] NoScript 2.0 and 2.0.1rc1 performance problem

Post by al_9x »

2.1.0rc6, for hotmail tests I am assuming 5 invocations for 5 frames with proper urls dumped, as normal
  1. !@* still not running not non whitelisted
  2. Fx 3.6.16 & !@* & hotmail - now running on all 5 frames, but he the two ad frames dump about:blank
  3. Fx 4.0.0 & !@* & hotmail - still running on the first three frames
  4. Fx 3.6.16 & @* & hotmail - a total of 9 invocations on 5 frames, 6 about:blanks
  5. Fx 4.0.0 & @* & hotmail - still running on the first three frames
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: [RESOLVED] NoScript 2.0 and 2.0.1rc1 performance problem

Post by Giorgio Maone »

Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: [RESOLVED] NoScript 2.0 and 2.0.1rc1 performance problem

Post by al_9x »

Giorgio Maone wrote:Please check latest development build.
NS 2.1
  1. Fx 3.6.16 & !@* & hotmail - about:blank is dumped for the 3rd frame (HistoryFrame.aspx), I am assuming this should not be happening, is that right?
  2. Fx 3.6.16 & @* & hotmail - still a total of 9 invocations on 5 frames, 6 about:blanks. Again, I am assuming there should be only 5 and with proper urls, is that not correct?
  3. Fx 4.0.0 & @* & hotmail - still running on just the first three frames
  4. Are you not seeing the above?
  5. I'll do another perf test after the regressions are fixed, should the perf stay the same as that first good rc
  6. when you post "try latest build" could you please include the build number, there are times you need to go back through the thread and pick out a specific build, addressing what's being discussed
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: [RESOLVED] NoScript 2.0 and 2.0.1rc1 performance problem

Post by Giorgio Maone »

al_9x wrote: Fx 3.6.16 & !@* & hotmail - about:blank is dumped for the 3rd frame (HistoryFrame.aspx), I am assuming this should not be happening, is that right?
Wrong. Most frames are initially accessible and can be scripted while still hosting "about:blank" (it gets replaced as soon as you actually load something there or use document.open()/write()).
Therefore it's useful for surrogates to run there (the LiveConnect interception pseudo-surrogate, for instance, MUST run on such frames in order to prevent the parent from instantiating Java by referencing the frame's content DOM).
al_9x wrote:
Fx 3.6.16 & @* & hotmail - still a total of 9 invocations on 5 frames, 6 about:blanks. Again, I am assuming there should be only 5 and with proper urls, is that not correct?
Not sure. Are there HTTP redirection?
al_9x wrote: Fx 4.0.0 & @* & hotmail - still running on just the first three frames
It might depend on parser differences - Fx 4 uses a brand new parser, and frame loading was one of the less specified thing in "legacy" HTML.
al_9x wrote: Are you not seeing the above?
I'm not checking hotmail (too many variables), I'm using a contrived test case with top document, "normal" frames and scripted frames, and they work as expected both on 3.6.x and 4.0.

On a side note, Fx 4.0 is my reference ATM, since the callback which I depend on to inject the scripts is officially sanctioned, used by Jetpacks, and very likely does "the right thing".

Differences in Fx 3.6 may or may not be bugs because there's no official callback and I use fragile hacks, especially for frames (still they might be due to parser differences, see above), but in my contrived tests there's no significant difference and both the browsers seem to apply surrogates when needed.
al_9x wrote: I'll do another perf test after the regressions are fixed, should the perf stay the same as that first good rc
OK, thanks. Something I didn't ask previously: did you actually test with cnn.com whitelisted or not? If not, the perf difference is unlikely to depend on surrogate, since ! surrogates are just for a couple of image hosting services, by default.
al_9x wrote: when you post "try latest build" could you please include the build number, there are times you need to go back through the thread and pick out a specific build, addressing what's being discussed
OK.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: [RESOLVED] NoScript 2.0 and 2.0.1rc1 performance problem

Post by al_9x »

Giorgio Maone wrote:
al_9x wrote: Fx 3.6.16 & !@* & hotmail - about:blank is dumped for the 3rd frame (HistoryFrame.aspx), I am assuming this should not be happening, is that right?
Wrong. Most frames are initially accessible and can be scripted while still hosting "about:blank" (it gets replaced as soon as you actually load something there or use document.open()/write()).
Therefore it's useful for surrogates to run there (the LiveConnect interception pseudo-surrogate, for instance, MUST run on such frames in order to prevent the parent from instantiating Java by referencing the frame's content DOM).
In this item we are talking about !@ surrogates invoked on domcontentloaded, why should the url ever be about:blank then? It isn't in 2.0.9.9.
Giorgio Maone wrote:
al_9x wrote:Fx 3.6.16 & @* & hotmail - still a total of 9 invocations on 5 frames, 6 about:blanks. Again, I am assuming there should be only 5 and with proper urls, is that not correct?
Not sure. Are there HTTP redirection?
al_9x wrote: Fx 4.0.0 & @* & hotmail - still running on just the first three frames
It might depend on parser differences - Fx 4 uses a brand new parser, and frame loading was one of the less specified thing in "legacy" HTML.
al_9x wrote: Are you not seeing the above?
I'm not checking hotmail (too many variables), I'm using a contrived test case with top document, "normal" frames and scripted frames, and they work as expected both on 3.6.x and 4.0.
The bottom line is there is a difference in behavior between 2.0.9.9 and 2.1.0. I am asking you if it is a regression, which is a reasonable question considering that surrogate dynamics appear to have stabilized (correctly) by 2.0.9.9. You have everything you need to see it in vivo, but won't look? "too many variables" is putting the cart before the horse, a possible problem in a live site can not be dismissed just because your test doesn't capture it, a synthetic test is only useful if it reproduces the problem, in this case it may not. So can you please load hotmail and decide if everything is right or not? That's it's complex is good, many real sites are a mess.
Giorgio Maone wrote:On a side note, Fx 4.0 is my reference ATM, since the callback which I depend on to inject the scripts is officially sanctioned, used by Jetpacks, and very likely does "the right thing".

Differences in Fx 3.6 may or may not be bugs because there's no official callback and I use fragile hacks, especially for frames (still they might be due to parser differences, see above), but in my contrived tests there's no significant difference and both the browsers seem to apply surrogates when needed.
al_9x wrote: I'll do another perf test after the regressions are fixed, should the perf stay the same as that first good rc
OK, thanks. Something I didn't ask previously: did you actually test with cnn.com whitelisted or not? If not, the perf difference is unlikely to depend on surrogate, since ! surrogates are just for a couple of image hosting services, by default.
All the tests, from the start, were in a new profile with default NS settings, so cnn was not whitelisted. Nevertheless it was surrogates that made the difference between 3.5 and 12 minute loading, and the subsequent lockups.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16
miroslav.policki
Posts: 8
Joined: Fri Jul 30, 2010 7:33 pm

Re: [RESOLVED] NoScript 2.0 and 2.0.1rc1 performance problem

Post by miroslav.policki »

Unfortunately, I must report that the problem is not resolved for me. My FF session has 260 tabs and using NS has the effect of having the browser freeze for a few seconds every few seconds, thereby rendering it unusable.

I have tried to approximate my situation with a test case of 260 tabs of cnn.com as per the initial test case (the difference this time also being FF 4.0 and NS 2.1.0.2rc5). The results are such that without NS, the tabs eventually load, memory usage (Private bytes in Process explorer) stops at 2.3 GB, processor activity is minimal and the browser is responsive. With NS, however (and cnn.com and turner.com allowed), the tabs start loading, processor usage is constantly at maximum, and memory usage climbs very, very slowly. I gave up after about 20 minutes where it was at 1.1 GB. Needless to say, the browser is unusable during this time.

I haven't been able to check NS 1.10 as it's not compatible with FF 4, but from my initial report, I think the changes in NS 2.x are what carries this performance penalty.

So, is this simply the price we have to pay to be able to use NS, or can something be done?
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: [RESOLVED] NoScript 2.0 and 2.0.1rc1 performance problem

Post by Giorgio Maone »

miroslav.policki wrote:So, is this simply the price we have to pay to be able to use NS, or can something be done?
Did you try disabling surrogates?
Mozilla/5.0 (Windows NT 5.2; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0
miroslav.policki
Posts: 8
Joined: Fri Jul 30, 2010 7:33 pm

Re: [RESOLVED] NoScript 2.0 and 2.0.1rc1 performance problem

Post by miroslav.policki »

Indeed, disabling surrogates solves the performance issue. Hadn't thought of that, sorry.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: [RESOLVED] NoScript 2.0 and 2.0.1rc1 performance problem

Post by Giorgio Maone »

miroslav.policki wrote:Indeed, disabling surrogates solves the performance issue. Hadn't thought of that, sorry.
Question: how did your whitelist look like when you tested?
Mozilla/5.0 (Windows NT 5.2; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: [RESOLVED] NoScript 2.0 and 2.0.1rc1 performance problem

Post by Giorgio Maone »

Looks like the surrogate impact wasn't a NoScript bug, after all, and as I imagined earlier in this thread, all JetPacks and GreaseMonkey are affected: https://bugzilla.mozilla.org/show_bug.cgi?id=646575
Mozilla/5.0 (Windows NT 5.2; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0
Post Reply