- Notes from 11/18/02 - timing utils - runtime - time actually spent executing instructions while not looking for memory - gc-time - time spent dealing with memory (garbage collection) - realtime - wall-clock time (different from sum b/c of other processes) - usually interested in run+gc time - however, gc will increase as the heap gets 'worse' - ie, gc time is dependent on state before you start, unlike runtime - iteration/recursion and enviroment frames - recursion adds frames in a chain, logically - each function call adds a new one - for iteration, previous frames will be thrown away once you reach the last one - so you can just throw them away immediatly rather than waiting - overwrite the old frame with the current one - efficient - note on timing stream implementations - streams get cached! - ie doing (stream-head stream 500) twice in a row will give 0 time the 2nd time - replaces forced promises with values - turns into a long list of values with a promise at the end - redefine may clear the cache if you want to re-time - supposedly no easy function though - all you need is lambda! - nifty! - functions of one arg - all you need, since more than one can be simulated this way - look at demo of cons, car, cdr, and the start of integers