DRAMSim2 icon indicating copy to clipboard operation
DRAMSim2 copied to clipboard

simulation performance

Open wky opened this issue 10 years ago • 1 comments

Problem: running a simple profiler, I see that the program spends so much time in this function: unsigned dramsim_log2(unsigned) in SystemConfiguration.h

dramsim_log2 is used too frequently. For example, it is invoked 7 times in function addressMapping in AddressMapping.cpp, on variables that do not change at all during one simulation.

My suggestion:

  1. use __builtin_clz to calculate log2
  2. use pre-calculated log2 number in the program

Thanks

wky avatar Aug 21 '14 20:08 wky

I have been through DRAMSim2 with a not-so-simple profiler and I agree there are some pretty serious issues. At some point I was putting together a series of patches to try to cut out some of the more egregious inefficiencies. However, I got busy with my thesis and work and so they never made it to the light of day because I never quite got them working. I could push these unfinished patches, but I'm not sure anyone would want to take on the task of finishing them off ...

Do you know if there's a way to check if a builtin is supported by a compiler at compiletime? I don't want to add this in and then have it break builds for people using compilers other than some specific version of gcc.

dramninjasUMD avatar Aug 23 '14 12:08 dramninjasUMD