I haven't spent any time looking at how the inbuilt profiler works, but could it insert a phantom frame before the tail-recursive word?
N.B. for measuring accumulated time it doesn't make sense to capture times of recursive calls to a word (direct or indirect) since the total time is measured in the outer frame anyway. In fact I added a hack to detect recursion and not time the inner calls otherwise this screwed up the accumulated timings. (i.e. inner call time is incorrectly added to outer call time even though the inner call is included in the outer call time) N.B. I'm no expert in code profiling so there may be some obvious stuff I'm missing. Cheers, Phil Slava Pestov wrote: > Hi Phil, > > This looks cool. We should incorporate this into the built-in > profiler, I think. Any idea how to do that without breaking tail call > optimization? > > Slava > > On Tue, Jul 8, 2008 at 2:54 PM, Phil Dawes <[EMAIL PROTECTED]> wrote: >> Hi Slava, Hi Factor List, >> >> I made a vocab for time-profiling words. It works by annotating words >> with code to record accumulated time in microseconds. >> >> git pull http://phildawes.net/2008/factor.git/ wordtimer >> >> example usage: >> "myvocab" [ run-some-code ] profile-vocab >> >> ... <runs code and prints timings and number of calls> >> >> N.B. it isn't by any means perfect or even especially accurate, but >> handy in the absence of a better accumulated time profiler. >> >> Hope it's useful to someone, >> >> Phil >> >> >> ------------------------------------------------------------------------- >> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! >> Studies have shown that voting for your favorite open source project, >> along with a healthy diet, reduces your potential for chronic lameness >> and boredom. Vote Now at http://www.sourceforge.net/community/cca08 >> _______________________________________________ >> Factor-talk mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/factor-talk >> > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Factor-talk mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/factor-talk > ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
