Live data from Hacker News

Large single compilation-unit C programs (2006)

people.csail.mit.edu

21–23 of 23 posts

Re: Large single compilation-unit C programs (2006)

#21

I've been working on a project that auto generates c programs - sometimes up to 1.5m lines of code - in a single file (actually two files but the second is only 35 lines) Not open source but happy to share benchmarks if that would be useful.

Some compile times for those interested:

Hardware 2016 12" MacBook (1.1GHz Core m3) Ubuntu 20.04 running in Docker Clang 9 -O0 optimisation (more optimisation increases the compile times a lot!)

0.53m LOC 41MB 34s

0.99m LOC 76MB 91s

1.44m LOC 110MB 167s

I suspect the code is relatively straightforward to compile - few function calls etc.

Re: Large single compilation-unit C programs (2006)

#22
post #15

I've been working on a project that auto generates c programs - sometimes up to 1.5m lines of code - in a single file (actually two files but the second is only 35 lines) Not open source but happy to share benchmarks if that would be useful.

Too bad it's not open source, but will some of the generated programs be? Also, would you mind comparing it to Csmith ( https://embed.cs.utah.edu/csmith/ )?

There is quite a lot of IP in the generated programs so probably not possible to share sadly.

I wasn't aware of Csmith so thanks for highlighting. My C code doesn't really test many features of the compiler so I suspect mainly of interest in seeing just how the compiler handles a really large single file.

Re: Large single compilation-unit C programs (2006)

#23
post #15

Earlier quoted context omitted.

Too bad it's not open source, but will some of the generated programs be? Also, would you mind comparing it to Csmith ( https://embed.cs.utah.edu/csmith/ )?

There is quite a lot of IP in the generated programs so probably not possible to share sadly. I wasn't aware of Csmith so thanks for highlighting. My C code doesn't really test many features of the compiler so I suspect mainly of interest in seeing just how the compiler handles a really large single file.

There's also https://github.com/intel/yarpgen which I haven't used. I believe there are a couple of others...
Post reply on HN