So you're not going to upgrade because one specific feature that's not available in the version you currently run won't be available in the new version? I mean... lack of jit in 3.5 on x86_64 is no worse than lack of jit in 3.0 on x86_64 (and elsewhere). Meanwhile, there were various non-jit performance improvements and features added that you're missing out on.
They don't got hand-in-hand with script performance, by any means. Firefox has much faster scripting performance than Opera, and somewhat slower css/layout performance in many cases, for example.
Looking at your code, it looks like it's not actually performing that much computation in the javascript. So what matters here is not JS performance but DOM/layout/CSS performance...
As with any benchmark, important questions to ask:
1) Does this measure things that are actually relevant? (For sunspider the answer is
"maybe".) 2) Does it do a good job of measuring them? (For sunspider the answer is "maybe".) 3) Do the scores on the subtests of the benchmark mean anything? (For sunspider, as for
any benchmark, the answer is "only if you're doing that exact thing that the subtest is
doing").
None of which makes V8 slower than what IE is using, of course, across a broad range of loads. But it's pretty easy to write script that's 4x slower in V8 than in Firefox... or 10x faster (as the benchmark above). What really matters to a web page developer is how fast the different browsers run his code, not how fast they run benchmarks. What matters to a user is how fast the different browsers run the code of the sites he visits, not how fast they run benchmarks. Benchmarks are a poor proxy for both, especially when dealing with these early-stage JITs. It's pretty easy to tweak the code just a bit and have it jit a lot worse (or a lot better). It's also pretty easy to tweak the JIT to make particular tests faster, since so much of the game is various heuristics.
All of which is to say that better sunspider performance may or may not translate into better performance on _your_ code, and in fact improving sunspider performance may regress performance on your code if the JIT is seriously being tuned for sunspider...
Yeah, I never claimed that current interpretations of the constitution actually make any sense...;)
> I don't think schools teach US history, the Constitution, and Bill of Rights like they > used to.
That's quite possible.
> I recall having to memorize the Declaration of Independence and to preamble to the > Constitution
Though in all honesty, memorizing them is not as valuable as actually understanding them. It's certainly more valuable than not reading them at all, of course.
Through a long string of other supreme court decisions and a bunch of really stupid lawsuits against school districts, together with a basic fundamental disconnect between how school administrators _should_ interact with students and how they _do_ interact with students.
Also, by basically treating our school system as a lightweight day-prison system. The psychological effect is that you start treating them students as you would inmates, with all the resulting abuses.
> I think there should be an assumption that if there isn't a law permitting something that > would be unacceptable outside of school it is illegal.
That would be nice, but in practice the supreme court has repeatedly ruled in broad decisions that this is not the case (e.g. blanket-declaring that parts of the constitution simply don't apply to students in a school)...
The principle you propose makes a lot of sense to me; it's just not one the legal system has adopted.
You can be convicted of doing something so obviously and totally morally wrong that any reasonable person would have thought it wrong even though a duly constituted authority orderered you to do it.
Even if you accept the Nuremberg principles (and let's face it; they're somewhat specious from a strict legal point of view), that leaves a lot of weasel room. In particular the words "obviously" and "reasonable"....
I do agree with the main part of what you're saying: that if you take the Nuremberg principles to their obvious limit then anyone is liable for anything anytime as soon as someone decides (post facto, note!) that something you did was "wrong", even though legal at the time when you did it. That's what makes the Nuremberg principles pretty questionable to me.
I do think the supremes got it wrong by not prohibiting this sort of behavior on a more blanket way, for what it's worth, and especially for saying it would be ok if the circumstances were just a bit different. But given the progress of this case so far, and the number of "reasonable" people who seemed to think that all was OK with the school official's behavior, I think their liability decision was the right one, sadly. It doesn't make me _happy_, but neither would the decision the other way, honestly.
Of course IANAL, etc. If you are and if there are relevant legal principles I'm missing here I'd like to know.
> What matters is whether or not they had the authority to do so
For what it's worth the supreme court basically ruled "maybe" on that. Or rather, ruled that they had the authority but not sufficient reason in this case.
I don't like that. You clearly don't like that. That's the ruling.
And the problem is that the Supreme Court has repeatedly held that students in a school are not "people" for purposes of not only that amendment but also various other parts of the constitution. Which is very unfortunate, but is the state of things right now.
> If admin in a US public school does not understand that then they should never have > graduated.
And apparently neither should have the appellate court judges, and at least one supreme court justice, right?
You might even be right; most people in the U.S. should probably not have graduated high school, much less college, if you apply that sort of test.
Not quite. The supreme court said they can't be held liable because _no_one_ knew the law. As in, it was impossible to know it, given what was actually written down.
Similarly, a prosecutor who filed suit against someone based on a law the legislature passed would presumably not be held liable if the law is then challenged and found unconstitutional. Of course if he then continues to bring such suits, things would be different, just as here things would be different for future behavior akin to that of these school administrators.
Shouting cliches doesn't change the fact that this situation (which I, again, think was highly unfortunate behavior on the part of the school administration in the ethical, not just legal, sense) is not the same as "ignorance of the law".
Did you read the supreme court decision on the liability thing? It basically comes down to "precedent and legislation here was so confused, that even the Federal appeals court decided incorrectly; there was no way the administrators could have been expected to know whether their actions were constitutional."
Which is sad, but true. I'd have a much easier time claiming the administrators should be liable if every single court in the chain had found against them. But if as it is, I agree the decision was stupid, but non-obviously so. At least to a lot of people. Which once again is very said.
Sure, but a lot of sites set the cache expiration time pretty low so they can all roll out updates often. In the best case, that just means a single conditional GET and 304 response, which isn't too bad.
But I think the one of the main ideas being discussed here is optimizing initial pageload of the site, and the cache doesn't help with that. If it's an SSL site and doesn't explicitly allow persistent caching of its data, it doesn't even help across browser restarts.
> The price of downloading html and javascript source is peanuts compared to images and > flash animations
That may or may not be true... Last I checked, a number of popular portal sites (things like cnn.com) included scripts totaling several hundred kilobytes as part of the page. The problem is that unlike images those scripts prevent the browser from doing certain things while the script is downloading (because you never know when that 200kb script you're waiting on will decide to do a document.write and compeletely change what you're supposed to do with all the HTML that follows it). So the cost of downloading scripts is _very_ palpable...
> So why isn't the Moz Foundation investing in a better compiler?
This is a good question; I believe it's largely a matter of not having found anyone to pay to do the work, but I'm not privy to details on this stuff...
> what does this say about the performance of any app running under Linux compared to the > Windows version?
That if performance is gated on computation and codesize, and the code identical, it'll tend to be faster on Windows....
Thing is, for most apps performance is gated on I/O or display (if gated at all) more than on computation and codesize.
Assuming the problem is also there with mozilla.org builds, and not just the customized distro build, the next-most-likely issue is some interaction of Firefox, X, graphics driver, graphics card. Firefox 3 offloads a lot of rendering to the X server (instead of doing it itself in software like Firefox 2). Unfortunately, as often as not the X server does the rendering in software itself instead of actually using the graphics hardware. And the software it uses is older than what a client would typically use and somewhat more generic, so slower...
So some cases of using the X server lead to a significant speedup over doing the rendering yourself; others to a significant slowdown. And which it is depends not on your code but on the user's hardware/X/driver configuration.
Last we tried it couldn't manage to compile the whole app (Firefox, that is). It's been a while since I checked on this, though.
There's been some serious thought put into just compiling the JS engine with ICC as a first step, but using two different compilers for different parts of the build process is a bit of a hassle, of course.
> its an exponentially harder problem to do performance analysis at the compiler level then > at the application level.
While true, the fact remains that MSVC++ produces smaller and faster code than gcc on this particular set of code, even ignoring things like profile-guided optimization.
But in any case, the 15% difference listed here is precisely what Sunspider on Windows picked up from profile-guided optimization.
> Plus firefox + wine runs over 10% faster then firefox on linux, so very likely its not > the tools.
firefox+wine is running a binary compiled with MSVC++, so it likely _is_ the tools. If you think otherwise, care to explain your reasoning? Because what you said looks like a false deduction to me.
> My guess its just because there are more windows hackers working on firefox
I can guarantee that there are more Linux hackers than Windows hackers working on Firefox. I can also guarantee that a lot of the profiling is done on Mac (because Shark is far and away better than anything else freely available out there). I can further guarantee that per-platform optimization only happens on the level of compiler flags, not on the level of code. Largely because most of the code is the same on all platforms, and not hand-tweaked for maximum performance (because there area bigger performance fish to fry).
I'd love to be able to enable this and get some profiles of things like sunspider and DOM-heavy pages with it, but I'm blocked on the gcc suckage. If you happen to know some gcc developers who could help here, that would be very nice.
Currently Gecko does #4 from your list for a bit (to allow fast back in common cases), falling back on #1 once evicted from that cache (which happens after the page is far enough back in your session history or once 30 minutes have passed, whichever happens first). "Far enough back" is typically 3-7 pages back. Oh, and while it does #4 for DOM and style information, decompressed image data is dropped more aggressively than that. In fact, it's commonly dropped while the page the image is in is still loaded, with decompress happening on draw, if the image really needs to be redrawn. So really, your list should probably be a graph with nodes representing various combinations of memory optimizations; the image data optimization is completely orthogonal to what you do with the DOM and layout information.
> Firefox does the latter,
Not sure what that would mean for a list with 5 elements, but see above for what Firefox actually does.
> Redrawing the page image from the DOM should take only a few milliseconds
If you mean recomputing all the layout information from the DOM and the specified CSS values, then I think you're off by one to two orders of magnitude or so (for typical pages; I'm not talking pathological cases like the HTML5 single-page spec where a full layout pass in any modern browser takes multiple seconds, nor particularly simple pages like the Google front page). Times are in the 50-600ms range for layout of the page on things like top500 pages.
So you're not going to upgrade because one specific feature that's not available in the version you currently run won't be available in the new version? I mean... lack of jit in 3.5 on x86_64 is no worse than lack of jit in 3.0 on x86_64 (and elsewhere). Meanwhile, there were various non-jit performance improvements and features added that you're missing out on.
Am I missing something here?
They don't got hand-in-hand with script performance, by any means. Firefox has much faster scripting performance than Opera, and somewhat slower css/layout performance in many cases, for example.
Looking at your code, it looks like it's not actually performing that much computation in the javascript. So what matters here is not JS performance but DOM/layout/CSS performance...
As with any benchmark, important questions to ask:
1) Does this measure things that are actually relevant? (For sunspider the answer is
"maybe".)
2) Does it do a good job of measuring them? (For sunspider the answer is "maybe".)
3) Do the scores on the subtests of the benchmark mean anything? (For sunspider, as for
any benchmark, the answer is "only if you're doing that exact thing that the subtest is
doing").
None of which makes V8 slower than what IE is using, of course, across a broad range of loads. But it's pretty easy to write script that's 4x slower in V8 than in Firefox... or 10x faster (as the benchmark above). What really matters to a web page developer is how fast the different browsers run his code, not how fast they run benchmarks. What matters to a user is how fast the different browsers run the code of the sites he visits, not how fast they run benchmarks. Benchmarks are a poor proxy for both, especially when dealing with these early-stage JITs. It's pretty easy to tweak the code just a bit and have it jit a lot worse (or a lot better). It's also pretty easy to tweak the JIT to make particular tests faster, since so much of the game is various heuristics.
All of which is to say that better sunspider performance may or may not translate into better performance on _your_ code, and in fact improving sunspider performance may regress performance on your code if the JIT is seriously being tuned for sunspider...
> Yet corporations are persons.
Yeah, I never claimed that current interpretations of the constitution actually make any sense... ;)
> I don't think schools teach US history, the Constitution, and Bill of Rights like they
> used to.
That's quite possible.
> I recall having to memorize the Declaration of Independence and to preamble to the
> Constitution
Though in all honesty, memorizing them is not as valuable as actually understanding them. It's certainly more valuable than not reading them at all, of course.
> How did we get here? How has it come to this?
Through a long string of other supreme court decisions and a bunch of really stupid lawsuits against school districts, together with a basic fundamental disconnect between how school administrators _should_ interact with students and how they _do_ interact with students.
Also, by basically treating our school system as a lightweight day-prison system. The psychological effect is that you start treating them students as you would inmates, with all the resulting abuses.
> I think there should be an assumption that if there isn't a law permitting something that
> would be unacceptable outside of school it is illegal.
That would be nice, but in practice the supreme court has repeatedly ruled in broad decisions that this is not the case (e.g. blanket-declaring that parts of the constitution simply don't apply to students in a school)...
The principle you propose makes a lot of sense to me; it's just not one the legal system has adopted.
You can be convicted of doing something so obviously and totally morally wrong that any reasonable person would have thought it wrong even though a duly constituted authority orderered you to do it.
Even if you accept the Nuremberg principles (and let's face it; they're somewhat specious from a strict legal point of view), that leaves a lot of weasel room. In particular the words "obviously" and "reasonable"....
I do agree with the main part of what you're saying: that if you take the Nuremberg principles to their obvious limit then anyone is liable for anything anytime as soon as someone decides (post facto, note!) that something you did was "wrong", even though legal at the time when you did it. That's what makes the Nuremberg principles pretty questionable to me.
I do think the supremes got it wrong by not prohibiting this sort of behavior on a more blanket way, for what it's worth, and especially for saying it would be ok if the circumstances were just a bit different. But given the progress of this case so far, and the number of "reasonable" people who seemed to think that all was OK with the school official's behavior, I think their liability decision was the right one, sadly. It doesn't make me _happy_, but neither would the decision the other way, honestly.
Of course IANAL, etc. If you are and if there are relevant legal principles I'm missing here I'd like to know.
> What matters is whether or not they had the authority to do so
For what it's worth the supreme court basically ruled "maybe" on that. Or rather, ruled that they had the authority but not sufficient reason in this case.
I don't like that. You clearly don't like that. That's the ruling.
Sure thing, but ignorance of common sense does not automatically entail either criminal or civil liability. Luckily!
And the problem is that the Supreme Court has repeatedly held that students in a school are not "people" for purposes of not only that amendment but also various other parts of the constitution. Which is very unfortunate, but is the state of things right now.
> If admin in a US public school does not understand that then they should never have
> graduated.
And apparently neither should have the appellate court judges, and at least one supreme court justice, right?
You might even be right; most people in the U.S. should probably not have graduated high school, much less college, if you apply that sort of test.
Not quite. The supreme court said they can't be held liable because _no_one_ knew the law. As in, it was impossible to know it, given what was actually written down.
Similarly, a prosecutor who filed suit against someone based on a law the legislature passed would presumably not be held liable if the law is then challenged and found unconstitutional. Of course if he then continues to bring such suits, things would be different, just as here things would be different for future behavior akin to that of these school administrators.
Shouting cliches doesn't change the fact that this situation (which I, again, think was highly unfortunate behavior on the part of the school administration in the ethical, not just legal, sense) is not the same as "ignorance of the law".
Did you read the supreme court decision on the liability thing? It basically comes down to "precedent and legislation here was so confused, that even the Federal appeals court decided incorrectly; there was no way the administrators could have been expected to know whether their actions were constitutional."
Which is sad, but true. I'd have a much easier time claiming the administrators should be liable if every single court in the chain had found against them. But if as it is, I agree the decision was stupid, but non-obviously so. At least to a lot of people. Which once again is very said.
Sure, but a lot of sites set the cache expiration time pretty low so they can all roll out updates often. In the best case, that just means a single conditional GET and 304 response, which isn't too bad.
But I think the one of the main ideas being discussed here is optimizing initial pageload of the site, and the cache doesn't help with that. If it's an SSL site and doesn't explicitly allow persistent caching of its data, it doesn't even help across browser restarts.
> The price of downloading html and javascript source is peanuts compared to images and
> flash animations
That may or may not be true... Last I checked, a number of popular portal sites (things like cnn.com) included scripts totaling several hundred kilobytes as part of the page. The problem is that unlike images those scripts prevent the browser from doing certain things while the script is downloading (because you never know when that 200kb script you're waiting on will decide to do a document.write and compeletely change what you're supposed to do with all the HTML that follows it). So the cost of downloading scripts is _very_ palpable...
Scrolling behavior is very dependent on the details of the exact CSS used, the exact images used, etc... So it can vary very much by site.
Yes, and Windows builds compiled with GCC are much slower than the MSVC++ ones.
The Intel compiler can't actually (correctly) compile the code in question, last I checked. See https://bugzilla.mozilla.org/show_bug.cgi?id=386840 for an example. Also https://bugzilla.mozilla.org/show_bug.cgi?id=412829 and https://bugzilla.mozilla.org/show_bug.cgi?id=483283 and https://bugzilla.mozilla.org/show_bug.cgi?id=403224
So people really are working on it; it's just not there yet.
> So why isn't the Moz Foundation investing in a better compiler?
This is a good question; I believe it's largely a matter of not having found anyone to pay to do the work, but I'm not privy to details on this stuff...
> what does this say about the performance of any app running under Linux compared to the
> Windows version?
That if performance is gated on computation and codesize, and the code identical, it'll tend to be faster on Windows....
Thing is, for most apps performance is gated on I/O or display (if gated at all) more than on computation and codesize.
Assuming the problem is also there with mozilla.org builds, and not just the customized distro build, the next-most-likely issue is some interaction of Firefox, X, graphics driver, graphics card. Firefox 3 offloads a lot of rendering to the X server (instead of doing it itself in software like Firefox 2). Unfortunately, as often as not the X server does the rendering in software itself instead of actually using the graphics hardware. And the software it uses is older than what a client would typically use and somewhat more generic, so slower...
So some cases of using the X server lead to a significant speedup over doing the rendering yourself; others to a significant slowdown. And which it is depends not on your code but on the user's hardware/X/driver configuration.
Last we tried it couldn't manage to compile the whole app (Firefox, that is). It's been a while since I checked on this, though.
There's been some serious thought put into just compiling the JS engine with ICC as a first step, but using two different compilers for different parts of the build process is a bit of a hassle, of course.
> its an exponentially harder problem to do performance analysis at the compiler level then
> at the application level.
While true, the fact remains that MSVC++ produces smaller and faster code than gcc on this particular set of code, even ignoring things like profile-guided optimization.
But in any case, the 15% difference listed here is precisely what Sunspider on Windows picked up from profile-guided optimization.
> Plus firefox + wine runs over 10% faster then firefox on linux, so very likely its not
> the tools.
firefox+wine is running a binary compiled with MSVC++, so it likely _is_ the tools. If you think otherwise, care to explain your reasoning? Because what you said looks like a false deduction to me.
> My guess its just because there are more windows hackers working on firefox
I can guarantee that there are more Linux hackers than Windows hackers working on Firefox. I can also guarantee that a lot of the profiling is done on Mac (because Shark is far and away better than anything else freely available out there). I can further guarantee that per-platform optimization only happens on the level of compiler flags, not on the level of code. Largely because most of the code is the same on all platforms, and not hand-tweaked for maximum performance (because there area bigger performance fish to fry).
> Why? No clue.
Because gcc falls down and dies if you try to actually use its profile-guided optimization feature with Firefox. See https://bugzilla.mozilla.org/show_bug.cgi?id=418866
I'd love to be able to enable this and get some profiles of things like sunspider and DOM-heavy pages with it, but I'm blocked on the gcc suckage. If you happen to know some gcc developers who could help here, that would be very nice.
Sure. I'm just saying that without actually knowing the details of the program's memory layout it's impossible to get the numbers correct here...
I did miss the "close" in your post, admittedly. My bad.
Currently Gecko does #4 from your list for a bit (to allow fast back in common cases), falling back on #1 once evicted from that cache (which happens after the page is far enough back in your session history or once 30 minutes have passed, whichever happens first). "Far enough back" is typically 3-7 pages back. Oh, and while it does #4 for DOM and style information, decompressed image data is dropped more aggressively than that. In fact, it's commonly dropped while the page the image is in is still loaded, with decompress happening on draw, if the image really needs to be redrawn. So really, your list should probably be a graph with nodes representing various combinations of memory optimizations; the image data optimization is completely orthogonal to what you do with the DOM and layout information.
> Firefox does the latter,
Not sure what that would mean for a list with 5 elements, but see above for what Firefox actually does.
> Redrawing the page image from the DOM should take only a few milliseconds
If you mean recomputing all the layout information from the DOM and the specified CSS values, then I think you're off by one to two orders of magnitude or so (for typical pages; I'm not talking pathological cases like the HTML5 single-page spec where a full layout pass in any modern browser takes multiple seconds, nor particularly simple pages like the Google front page). Times are in the 50-600ms range for layout of the page on things like top500 pages.