Commit Graph

12 Commits

Author SHA1 Message Date
Moritz Bunkus
c9884c3e77
build system: don't optimize when compiling iso639_language_list.cpp
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.
2021-02-17 22:18:20 +01:00
Ofir Petrushka
962088f59c style: rubocop Style/Encoding
Fix Style/Encoding by rubocop

Signed-off-by: Cody Coder <cody.coder@gitcodebuddy.com>
2020-10-07 11:58:06 +11:00
Moritz Bunkus
0830be34db
build sys: include globally-required modules from single place 2019-02-05 13:45:34 +01:00
Moritz Bunkus
cd155df59b configure rework compiler type & version check 2017-11-18 10:46:36 +01:00
Moritz Bunkus
c7e004efa1 PCH #include scanner: force string encoding to be UTF-8
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.
2016-12-10 11:32:50 +01:00
KonaBlend
8ae78da74e build system: fix open file leak 2016-04-08 10:39:27 -04:00
KonaBlend
ca686f2ff8 build system: consolidate puts_runq and $verbose 2016-03-28 05:32:00 -04:00
KonaBlend
693de4f112 build system: fix moc dependencies
- 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.
2016-03-27 17:21:58 -04:00
Moritz Bunkus
95c2edd329 build system: fix dependencies for pre-compiled headers
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.
2016-03-26 13:21:59 +01:00
Moritz Bunkus
98e5bda5e9 build system: fix indentation 2016-03-26 13:10:31 +01:00
Moritz Bunkus
7e600c7e70 build system: centralize runq output
That way adjusting to a uniform width is easier.
2016-03-26 12:34:52 +01:00
KonaBlend
cee1debeaf add explicit pch support
- 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
2016-03-26 03:52:21 -04:00