Escolar Documentos
Profissional Documentos
Cultura Documentos
occurs.
All right, so you really want to know
kind of how much time is spent in the
top level function, but subtracting out
all
the low, the functions that it calls
right?
So it turns out that it spends a lot of
time in the
top level function, but even after you
subtract out all of the lower level
functions, then that has something that's
interesting.
But most of the time you will notice that
when you subtract out all the lower level
functions that get, that get called
there's very
little time it spends in the top level
function.
And because all the work and all the kind
of the computations is being done
at the lower level function, so that's,
that's
kind of where you want to focus your
efforts.
So, the, the buy.self format is, I, I
think, the most
interesting format to use because it tells
you how much time
is being spent in a given function, but
after subtracting out all of the
other, all of the time spent in, in lower
level functions that it calls.
So it gives you I think a more accurate
picture of, you know, which functions are
really, are truly
taking up the most amount of time and
which functions
that you might want to target for
optimization, later on.
So here's an example of some output in the
by.total format and you can see very
clearly at the very top that 100% of the
time is spent in the lm function.
So the total time was 7.41 seconds for
this run.
And all of it was spent in lm.
Of course, because lm was the top level
function.
But you can see that and so you can
see that the second place winner was the
lm.fit function.
I mentioned lm.fit is where a lot of the
computation occurs.
And so that was three and a half seconds,
so about half of the time in that
function.
Now, now you also see that a number of
functions here model.frame,
model.frame.default, eval,
spent.