6,887 karma · joined June 7, 2011
evan.martin@gmail.com
My posts on HN: https://news.ycombinator.com/from?site=neugierig.org
1. Even if you take a single binary and split it into multiple objects, you still must do the same "linking" work of resolving where functions point to. It's just that work is done as part of startup, at runtime, by the dynamic loader. I have seen (in other contexts) splitting up a big C++ binary into multiple pieces dramatically impact startup time.
2. You can't inline across shared objects. Inlining is the "mother of all optimizations" -- it's the biggest benefit, and most other optimizations interact with it. (For the simplest case, imagine a getter on an object. Inlined, it compiles to a pointer+offset dereference, while across modules it compiles to a lookup in a pointer table plus a function call.) This also means you can't delete unused functions and so on.
3. There's no real memory savings from shared objects in this manner, even when different subprocesses of Chrome only use different subsets of the binary, because the OS only pages in the part of the binary it uses.
In general, given there's no user benefit for multiple shared objects, there's little reason to not have a single binary, except for build time. But for releases Chrome does a lot of other work (I think even profile-guided optimization these days, though that is after my time) for performance anyway. In the old days we were making changes to save as little as 40ms of startup time (http://neugierig.org/software/chromium/notes/2009/01/startup... and http://neugierig.org/software/chromium/notes/2009/04/perf.ht...). Looking back at the post now, I see that -fPIC cost 12% of the WebKit JS engine performance, which is maybe another strike against relocatable objects (though maybe these days we use PIE anyway? I am pretty rusty on all this).
If I had an app that was multiple shared objects I might be more interested in measuring the benefit before switching it to a single binary, since while I know the benefit is nonzero you have to balance it against the cost of implementation. But in Chrome's case we started with the single binary build, so there was little reason to measure.
I would guess in IE's case they were more interested in providing reusable APIs used by multiple other systems. In Chrome's case that was never a design goal.
http://neugierig.org/software/chromium/notes/2011/02/ninja.h...
One of the big tricks not mentioned there is to decompose the app into multiple .so files (only when debugging -- release is still a single binary), so that you don't need to rebuild files unaffected by your incremental changes. I wrote more about that here:
"Stop paying for new domains"
Also from the site:
"Buy Handshake coins"
:(
As I recall, the cap on redirects was 10, and then Darin (who had previously worked on Firefox) was like "no, you have to allow up to 30 or you break the New York Times". And so, it was upped to to 30. Intuitively I'd think a site that redirected you 10 times was broken, but I guess someone built one that needed more.
PS: Looking online now to confirm my facts, I see one claim that both Chrome and FF limit redirects to 20. So either my memory exaggerated it as 30 or they both managed to lower the limit at some point.
Edit: the comments that are reacting to the article's content are from people who didn't read it to the end, wow.
(As an American, I find this phenomenon extremely silly and very foreign feeling. I don't really care whether "my" ancestors get credit for something or not, especially given that national boundaries and people move around all the time. I find it vaguely nationalistic in the ugly sense. Maybe it's because there were plenty of great Americans who were clearly not born here in the first place?)
When I was younger I would just see the fault -- the typos, the narcissism, the pointlessness, the already-been-done-better-by-others -- of people's work. But after trying a bit, it sometimes (for the same reasons the OP talks about) creating anything new ends up being really hard in part because while you struggle everyone is shouting "lame!" from the sidelines (and doing nothing). You see this a lot on this site in particular -- the "middlebrow dismissal" HN is famous for.
So now, even when I see something that I genuinely think is lame, I think of this problem and keep my negativity to myself. I might give useful criticism but I try to keep the balance in mind. Even if you publish something you've made that is kinda lame, I still think it is awesome that you are taking the effort to finish something. The best way to get better is by making multiple attempts.
But instead they had to build all this extra junk like an additional caching layer and daemon (wasting memory and CPU) atop the kernel's existing cache just to work around the kernel being slow.
https://www.crmvet.org/docs/otheram.htm
See the bit starting with: "Now there's another notion that gets out, it's around everywhere. It's in the South, it's in the North, it's In California, and all over our nation. It's the notion that legislation can't solve the problem, it can't do anything in this area. And those who project this argument contend that you've got to change the heart and that you can't change the heart through legislation."
To summarize it, he disagrees with you.
[1] https://www.joelonsoftware.com/2002/06/12/strategy-letter-v/
With that said, the deps log processing of .d files was a huge win for us. One thing to observe is that it's the same code and amount of work either way, but if you load them at startup they are processed during the critical path, while the deps log parsing happens during the build so their cost is amortized.
Look at the WIN32-related ifdefs in https://github.com/ninja-build/ninja/blob/master/src/disk_in... (I would link to something specifically but it's not that long of a file.)
Two of the comments post the same CDC 2017 list, and both come from twitter accounts with 0 posts (one is 100% retweets of anti-"liberal" content). I'm never sure how plausible it is for someone to have the time to sit on twitter all day just to RT these things and then jump onto rando blogs to leave long comments like these.
I often think of another NYT article in a similar vein, where they profiled people in the Bay Area whose net worth was in the ~$10m range.
This is an enormous amount of money and you'd think nobody would stick at a job they didn't like once they were at this point. As I recall in the article, the people in this situation kept thinking "I just need a little bit more" to enable some important next step on the luxury ladder, like horse lessons for their children.
I found this chilling especially because as a person who is wealthy but not that wealthy (note that if you make $40k/yr you're in the top 1% of humans already) I could see myself making similar sorts of rationalizations, not about luxury specifically but more around whether I have enough.
I encountered this attitude a lot in the Bay Area for the ~15 years I lived there and it was one of the reasons I recently left -- I worried my son would grow up around it and think that it was somehow normal behavior.
(Or alternatively, you say that dollars are also vanity plates, and are as worthless as stocks.)
(WebKit on Mac includes more of these things, but many of them rely on Mac-specific implementations, which weren't as useful for a browser that is primarily used on Windows.)
https://blog.nelhage.com/post/systems-that-defy-understandin...
https://brad.livejournal.com/2000/05/31/
(Edit: switched the link to match the flickr post.)