diff libinterp/octave-value/ov-mex-fcn.cc @ 19361:91cd85a75705 gui-release

Reduce profiling overhead using inlining and templates. * profiler.cc (profile_data_accumulator::enter::enter): Remove function. * profiler.h: Make class "enter" a templated class. Have enter constructor check whether profiling is active before calling the expensive profiler_name() function. Redefine BEGIN_PROFILER_BLOCK macro to call profile_data_accumulator::enter with a classname argument to template. * ov-builtin.cc (octave_builtin::do_multi_index_op): Use new BEGIN_PROFILER_BLOCK macro. * ov-mex-fcn.cc (octave_mex_function::do_multi_index_op): Use new BEGIN_PROFILER_BLOCK macro. * ov-usr-fcn.cc (octave_user_script::do_multi_index_op, octave_user_function::do_multi_index_op): Use new BEGIN_PROFILER_BLOCK macro. * pt-binop.cc (tree_binary_expression::rvalue1): Use new BEGIN_PROFILER_BLOCK macro. * pt-binop.h (profiler_name): New function to return profiler name for class tree_binary_expression. * pt-unop.cc (tree_prefix_expression::rvalue1, tree_postfix_expression::rvalue1): Use new BEGIN_PROFILER_BLOCK macro. * pt-binop.h (profiler_name): New function to return profiler name for class tree_prefix_expression and tree_postfix_expression.
author Julien Bect <julien.bect@supelec.fr>
date Mon, 23 Jun 2014 18:46:32 +0200
parents 175b392e91fe
children 76478d2da117
line wrap: on
line diff
--- a/libinterp/octave-value/ov-mex-fcn.cc	Sat Nov 08 16:45:13 2014 +0100
+++ b/libinterp/octave-value/ov-mex-fcn.cc	Mon Jun 23 18:46:32 2014 +0200
@@ -148,8 +148,10 @@
 
       try
         {
-          BEGIN_PROFILER_BLOCK (profiler_name ())
+          BEGIN_PROFILER_BLOCK (octave_mex_function)
+
           retval = call_mex (have_fmex, mex_fcn_ptr, args, nargout, this);
+
           END_PROFILER_BLOCK
         }
       catch (octave_execution_exception)