Jonas,
Thanks for the info... looks like we could get an easy speedup by just
saving the split version. That reminds me of what the real problem is
though: in the new memory model we moved from a dense encoding of memory
command codes to a sparse encoding (so we could have individual bits in
the command mean "write" or "response" etc.), since we thought it would
be faster to pull those behavior flags right out of the command code
than do a lookup. It had an unintended side effect though: since many
of the cache stats are per-command, we now allocate and initialize a
very large array of stats, most of which aren't used due to the sparse
encoding. We've been talking about just going back to a dense encoding
to solve this problem but haven't done it yet.
Steve
Nathan Binkert wrote:
Well, I have also ran a profiler and it seems like sorting the
statistics takes up most of the time spent before simulation starts. The
function Stats::StatData::less(), which compares two StatDatas, is the
main time consumer. Especially the tokenize() function on each
StatsData.name takes time.
I should probably save the tokenized version of the name and not
recompute it every time.
It looks like less() does unneccessary work: it splits up the
hierarchical name at the "." (using tokenize()) and then compares the
token lists component-wise.
IMHO, a simple string compare of both StatsData.name should yeild the
same result w/o taking the strings apart. Thus, one could simplify
Stats::StatData::less():
It's not quite the same result. If I don't take them apart, then a.b
would come before ab. The idea was that names further down in the
hierarchy should come later in the sorted order than things higher up.
I guess if it's a big performance issue, we can change things, but I'd
first like to see if just saving the tokenized form of the name helps.
Nate
_______________________________________________
m5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/m5-users
_______________________________________________
m5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/m5-users