[Top][All Lists]

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

[Octave-patch-tracker] [patch #10238] interpreter: Avoid some "nil" ovl

From: John W. Eaton
Subject: [Octave-patch-tracker] [patch #10238] interpreter: Avoid some "nil" ovl construction and split code
Date: Sat, 5 Nov 2022 11:33:13 -0400 (EDT)

Follow-up Comment #1, patch #10238 (project octave):

I pushed a change that moves evaluation of Matlab-style short-circuit
operators to a separate function:


Instead of checking a flag to dispatch in tree_binary_expression::evaluate, I
created a new tree_braindead_shortcircuit_binary_expression and modified the
parser to convert tree_binary_expressions to this new type when needed.  With
this change, evaluation of ordinary tree_binary_expression objects (the vast
majority of all binary operations) is simplified so that it never has to check
and possibly dispatch to another type of evaluation.  This change seems to
speed up binary operations by as much as 10% in my tests of long chains of
1+2+3+... in a loop so that evaluation of the binary operator should dominate
the execution time.

For now I skipped the change for evaluation of built-in functions and methods
as I would like to consider a similar change that splits tree_builtin to
tree_builtin_function and tree_builtin_method to avoid the extra run-time
dispatch.  But that change deserves some discussion as it will probably
require changing some public interfaces.


Reply to this item at:


Message sent via Savannah

reply via email to

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