patchGNU Octave - Patches: patch #10222, interpreter: Object pool for...

 
 

patch #10222: interpreter: Object pool for scalars and stack frames

Submitter:  John W. Eaton <jwe>
Submitted:  Wed 22 Jun 2022 01:43:31 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
   

Tue 28 Feb 2023 04:07:28 PM UTC, comment #2: 

This change was also posted in patch #10160 with the following info in the original submission:


I have made a patch that adds an object pool for octave_base_scalar and
its derived classes, to decrease malloc and free usage.

Code like:


    function i = foo ()
            tic;
            for i = 1:100000
                    i = 1+2+3+4+5+6+7;
            end
            toc;
    end


has a speed increase of about 13% on my machine and the amount of mallocs
decreases from 1,1 million to 440 000.

The patch works fine on my x64 Debian machine, but should probably be tested
on a Windows build, because C++ thread_local support is kinda quirky.

The object pool size is set to 8, but could probably be tuned somewhat.

John W. Eaton <jwe>
Group administrator
Tue 28 Feb 2023 11:37:08 AM UTC, comment #1: 

Updated patch attached. This needs patches new_30599 onwards to be applied in sequence first.

(file #54408)

Arun Giridhar <arungiridhar>
Group Member
Wed 22 Jun 2022 01:43:31 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

Make octave_scalar_base an its descendents use an object pool to
decrease malloc and free usage. Same for some stack frames.

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 #54408:  new_30604.patch added by arungiridhar (13KiB - text/x-patch)
file #53340:  octave_30604.patch added by jwe (13KiB - 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 arungiridhar (Updated the item)
  • -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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-02-28 arungiridhar Attached File- Added new_30604.patch, #54408
    2022-06-22 jwe Attached File- Added octave_30604.patch, #53340
        Carbon-Copy- Added petter

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code