Live data from Hacker News

Engineering code quality in Firefox

hacks.mozilla.org

121–130 of 155 posts

Re: Engineering code quality in Firefox

#121
post #91
post #66

Earlier quoted context omitted.

> Trying to compile Firefox was already a challenge. That, and each compile took an hour. At first glance, this sounds terrible. But when compared to software projects of comparable size, Firefox is hardly unique. Compare to compiling Chromium for example, or even the Linux kernel.

I think at scale (according to Wikipedia the 5.6 release has ~33M lines of code) the Linux kernel might be one of the easiest (and quickest) projects to compile[1]. [1]: https://techgage.com/wp-content/uploads/2019/11/Compile-Perf...

Surely most of those lines of codes are optional modules and device drivers - so aren't compiled for most users or this test?

Re: Engineering code quality in Firefox

#122
post #4

I was thinking about Firefox development quality while trying to figure out why the f does Firefox CPU usage fluctuate between 1 and 5% with one background tab open and only one plugin installed (containers). The same URL when opened in safari goes to 0.1% or 0.0. I tried to look up dom timeout config settings and tried to set aggressive timeouts, but in the end I gave up. There must be something fundamentally wrong…

I’ve gotten in the habit of killing Firefox before going to bed, the processes seem to run away and peg the CPU periodically throughout the night. It seems to be generally Facebook, but other JS heavy sites have similar issues.

Why wouldn't you poweroff/hibernate computer for the night? Isn't that just a waste of electricity?

Re: Engineering code quality in Firefox

#123

Earlier quoted context omitted.

I’ve gotten in the habit of killing Firefox before going to bed, the processes seem to run away and peg the CPU periodically throughout the night. It seems to be generally Facebook, but other JS heavy sites have similar issues.

Why wouldn't you poweroff/hibernate computer for the night? Isn't that just a waste of electricity?

Depends on how you look at it, I need to keep state of work things (emacs sessions etc). But compared to my fridge or pretty much any industrial country my computers electricity consumption is near negligible.

Re: Engineering code quality in Firefox

#124

Earlier quoted context omitted.

> I am generally suspicious of anyone who voluntary pursues academia That's very unfair imo. The majority of people I know in academia don't fit this profile at all. There is obviously disappointing stuff happening, but people generally still are working/teaching in good faith.

>but people generally still are working/teaching in good faith. It depends on university. On mine, most professors just see it as a job, something that one must endure until it's over. And when you bring to attention that what they're lecturing is incorrect or not proven they don't really care, again not all, but most, at least on my university. Just today I reminded the professor that there is a difference between a…

As a fellow Slovenian, former student and now someone who's spent years professionally in academia, let me try to show your experience from a different perspective. I don't know anything about your professor except the anecdote you shared, so I'm not defending them. I'm just trying to shine a different light "on the situation in which we are" that you as a student perhaps didn't (yet) have a chance to see. I'm also writing this because I feel like your view is pretty common among our students.

How our universities work is that as a researcher a part of your duty to the university is teaching students. Unfortunately, fields of research and study subjects in most cases aren't aligned. Nobody will be researching basic subjects that must be taught to the students, and on the other hand a very specialized field of research might not be taught to anything but a small post-graduate course. This means that often professors will end up teaching an undergraduate course that has next to nothing to do with their field of study. In the end, someone must be teaching those introductory courses and for some subjects being taught the university might not have any professional researchers at all.

Professors are researchers first and teachers second. This is most likely the reason why it appears that teaching is "something that one must endure until it's over". Your professor might be a brilliant world-class researcher in their field and they pursue it with passion, but they might be teaching e.g. linear algebra to undergraduates twice a week based on "what's written in the book" to keep their job. As it turns out, teaching and research are quite different skills and they often don't coincide. When they do, you get some really amazing professors and I'm sure you have some on your course as well.

It's not a perfect system, but I've spent enough time in foreign universities where research staff was on-the-hook all the time and liable to get fired if students weren't happy with them. It's such a constantly stressful environment that I was amazed that people managed to do any kind of research at all. In the end, it's a trade-off. You can't have a university without either top-end research or teaching and we might have chosen a slightly different trade-off between these two than the countries you seem to look up to.

Anyway, I hope I've given you a new way to look at things and I hope you will stay at your university for more than just to get the "take me seriously" papers.

Re: Engineering code quality in Firefox

#125
post #85
post #30

Earlier quoted context omitted.

Opera felt small and fast because it did less and ran websites doing less. If you look at an old site in a modern browser, it's much faster; if you even could run a modern site in an old browser, you'd see just how many optimizations you're taking for granted — not to mention things like high-quality text rendering which fully supports Unicode and complex scripts.

The machines you were likely running Opera on were a lot less powerful though. Doing a bit less on a Pentium IV might be more impressive than rendering a modern website on an i5.

True, but again it was doing much less: we take things like high resolution, full color depth with color management, high-quality text rendering, anti-aliasing & subpixel rendering, etc. for granted.

Back then, good scrolling performance meant moving one page of thumbnails at a time, not continuously scrolling many times more thumbnails of significantly greater resolution.

The better lesson I’d draw from this is that it’s healthy to be skeptical when people say we “need” a huge pile of JavaScript for everything. If you let a modern browser run without layers of heavy code it’s usually easy to get the response times faster than the thresholds where users perceive it as instantaneous.

Re: Engineering code quality in Firefox

#126
post #45

Earlier quoted context omitted.

Nobody is arguing that Opera wasn’t fast, only that there’s been more than a decade of massive improvements which is not reflected in your comments. I used, and paid for, Opera but its golden age is past.

> ... only that there’s been more than a decade of massive improvements which is not reflected in your comments ... Oh ok. I see the confusion - I was speaking specifically about Opera (Presto engine) versions. Not the current Opera Chromium clone. And the point I was trying to make is that it was a much, much better product than its competitors. And if it had survived, with the original team still working on it, it…

I was also talking about Presto. It was good at the time in some areas but that’s like the guys who say their classic car is unmatched ignoring that everything on the lot is safer, lower maintenance, and less polluting.

People switched because Presto wasn’t perfect (I had plenty of big reports) and it was falling behind with each release as Mozilla and Google really hit their strides.

Re: Engineering code quality in Firefox

#127
post #112

Earlier quoted context omitted.

> About DRM: Mozilla fought against it, and caved when it became clear they could not win. While I do believe there was genuine opposition to this move within the community, I think the real decision makers had already made up their minds and just made a show of "discussing" it. I feel they did it under pressure, and perhaps were even induced with promises of more revenue, from Google. And where was the question of r…

> While I do believe there was genuine opposition to this move within the community, I think the real decision makers had already made up their minds and just made a show of "discussing" it. I feel they did it under pressure, and perhaps were even induced with promises of more revenue, from Google. The problem with beliefs is that there is no option to disprove them. Mozilla said they fought against it, the people wh…

> Firefox simply doesn't have the market share to force anyone to develop for them. Even worse, Google has every incentive to not do it and instead pop up a banner "hey, looks like your browser doesn't support YT, use Chrome". People who argue that Mozilla was wrong to accept the DRM blob never have a good answer for this and usually then end in "people would have seen that Mozilla is right and boycotted YT" or "who cares if Mozilla has only 1% market share, it's far more important to never make any compromise".

It wasn’t just Google: Microsoft and Apple also sold both DRM systems and content, and all three loved the idea of getting rid of Adobe. I never could get anyone to offer a credible theory for how Mozilla could fight those odds.

Re: Engineering code quality in Firefox

#128
post #31

We had an "open-ended" project in an undergraduate Computer Security course to discover a 0-day in Firefox. The professor (a researcher, not lecturer, by trade) didn't really have a curriculum, and said this artifact accounted for 70-80% of our grade. Trying to compile Firefox was already a challenge. That, and each compile took an hour. IIRC, Firefox is built on some esoteric architecture / design pattern that's def…

Any change to the grading scheme of a class should be Max(old grade, new grade). One of my profs once offered a re-test opportunity such that you would have had an incentive to do worse on the exam for certain original scores. Drove me up the wall.

From these,

> ... I ended up ... neither a zero-day ...

> Realizing everyone in the class would fail, the professor changed the grade of this project to only account for 30% of the grade.

> I ... disregarding the rest of the busy work for the class.

It sounds like OP could not find a zero day (old_grade=0) and did not do any other homework (new_grade=0), therefore should have received max(0, 0), but received a C.

Re: Engineering code quality in Firefox

#129

Earlier quoted context omitted.

Why wouldn't you poweroff/hibernate computer for the night? Isn't that just a waste of electricity?

Depends on how you look at it, I need to keep state of work things (emacs sessions etc). But compared to my fridge or pretty much any industrial country my computers electricity consumption is near negligible.

Fair enough, though I'm fairly sure my computer, even when idle, draws more power than my fridge.

Re: Engineering code quality in Firefox

#130
post #114

Earlier quoted context omitted.

Your language of choice - Clojure according to your HN bio - works on a product where important parts (e.g. Generics and the Java collection framework) were done by academia. One of the most popular compilers (LLVM) was done in academia (and still is in parts!). Most of the optimizations compilers use were done by academia. Your work stands on the work of countless academic researchers and you run around "What did ac…

This is especially laughable, since I have seen how that works on practice: take something everyone already does, write 1000 of PhDs on that, add to academic history book, now wikipedia and voila. If any of IT projects came from academia to the market, it's only because certain people were picked up by businesses that were onto something already.

I don't mean this in a derogatory way but from your bio it sounds like you work in full-stack web development - maybe with some data processing. Sure, this stuff doesn't really come from academia. But there are other bits of tech where academia does play a large part and your viewpoint is just not correct. One example that contradicts your second paragraph away is I spent several years at a consultancy that helped academics commericalise their own research - mostly medical tech but some computer vision stuff too. There's loads of great work businesses coming out of academia - you might just not be in a position to see it.
Post reply on HN