I was doing some memory profiling from another bug I'm looking at and I noticed the profiler telling me that there's an incredible amount of heap churn coming an allocation in InferSpewColorable (jsinfer.cpp:141). I should note this is in a debug build! I realize the code here is debug only.
In my (very low use) session that has only 3 tabs open for under 10 minutes with relatively little activity. this was responsible for over 60% of the blocks allocated(and freed) on the heap, at a grand total of 12 million blocks. Even for debug purposes that seems like it might be a little excessive.
Created attachment 628268 [details] [diff] [review]
This bug reminded me of another problem with the spew colors: since OS X 10.7 the TERM variable is xterm-256color instead of xterm-color so the colors stopped working.
The patch uses a static variable to avoid multiple lookups and adds xterm-256color.