aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mparser.py
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-17 19:16:57 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2020-03-01 19:27:49 +0200
commit4524088d386d2e2315d8fef6ffedc11d8e9a394a (patch)
tree60ba6c5be3099694136908bebb2a7f2c0112a4b9 /mesonbuild/mparser.py
parent25cbcb19a9208ebf8f5cde3f8ecb91df0a2dfebf (diff)
downloadmeson-4524088d386d2e2315d8fef6ffedc11d8e9a394a.zip
meson-4524088d386d2e2315d8fef6ffedc11d8e9a394a.tar.gz
meson-4524088d386d2e2315d8fef6ffedc11d8e9a394a.tar.bz2
CompilerArgs: make lookup faster
in order to deduplicate arguments as much as possible, we need to check if a argument is already part of the list. Which is quite slow because we are checking 3 lists for that. In smaller projects this might be not of interested. However, in efl things are quite "heavy", alone generating the ninja file took 40 sec.. 16 sec. are spent in __iadd__ of CompilerArgs. What this patch does to speed this all up is: 1. We only check if a element is in post when we know that it must be in post same for pre. 2. the checks for if we already do contain a specific value are now done via a dict, and not via the list. This overall brings the time from 16 sec. spent in __iadd__ to 9 sec. in __iadd__. Another possible solution for all this is to have a internal structure of CompileArgs of trees, so you have the "basic" layer of arguments where the position does not matter. Additionally, you have two stacks of lists, the pre stack and the post stack, duplicates can then be checked when itereting, which would safe another ~4s in terms of efl. However, i do not have time for this undertaking right now.
Diffstat (limited to 'mesonbuild/mparser.py')
0 files changed, 0 insertions, 0 deletions