From d95421366716d0f5f3857d3b5551943492b5482b Mon Sep 17 00:00:00 2001 From: Veselin Georgiev Date: Sun, 17 Jan 2016 03:49:05 +0200 Subject: [PATCH] Speed up "make test" (around 5 times). The reason for the apparent slowness was that the "cpuid_tool" that was being called from run_tests.py is actually a shell script - a wrapper, installed by libtool. The script was heavy enough to cause substantial overhead. Just bypassing it (by using the real cpuid_tool binary) reduced "make test" running time from 4.1 to 0.7s on my machine. It is a bit hacky, though, so "make test-old" is retained, which uses the old invocation. --- Makefile.am | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 8ae80d9..1e81dd9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,7 +9,15 @@ EXTRA_DIST = libcpuid.pc.in libcpuid_vc71.sln libcpuid_vc9.sln Readme.md consistency: $(top_srcdir)/libcpuid/check-consistency.py $(top_srcdir)/libcpuid -test: +# "make test" is a bit hacked in order to speed up tests by bypassing the +# libtool wrapper script. The old (slower) version is available as "test-old" + +test: test-fast + +test-fast: + LD_LIBRARY_PATH=$(top_builddir)/libcpuid/.libs $(top_srcdir)/tests/run_tests.py $(top_builddir)/cpuid_tool/.libs/cpuid_tool $(top_srcdir)/tests + +test-old: $(top_srcdir)/tests/run_tests.py $(top_builddir)/cpuid_tool/cpuid_tool $(top_srcdir)/tests fix-tests: