Live data from Hacker News

How to make Firefox builds 17% faster

blog.farre.se

21–30 of 38 posts

Re: How to make Firefox builds 17% faster

#21

Earlier quoted context omitted.

There was an experimental PR that treats proc macros as idempotent with the corresponding colpike speed up. I don't know what happened with it, and stabilization required a lot of design work to not break backcompat. But this is something in the team's radar.

Would it be possible to do somethign like editions for proc macros, or have crates establish "this is a v2 proc macro" or something? There are a lot of things I'd love to see change in a v2 but it'd all be breaking.

Yes, I think here are workable designs.

Re: How to make Firefox builds 17% faster

#22

Earlier quoted context omitted.

There was an experimental PR that treats proc macros as idempotent with the corresponding colpike speed up. I don't know what happened with it, and stabilization required a lot of design work to not break backcompat. But this is something in the team's radar.

what do you mean by idempotent and colpike?

Idempotent as in if the token stream in the input doesn't change, the cached result of the previous macro expansion is used during incremental, instead of being pessimistic and rerunning the macro.

Colpike as in compile typo.

Re: How to make Firefox builds 17% faster

#23

Earlier quoted context omitted.

There was an experimental PR that treats proc macros as idempotent with the corresponding colpike speed up. I don't know what happened with it, and stabilization required a lot of design work to not break backcompat. But this is something in the team's radar.

Do you have a link for this one? Would love to see it.

This is not the one I remember but another one that does part of what I'm describing.

https://github.com/rust-lang/rust/pull/145354

Re: How to make Firefox builds 17% faster

#24
post #4

Earlier quoted context omitted.

Does ccache fetch compiled code from a central server using checksums?

sccache can, but most of us don't have access to an sccache instance: https://github.com/mozilla/sccache

We use sccache on prem with MinIO.

Re: How to make Firefox builds 17% faster

#25

So ... perhaps Mozilla should focus on user share dropping. I understand that speed is relevant, but focusing on that strategy does not really work when dinosaur-like extinction is around the corner.

Aw shucks, we never thought of that. Here we were, dedicating every one of our developers to speeding up the build, and we never thought to increase our user share instead. In retrospect, that was pretty dumb! Ok, sorry, we'll get right on that.

Seriously, what is with the trend of assuming that anything anyone in a project does, it is assumed that it has been the main goal of the project and all other objectives have been abandoned? "Firefox's frontend designers are doing frontend design work instead of implementing WebUSB which would immediately reverse their declining user share trend and make billions of dollars worth of donations! What are they thinking?!!"

(I'm gonna get a lot of hate for this post, aren't I?)

Re: How to make Firefox builds 17% faster

#26

So ... perhaps Mozilla should focus on user share dropping. I understand that speed is relevant, but focusing on that strategy does not really work when dinosaur-like extinction is around the corner.

Post author here. I should've expected these comments, which makes me want to clarify a couple of things.

1. Just because I'm a dev at Mozilla and I got support for buildcache landed in the Firefox repo doesn't make this a Mozilla project. I do this on my own time to help me be more efficient when I actually work.

2. I mainly do this because it's fun. Including the blogging.

3. Sccache is still the compiler cache we're officially developing at Mozilla

Re: How to make Firefox builds 17% faster

#27
post #4

Earlier quoted context omitted.

Does ccache fetch compiled code from a central server using checksums?

buildcache, the program the post is about can use a remote server for storing the cache.

And a local cache (kind of level 1 and level 2 caches)

Re: How to make Firefox builds 17% faster

#29

So ... perhaps Mozilla should focus on user share dropping. I understand that speed is relevant, but focusing on that strategy does not really work when dinosaur-like extinction is around the corner.

For what it's worth, browser uptake is largely dictated by the browser being default shipped with some major OS. Very few users make an active choice (statistically speaking).

Safari is popular because it ships with iOS and macOS.

Edge (previously IE) is popular because it ships with Windows.

Chrome, however, is popular for several reasons. One reason is that it ships with Android and ChromeOS, but before that Google had a very aggressive multi-channel campaign where they pushed it with large banners on Google search (everyone used Google) and they made deals with Windows AV vendors so that when a user installed anti-virus on their computer Chrome was automatically installed and made the default browser. Another reason is that Google has consistently develeoped Chrome together with their web services, so things like search, maps, gmail, docs etc tend to work best in Chrome.

The only default channels that Firefox has, that I'm aware of, are verious Linux distros, and they have a pretty thin market slice.

Re: How to make Firefox builds 17% faster

#30
post #18

I’m not too familiar with Firefox builds. Why are clobber builds common? At first glance it seems weird to add a cache around your build system vs fixing your build system.

Though I'm not actively working with Firefox so can't speak for their use cases, one important use case for clobber builds is CI.

I'm the author of BuildCache, and where I work we make thousands of clobber builds every day in our CI. Caching helps tremendously for keeping build times short.

There are a few use cases for local development too. For instance if you switch between git branches you may have to make near full rebuilds (e.g. in C++ if some header file is touched that gets included by many files).

Another advantage as a local dev is that you can tap into the central CI cache and when you pull the latest trunk and build it, chances are that the CI system has already built that version (e.g. as part of a merge gate) so you will get cache hits.

Post reply on HN