diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-09-11 17:32:31 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-09-11 18:21:56 +0530 |
commit | d9166a020c4c324ed867ae4110fa76faf726532e (patch) | |
tree | e21d5b5296267ed489a02ec7bb8963e2c3a758db /run_unittests.py | |
parent | 7ae3fbf88d0c5614f0966aa47b11cc4378fdabee (diff) | |
download | meson-nirbheek/minor-backend-perf.tar.gz |
Sprinkle functools.lru_cache() in a few more placesnirbheek/minor-backend-perf
This improves the backend generation time for gst-build from 7.4s to
6.6s. This is probably all the low-hanging fruit we can get, further
improvements will probably require refactoring, moving to pathlib.Path
or reimplementing CompilerArgs:
222045 0.551 0.000 1.324 0.000 compilers.py:666(__iadd__)
3691 0.230 0.000 0.885 0.000 ninjabackend.py:99(write)
233560 0.441 0.000 0.701 0.000 posixpath.py:75(join)
882 0.141 0.000 0.636 0.001 backends.py:509(generate_basic_compiler_args)
256301 0.248 0.000 0.576 0.000 compilers.py:562(_can_dedup)
37369 0.035 0.000 0.466 0.000 compilers.py:652(extend_direct)
74650 0.067 0.000 0.431 0.000 compilers.py:641(append_direct)
158153 0.089 0.000 0.405 0.000 ninjabackend.py:129(<lambda>)
845 0.064 0.000 0.391 0.000 ninjabackend.py:279(get_target_generated_sources)
58161 0.070 0.000 0.317 0.000 backends.py:217(get_target_generated_dir)
216825 0.175 0.000 0.275 0.000 ninjabackend.py:48(ninja_quote)
845 0.058 0.000 0.255 0.000 ninjabackend.py:2289(guess_external_link_dependencies)
845 0.068 0.000 0.239 0.000 backends.py:793(get_custom_target_provided_libraries)
52101 0.030 0.000 0.237 0.000 compilers.py:716(append)
1319326 0.231 0.000 0.231 0.000 {built-in method builtins.isinstance}
1189117 0.229 0.000 0.229 0.000 {method 'startswith' of 'str' objects}
3235 0.102 0.000 0.228 0.000 compilers.py:614(to_native)
Note: there are 845 build targets.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/run_unittests.py b/run_unittests.py index 145d9b548..79bafcd20 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -575,22 +575,22 @@ class InternalTests(unittest.TestCase): ''' Unit test for the library search patterns used by find_library() ''' - unix_static = ['lib{}.a', '{}.a'] - msvc_static = ['lib{}.a', 'lib{}.lib', '{}.a', '{}.lib'] + unix_static = ('lib{}.a', '{}.a') + msvc_static = ('lib{}.a', 'lib{}.lib', '{}.a', '{}.lib') # This is the priority list of pattern matching for library searching - patterns = {'openbsd': {'shared': ['lib{}.so', '{}.so', 'lib{}.so.[0-9]*.[0-9]*'], + patterns = {'openbsd': {'shared': ('lib{}.so', '{}.so', 'lib{}.so.[0-9]*.[0-9]*'), 'static': unix_static}, - 'linux': {'shared': ['lib{}.so', '{}.so'], + 'linux': {'shared': ('lib{}.so', '{}.so'), 'static': unix_static}, - 'darwin': {'shared': ['lib{}.dylib', '{}.dylib'], + 'darwin': {'shared': ('lib{}.dylib', '{}.dylib'), 'static': unix_static}, - 'cygwin': {'shared': ['cyg{}.dll', 'cyg{}.dll.a', 'lib{}.dll', - 'lib{}.dll.a', '{}.dll', '{}.dll.a'], - 'static': ['cyg{}.a'] + unix_static}, - 'windows-msvc': {'shared': ['lib{}.lib', '{}.lib'], + 'cygwin': {'shared': ('cyg{}.dll', 'cyg{}.dll.a', 'lib{}.dll', + 'lib{}.dll.a', '{}.dll', '{}.dll.a'), + 'static': ('cyg{}.a',) + unix_static}, + 'windows-msvc': {'shared': ('lib{}.lib', '{}.lib'), 'static': msvc_static}, - 'windows-mingw': {'shared': ['lib{}.dll.a', 'lib{}.lib', 'lib{}.dll', - '{}.dll.a', '{}.lib', '{}.dll'], + 'windows-mingw': {'shared': ('lib{}.dll.a', 'lib{}.lib', 'lib{}.dll', + '{}.dll.a', '{}.lib', '{}.dll'), 'static': msvc_static}} env = get_fake_env('', '', '') cc = env.detect_c_compiler(False) |