llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

LNT should track and display code size improvements and regressions

Open chandlerc opened this issue 14 years ago • 3 comments

Bugzilla Link 14450
Resolution FIXED
Resolved on Jul 28, 2016 17:23
Version unspecified
OS All
CC @cmatthew,@gottesmm

Extended Description

I just wrote a terrible pile of shell to extract the change in binary size between two runs of LNT:

export BEFORE=/path/to/before/run/of/lnt export AFTER=/path/to/after/run/of/lnt find $BEFORE -type f -executable | egrep '(Multi|Single)Source' | grep -v '.sh$' | cut -d/ -f7- >/tmp/lnt_binaries.txt for b in $(< /tmp/lnt_binaries.txt ); do BEFORE_SIZE=$(size -A $BEFORE/$b | awk '/.text/ {print $2}'); AFTER_SIZE=$(size -A $AFTER/$b | awk '/.text/ {print $2}'); if [[ $BEFORE_SIZE != $AFTER_SIZE ]]; then echo "$b, $BEFORE_SIZE, $AFTER_SIZE, $(( (AFTER_SIZE - BEFORE_SIZE - 0.0) / BEFORE_SIZE ))"; fi; done

This works, but YUCK! It would be so much nicer if LNT just tracked this and did the really nice bucketing of run-over-run and run-over-baseline for these stats.

The three size buckets I would personally like to see tracked in LNT:

  1. size of .text section (code size)
  2. size of the sum of all .debug_* sections (debug info)
  3. size of the binary itself (to capture ro.data and other artifacts)

On Linux at least, these can be extracted as follows:

  1. % size -A $binary | awk '/^.text/ {print $2}'
  2. % size -A $binary | awk '/^.debug_/ {sum += $2} END {print sum}'
  3. % size -A $binary | awk '/^Total/ {print $2}'

chandlerc avatar Nov 29 '12 02:11 chandlerc

In r276039, I added code size to the LNT database, and in r276219 I changed the LNT client to only collect text size.

I have been using this internally for a few weeks and it works great for us.

The public server will have to be updated before it will work there.

cmatthew avatar Jul 29 '16 00:07 cmatthew

Mattias added this to the new cmake test-suite; however, it looks like LNT is not passing the value through to the server.

cmatthew avatar Apr 29 '16 20:04 cmatthew

assigned to @cmatthew

chandlerc avatar Nov 29 '12 02:11 chandlerc