patchGNU Octave - Patches: patch #10238, interpreter: Avoid some...

 
 

patch #10238: interpreter: Avoid some "nil" ovl construction and split code

Submitter:  John W. Eaton <jwe>
Submitted:  Wed 22 Jun 2022 01:46:51 PM UTC
   
 
Category:  Core : other Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 05 Nov 2022 03:33:13 PM UTC, comment #1: 

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

http://hg.savannah.gnu.org/hgweb/octave/rev/7781b1e77406

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.

John W. Eaton <jwe>
Group administrator
Wed 22 Jun 2022 01:46:51 PM UTC, original submission:  

From Petter Tomner <petter>, extracted from the zip file attached to the following comment in the discourse thread "WIP stack VM f\
or Octave": https://octave.discourse.group/t/wip-stack-vm-for-octave/2884/10

libinterp/octave-value/ov-builtin.cc: Move ctor into branches

John W. Eaton <jwe>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #53356:  octave_30620.patch added by jwe (7KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Submitted the item)
  • -email is unavailable- added by jwe
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-06-22 jwe Attached File- Added octave_30620.patch, #53356
        Carbon-Copy- Added petter

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code