Review Board 2.0.15


stats: Optimise the text-based stats output to improve speed

Review Request #1643 - Created Jan. 15, 2013 and updated

Information
Andreas Hansson
gem5
default
Reviewers
Default
Changeset 9714:68ea5c8f8d6c
---------------------------
stats: Optimise the text-based stats output to improve speed

The text-based stats output is slow than the original C++ output. This patch
addresses some of those issues by removing:

    Asserts that are not required
    stats.ValueProxy, as it is no longer required
    Unnecessary calls to __getattr__ and __hasattr__

It also changes the formula calculation to only calculate the values and totals
of formulas if they have not been passed in from the C++. This allows other
formulas to be added, whilst ensuring that the stats output is sufficiently
fast.

Testing has shown a 6x - 8x increase in stats output speed.
Ensure that the output files are identical

Issue Summary

16 2 13 1
Description From Last Updated Status
If the asserts really aren't needed, it's fine to remove them, but an alternative to removing asserts, is to bytecode ... Nathan Binkert Jan. 25, 2013, 1:48 a.m. Open
I'm not objecting to their removal, since in this case, it is probably overkill. I'm just suggesting a general speedup ... Nathan Binkert Jan. 29, 2013, 2:20 a.m. Open
Review request changed
Updated (April 24, 2013, 10 p.m.)

Description:

~  

Changeset 9714:eca4b0df4021

  ~

Changeset 9714:68ea5c8f8d6c

   
   

stats: Optimise the text-based stats output to improve speed

   
   

The text-based stats output is slow than the original C++ output. This patch

    addresses some of those issues by removing:

   
   
Asserts that are not required
   
stats.ValueProxy, as it is no longer required
   
Unnecessary calls to __getattr__ and __hasattr__
   
   
   

It also changes the formula calculation to only calculate the values and totals

    of formulas if they have not been passed in from the C++. This allows other
    formulas to be added, whilst ensuring that the stats output is sufficiently
    fast.

   
   

Testing has shown a 6x - 8x increase in stats output speed.

Diff:

Revision 4 (+46 -38)

Show changes