From: "Mehr, Assaph (Assaph)" Date: 2004-08-02T15:22:07+09:00 Subject: Re: help me interpret profiler output One of the runs seems to have a call to LexerRuby::RubyLexer#initialize that isn't in the others. Helps? -----Original Message----- From: Simon Strandgaard [mailto:neoneye@adslhome.dk] Sent: Monday, 2 August 2004 3:26 PM To: ruby-talk ML Subject: help me interpret profiler output Im randomly experiencing a big slowdown in my code.. but I fail see where and what is causing this slowdown. Advices on how to move on are appreciated. Im writing a text editor which can do syntax colorering of Ruby code. recomputing all 50 lines takes about 0.09 - 0.15 seconds. However when inserting one letter.. so that only one line is recomputed, then it takes between 0.03 - 0.43 seconds! Im interested in hunting down why it often spends so long time computing just a single line. I have 1) profiled the recomputing of all 50 lines and 2) profiled the recomputing of a single line when speed is bad and 3) profiled the recomputing of a single line when speed is good. when I compare the profiler output, I fail to see where the slowdown are. You may see the output here: http://aeditor.rubyforge.org/wiki/wiki.pl?ProfilingLexerNew The place where I recompute is in the method #sync_lcache in this file http://rubyforge.org/cgi-bin/viewcvs/cgi/viewcvs.cgi/projects/experiment al/buffer/source/buffer.rb?rev=1.2.2.11&cvsroot=aeditor&only_with_tag=b2 0040707&content-type=text/vnd.viewcvs-markup I have inserted the following code around the place where I recompute Profiler__.start_profile # code to profile Profiler__.stop_profile Profiler__.print_profile(STDOUT) If you have any ideas why the recomputation of a single line takes unnecessary long time.. then please contact me. How can I identify what sometimes is causing this slowdown? -- Simon Strandgaard