Commit graph

14 commits

Author SHA1 Message Date
Marijn Suijten 46080de113 generator: Simplify error handling
Similar to Rusts return and try, just use exceptions and pretty-print
them at the highest level (instead of presenting the user with a
stacktrace that's harder to read than the error alone).
2021-04-12 08:48:37 +00:00
Marijn Suijten 1c18a54177 generator: Run all gir processes in parallel
Since the addition of doc regeneration - which also spawns a gir process
for every non-sys crate - the process is now incredibly slow and not
well suited for iterative development:

    ./generator.py --no-fmt  26.25s user 0.79s system 99% cpu 27.044 total

All gir processes are currently ran in serial (the generator waits for
one to complete before spawning the next process) even though there are
no inter-dependencies.  Simply spawning all processes at once and
collecting their results + printing them in order after everything has
been spawned yields a significant speedup:

    ./generator.py --no-fmt  37.99s user 0.88s system 3285% cpu 1.183 total

Note: this is on a 32-core ThreadRipper.  The improvement is more modest
on machines with less cores, and also depends on IO speed.  A 4-core i5,
before and after:

    ./generator.py --no-fmt  30.24s user 0.76s system 99% cpu 31.055 total
    ./generator.py --no-fmt  57.78s user 0.88s system 763% cpu 7.685 total

That's still a sizable gain for simply not blocking on other tasks
anymore.
2021-04-12 08:48:37 +00:00
Marijn Suijten 7bd5212484 generator: Always update docs.md for non-sys crates 2021-04-11 15:47:07 +02:00
Marijn Suijten 7328d7ada5 generator: Accept multiple girs-dirs and pass gst-gir-files to gir 2021-04-01 15:53:23 +02:00
Marijn Suijten 9a96dd05b8 generator: Autoformat and normalize quotation with black 2020-11-24 20:20:18 +01:00
Guillaume Gomez 5b7c882497 Remove python2 code 2020-11-24 15:21:51 +01:00
Sebastian Dröge de0ed0040a Update generator.py from gtk-rs 2020-11-24 13:17:17 +02:00
Sebastian Dröge b84cead5ec Update generator.py from gtk-rs 2020-11-19 19:51:59 +02:00
Guillaume Gomez fec4e12410 Run cargo build on gir unless there was a git submodule update failure 2020-11-12 20:08:55 +01:00
Sebastian Dröge f657a56947 Move Gir.toml into the corresponding subdirectories 2020-10-30 18:06:01 +02:00
Guillaume Gomez 37dad014ec Improve generator script 2020-10-29 10:26:05 +01:00
Sebastian Dröge 15d5d169a3 generator: Switch to Python 3
It's 2020.
2020-08-11 12:53:27 +03:00
Guillaume Gomez da002aa98c Fix generator 2019-11-11 11:34:09 +01:00
Sebastian Dröge 93dc69f3f3 Add generator.py from gstreamer-rs-sys 2019-06-18 13:10:24 +03:00