octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

profiler implementation


From: John W. Eaton
Subject: profiler implementation
Date: Wed, 10 Aug 2011 12:11:56 -0400

Earlier, we discussed using a singleton object that follows the
pattern of other singleton objects in Octave to implement the
profiler.  Looking at the current code, it doesn't seem to use that
style, but is just using a single global instance of the
profile_data_accumulator object.  Why?

The current implementation of the profile_data_accumulator::enter
object appears to allow data to be collected in multiple accumulator
objects, but then the code that uses this class, like

  {
    profile_data_accumulator::enter pe (profiler,
                                        profiler_name ());
    cmd_list->accept (*current_evaluator);
  }

only uses the global profiler object.  It seems to me that this code
would have to change if you wanted to collect data in a different
global accumulator object.

If you just want a single accumulator object, then I don't see
the point of passing it as an argument to the
profile_data_accumulator::enter object.  It seems it could just be
contained inside the profile_data_accumulator object.

Maybe I'm just missing something here, so could you explain why you
chose this structure?

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]