Mercurial > octave-antonio
diff libinterp/parse-tree/pt-binop.cc @ 19327: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 | 701e91ea0fe6 |
children | 4197fc428c7d |
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-binop.cc Sat Nov 08 16:45:13 2014 +0100 +++ b/libinterp/parse-tree/pt-binop.cc Mon Jun 23 18:46:32 2014 +0200 @@ -135,7 +135,7 @@ if (! error_state && b.is_defined ()) { - BEGIN_PROFILER_BLOCK ("binary " + oper ()) + BEGIN_PROFILER_BLOCK (tree_binary_expression) // Note: The profiler does not catch the braindead // short-circuit evaluation code above, but that should be