FilterTests is extremely slow
Reported by
kind...@yandex-team.ru,
Nov 9 2017
|
|||
Issue descriptionSteps to reproduce the problem: 1. Prepare build env for Android. 2. Compile a test binary with many tests: "ninja -C out/Default net_unittests" 2. Run tests with 100 items in the negative part of gtest filter : "./out/Default/bin/run_net_unittests gtest -v -f=DiskCacheEntryTest.SimpleCacheInFlightTruncate:HttpCacheTests/ClustersHttpCacheTest.ReceivedBytesConditionalRequest200/*:<and 99 more>" In our case we had "*" in half of them. 3. Test running script hangs about 8 min at this place: build/util/lib/common/unittest_util.py#FilterTestNames What is the expected behavior? This code (FilterTestNames) should run in seconds or even milliseconds. What went wrong? Probably too many iterations of fnmatch.fnmatch(), about 2 millions. Did this work before? N/A Chrome version: does not matter Channel: n/a OS Version: Flash Version: does not matter
,
Nov 10 2017
,
Nov 10 2017
> 2. Run tests with 100 items in the negative part of gtest filter : "./out/Default/bin/run_net_unittests gtest -v -f=DiskCacheEntryTest.SimpleCacheInFlightTruncate:HttpCacheTests/ClustersHttpCacheTest.ReceivedBytesConditionalRequest200/*:<and 99 more>" Correction: "./out/Default/bin/run_net_unittests gtest -v -f=-DiskCacheEntryTest.SimpleCacheInFlightTruncate:HttpCacheTests/ClustersHttpCacheTest.ReceivedBytesConditionalRequest200/*:<and 99 more>"
,
Dec 21 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/da0240761319bc610c7c4121d76659c7364b79bb commit da0240761319bc610c7c4121d76659c7364b79bb Author: Dmitry Trofimovich <kindrik@yandex-team.ru> Date: Thu Dec 21 18:09:07 2017 Optimize FilterTestNames() by using precompiled patterns. Previous implementation was slow when you put too many items in the negative part of gtest filter (with positive part = *). For net_unittests we have 2 mln fnmatch.fnmatch() calls. Using one re match() instead of repetitive fnmatch() is much faster. This change makes it more than 1000 times faster in heavy scenarios (0.1 sec instead of 8 min for net_unittests with 100 negative items). R=alexandermont@chromium.org, jbudorick@chromium.org Bug: 783187 Change-Id: I70b0487e451cfc0457a683d4e1ef5de2a8bee732 Reviewed-on: https://chromium-review.googlesource.com/758853 Reviewed-by: John Budorick <jbudorick@chromium.org> Commit-Queue: John Budorick <jbudorick@chromium.org> Cr-Commit-Position: refs/heads/master@{#525737} [modify] https://crrev.com/da0240761319bc610c7c4121d76659c7364b79bb/build/util/lib/common/unittest_util.py
,
Mar 9 2018
Hope this is fixed, closing for now. Please reopen if needed.
,
Mar 9 2018
|
|||
►
Sign in to add a comment |
|||
Comment 1 by kind...@yandex-team.ru
, Nov 9 2017