[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-patch-tracker] [patch #10160] interpreter: Object pool for scala
From: |
Petter Tomner |
Subject: |
[Octave-patch-tracker] [patch #10160] interpreter: Object pool for scalars |
Date: |
Fri, 10 Dec 2021 20:29:10 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 |
URL:
<https://savannah.gnu.org/patch/?10160>
Summary: interpreter: Object pool for scalars
Project: GNU Octave
Submitted by: petter
Submitted on: Sat 11 Dec 2021 01:29:08 AM UTC
Category: Core : new feature
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
Hi!
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.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Sat 11 Dec 2021 01:29:08 AM UTC Name: objpool.patch Size: 7KiB By:
petter
<http://savannah.gnu.org/patch/download.php?file_id=52481>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/patch/?10160>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-patch-tracker] [patch #10160] interpreter: Object pool for scalars,
Petter Tomner <=