Even `-O1` causes compilation time & memory usage to skyrocket,
possibly exponentially, with the number of entries to `emplace_back()`
into the vector.
This isn't so bad with the current number of entries (489). In that
case compilation with `-O3` only takes 7.2s.
However, extending the list to cover ISO 639-3 means that the list
will include 7160 entries. With that many entries things are much,
much more severe:
• with `-O1` alone compilation takes 11m 23s already.
• with `-O3` memory usage exceeded 20 GB after six minutes when I had
to abort due to other running applications getting killed.
Runtime cost is negligible. I ran a micro benchmark. With all 7160
entries and no optimizations (`-O0`) the initialization takes ~1.4
milliseconds for the one-time initialization on startup; with
optimizations (`-O1`) it still took ~570 microseconds.
Part of the implementation of #3007.
If the locale is set to non-UTF-8 when (d)rake is invoked then Ruby will
set the encoding of all strings read from files to US-ASCII. As several
source files do use non-ASCII characters this results in warnings from
Ruby about "invalid byte sequence in US-ASCII".
As all of my source code files are encoded in UTF-8 we can simply
enforce this.
This happens when building the RPMs which sets the locale to C.
- fix is a combination of 95c2edd3 and cee1debe progression
- 95c2edd3 masked a cee1debe regression
When pch is enabled we must establish a .moco => .moc dependency
(regressed by cee1debe).
Other changes are cosmetic.
The error was that a dependency was set from the source files to the
pre-compiled header (e.g. src/mkvmerge/mkvmerge.cpp =>
src/common/common_pch.h.pch). The dependency must be for the object
file, though, otherwise the source files will always be considered to be
out of date.
- convert gcc to use -include
- add clang support for -include
- new target namespace: pch (invoke rake -T or pch:overview for details)
- move pch logic into rake.d/pch.rb
- convert a few troublesome source files from ISO-8859-1 -> UTF-8
- add persistent config: config.pch.json
- add TTY support for running commands with filters (keeps pretty
color diagnostics even when filtering compiler stdout/stderr)
- for fun try:
drake "pch[pretty]"
drake -j4
drake pch:status