Skip to content

gtest_filter slow #3614

@anholt

Description

@anholt

Describe the bug

Running va-api's 17,415 gtest tests is slow (~25 minutes on Chrome OS's "grunt" boards), so I'm parallelizing it by sharding to multiple threads running multiple tests per gtest process invocation (https://gitlab.freedesktop.org/anholt/deqp-runner/-/merge_requests/24). By specifying the tests to run on each shard as a gtest_filter separated by ':', we're now spending more CPU in FilterMatchesTest() than in the actual tests. On my desktop, perf says I've got 35% of my CPU spent under main() of my unit tests, and 30% under FilterMatchesTest()

If at startup googletest could parse the filter list and toss the non-glob-containing filters into a set, leaving just a vec of glob-containing filters to go through PatternMatchesString(), that should be make the filter cheap for the case of "lots of names of specific tests to run"

Steps to reproduce the bug

git clone from that deqp-runner branch
cargo install --path .

# replace test_va_api here with a handy gtest binary with 17k tests in it
perf record -g gtest-runner run --gtest ~/test_va_api --output <output_dir>
perf report -g

Does the bug persist in the most recent commit?

Tested on fd873f6, hoping that might help, but no luck (I'm not using globs, so the fixes to globbing didn't do much).

What operating system and version are you using?

debian unstable

What compiler and version are you using?

gcc version 11.2.0 (Debian 11.2.0-9)

What build system are you using?

meson "debugoptimized" buildtype (-O2 but with assertions)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions