octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #57321] Performance degradation due to memory


From: anonymous
Subject: [Octave-bug-tracker] [bug #57321] Performance degradation due to memory allocation
Date: Thu, 5 Dec 2019 09:38:52 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:60.9) Goanna/4.1 PaleMoon/28.2.0a1

Follow-up Comment #3, bug #57321 (project octave):

I made some changes.
The memory pool is added to each class via a In the file ther is a macro named
"DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2" that currently is used by
"octave_base_value" and most of its sub-classes. The macro defines static
members like "static type id" and "name". I have changed the macro so it can
add the memory pool to each class that use it. 
Sometimes a subclass of "octave_base_value" may not use the macro. In such
cases the previous design "ov-base3.h" won't be applicable so I changed it and
uploaded "ov-base4.h" and "ov-base4.h.diff". I also added the exception safety
for the "free" method of the memory pool.

Nearly 60 classes are using the macro so there are 60 memory pools per thread
and as octave currently works with at most two threads there are totally 120
memory_pools in "octave_gui" and 60 in "octave_cli".

A sub-class of "octave_base_value" that doesn't use the macro if its size is
equal to its parent ,that is using the macro, can benefit from the memory pool
of its parent. 

So with the current design the memory pools are distributed across classes. An
alternative design would be a central memory pool that contains an array of
sub pools. I will explain more in a next comment. 


(file #48002, file #48003)
    _______________________________________________________

Additional Item Attachment:

File name: ov-base4.h                     Size:27 KB
    <https://savannah.gnu.org/file/ov-base4.h?file_id=48002>

File name: ov-base4.h.diff                Size:4 KB
    <https://savannah.gnu.org/file/ov-base4.h.diff?file_id=48003>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57321>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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