Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I work on the video game factorio, which is a c++ project. On a 9900k a rebuild takes about a minute, so it's pretty sizeable but not something ridiculous like oracle db or unreal engine. I tried using zapcc on it, and it was a complete failure. I don't have measurements to hand, but iirc it was actually slower than stock clang. I tested it on a threadripper 2950x with 64gb of ram, running Debian.


I just installed the game again to play the v1.0 release.

It looks and sounds very good! Congratulations on making it to the release milestone after many years of hard work.

As a developer, I must say that I'm deeply impressed by the simulation complexity and incredible scalability.

I keep telling people that Factorio is the most complex train simulator game that I've ever played. But it isn't a train simulator. It's a factory game. The trains are optional.

That's crazy to me, that a subset of a game can be more complex than entire games that "specialise" in the topic.


How do I make curved tracks?


The first bit of track you place is always straight; but if you extend the rail (by clicking on the green arrow of the first piece of rail) you can place curves.

https://wiki.factorio.com/Rail_planner


This was genuine question BTW.


There is a tutorial in-game!

After placing a track, click the end of the track and hold shift to use the "placement planner". Helps work out the curves and things.


I've had good results on some of my own projects. The current implementation certainly has limitations, but it's really early and the potential is huge. For example, because it can cache at a sub-compilation-unit granularity it can make rebuilds of a single file faster, which no distributed build tool or cache can do.


Thank you for Factorio!


Have you tried switching to a unity build? Or removing templates?


We do use a unity build yeah. Without it would be way way longer, maybe 5 minutes+. As for removing templates, there are a few places where we specifically opted to use custom macros instead of std::variant, for compile time reasons, but mostly we do use templates quite a lot.


A unity build gives some of the same build time benefits as zapcc for full rebuilds, but requires more work and compromises in code structure, and also increases your single-file incremental build time. If you're already using a unity build then I'd expect zapcc to not speed up full builds much if at all.

I'd be interested to see if zapcc could speed up your non-unity build to be close to your unity build, without requiring the same compromises. I'd also be interested to see if zapcc would speed up single-file incremental builds in your unity build.

Ultimately I can't recommend zapcc for general use as it's a fork of clang that's not being regularly rebased anymore, so it's getting out of date. That's why I wish someone would pick it up again.


How does ccache compare to it?

https://ccache.dev/


That is what I normally use. ccache is great! With a unity build its usefulness is a bit diminished, but it's still great for switching back and forth between branches.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: