From: Sam Roberts Date: 2006-06-02T05:17:08+09:00 Subject: Re: How use Profiling, a Quick Guide. On Fri, Jun 02, 2006 at 04:35:28AM +0900, Dave Howell wrote: > > * Look at the top most items in the profile list. Usually they are > > standard library functions. Silly things like [] or +... > > Ask your self, "What could be calling these thing so often? > > Can I make it do it less often? eg. Cache the result etc.) > > Er, the profile list? Push "Where do I find/how do I generate a > 'profile list'?" onto the question_stack 'profile', in the std lib > question_stack << "[Error: File 'strace' Not Found]" ktrace on BSD systems > > * Large number of calls to .size and .length and .count_objects > >methods are a > > clue some nidjit somewhere is doing something really N^2 stupid > >like... > > for( i=0; i < container.count_objects(); i++) { > > } > > question_stack << "What exactly is stupid about that? And what's the > smart alternative? max=container.count_objects() for( i=0; i < max; i++) { } container.each.... Sam