changeset eb2975c014cd in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=eb2975c014cd
description:
        sim: Add support for tcmalloc if it's installed and available.
        This package is available in Ubuntu, Debian, and Redhat as 
google-perftools.
        With multiple tests on a single machine I've seen a little over 10% 
performance
        gain with tcmalloc.

diffstat:

 SConstruct |  11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diffs (28 lines):

diff -r 904ddeecc653 -r eb2975c014cd SConstruct
--- a/SConstruct        Tue Jun 05 01:23:08 2012 -0400
+++ b/SConstruct        Tue Jun 05 01:23:09 2012 -0400
@@ -749,6 +749,14 @@
     conf.CheckLibWithHeader('rt', 'time.h', 'C',
                             'clock_nanosleep(0,0,NULL,NULL);')
 
+if conf.CheckLib('tcmalloc_minimal'):
+    have_tcmalloc = True
+else:
+    have_tcmalloc = False
+    print termcap.Yellow + termcap.Bold + \
+          "You can get a 12% performance improvement by installing tcmalloc "\
+          "(google-perftools package on Ubuntu or RedHat)." + termcap.Normal
+
 if not have_posix_clock:
     print "Can't find library for POSIX clocks."
 
@@ -1011,6 +1019,9 @@
     if env['USE_SSE2']:
         env.Append(CCFLAGS=['-msse2'])
 
+    if have_tcmalloc:
+        env.Append(LIBS=['tcmalloc_minimal'])
+
     # The src/SConscript file sets up the build rules in 'env' according
     # to the configured variables.  It returns a list of environments,
     # one for each variant build (debug, opt, etc.)
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to