You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf test brstack: Speed up running test by using tr -s instead of xargs
JIRA: https://issues.redhat.com/browse/RHEL-77936
upstream
========
commit 3178155
Author: James Clark <[email protected]>
Date: Fri Dec 13 17:13:12 2024 -0600
description
===========
The brstack test runs quite slowly in software models. Part of the reason
is "xargs -n1" is quite inefficient in replacing spaces with newlines.
While that's not noticeable on normal machines, it is on software models.
Use "tr -s ' ' '\n'" instead which can do the same transformation, but is
much faster. For comparison on an M1 Macbook Pro:
$ time seq -s ' ' 10000 | xargs -n1 > /dev/null
real 0m2.729s
user 0m2.009s
sys 0m0.914s
$ time seq -s ' ' 10000 | tr -s ' ' '\n' | grep '.' > /dev/null
real 0m0.002s
user 0m0.001s
sys 0m0.001s
The "grep '.'" is also needed to remove any remaining blank lines.
Signed-off-by: James Clark <[email protected]>
Reviewed-by: Anshuman Khandual <[email protected]>
Reviewed-by: James Clark <[email protected]>
Reviewed-by: Namhyung Kim <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Kan Liang <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Anshuman Khandual <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
[robh: Drop changing loop iterations on arm64. Squash blank line fix and redo commit msg]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Michael Petlan <[email protected]>
0 commit comments