scripts/bloat-o-meter: don't use readlines()
authorAlexey Dobriyan <adobriyan@gmail.com>
Tue, 13 Dec 2016 00:40:45 +0000 (16:40 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 13 Dec 2016 02:55:06 +0000 (18:55 -0800)
commit3af06fd96aae18561830745880ca6e289053edae
tree75e88233acc979470ecda89f88fe9cdc01ede83c
parent3fb4afd9a504c2386b8435028d43283216bf588e
scripts/bloat-o-meter: don't use readlines()

readlines() conses whole list before doing anything which is slower for
big object files.  Use per line iterator.

Speed up is ~2% on "allyesconfig" type of kernel.

    $ perf stat -r 16 taskset -c 15 ./scripts/bloat-o-meter ../vmlinux-000 ../obj/vmlinux >/dev/null
...

  Before:  7.247708646 seconds time elapsed                ( +-  0.28% )
  After:   7.091202853 seconds time elapsed                ( +-  0.15% )

Link: http://lkml.kernel.org/r/20161119004143.GA1200@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/bloat-o-meter