4 ms·
Hmm. I am not following. Binaries are typically much larger than source code(because libraries etc). Am I wrong here?
by abc_lisper 10y ago
Hmm. I am not following. Binaries are typically much larger than source code(because libraries etc). Am I wrong here?
- vmateixeira 10y agoExactly the opposite.
- ezdiy 10y agoThe answer is - it's sorta comparing apples and oranges - libraries, or general C++ inlining cruft can inflate the binary size a lot indeed. A much fairer comparison is to compare source side by side. Chromium source is about 4x larger than operas, when not counting any 3rd party dependencies. Or even better, compile times. Chromium build (or firefox) is half a day job on mid-range laptop (especially with 4/8G memory). Opera builds in about 20 minutes. I was also pleasently surprised the codebase is not particularly bitrotten, and both VS2015 and modern gcc could cope with it.
- gsnedders 10y agoOpera used a relatively small subset of C++ for compatibility with some diabolical compilers for embedded devices, so in a sense it's less surprising that modern compilers had no problem: there's very little complex going on.
- zymhan 10y agoMy (non-expert) understanding is that, in general, the source code is going to be much more verbose than the machine-code output of a compiler. Considering that source code is written in a human-readable language and syntax, and machine code only needs to contain enough information for a CPU to decode, it would seem to follow that the source code should be a less efficient method for describing the program.