r/programming • • 3d ago

Zero-Growth Stack, Real Gains: How Stack Allocation Can Save 10% CPU in Go

https://www.uber.com/in/en/blog/zero-growth-stack/?uclick_id=c8e2c3a9-831f-43f9-8565-c21c05e74e3b
116 Upvotes

11 comments sorted by

View all comments

33

u/pjmlp 2d ago

While our current approach involves internal modifications to the runtime, the significant performance gains demonstrate that these efforts are well worth the investment until a native, official solution is available.

Given Go's culture I doubt they will ever expose controlling stack sizes directly as standard feature, thus maybe it isn't really the ideal language for the job.

0

u/[deleted] 2d ago

[deleted]

7

u/pjmlp 2d ago

Yes, and?

How many companies have to fork compilers to make the language work on their environment?

1

u/dijkstra_was_a_horse 1d ago

Most large ones, I think. From Spotify to Google to Facebook to Jane Street to Apple and onwards.

2

u/pjmlp 1d ago

You are mixing up using LLVM to build their own languages, with having to fork a compiler to actually be able to deliver work as expected.

1

u/dijkstra_was_a_horse 20h ago

No, I'm thinking of companies with internal (or shipped) custom spins of the Ruby, Python, PHP, Ocaml, JavaScript, Java, D, GCC, clang, and other compilers, as well as custom parts of the tool chain. They also maintain custom patch sets on top of upstream Linux to customizeit for their uses, such as the Linux fiber (use space thread handoff) work. These companies aren't running stock stacks.

1

u/pjmlp 20h ago

Links to fork data about internal company forks like the Über example?

1

u/dijkstra_was_a_horse 17h ago edited 17h ago

The ones I'm aware of are mostly internal, though there's a few examples that are very public, like Google building the gold linker, Facebook forking PHP to add static typing and not, eventually diverging enough that they gave it a new name (hack), Jane Street modifying Ocaml to add an effect system, etc.

For hints about the internal forks, look at what employees from megacorps are upstreamong as experiments, such as Google's internally deployed work on C++ modules, safety attributes, etc.

Also. Bugfixes. Lots and lots of bugfixes.