bug-gnu-libiconv
[Top][All Lists]
Advanced

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

[bug-gnu-libiconv] [bug #66023] Change the order of variables in `conv_s


From: Bruno Haible
Subject: [bug-gnu-libiconv] [bug #66023] Change the order of variables in `conv_struct` can reduce its memory usage.
Date: Thu, 25 Jul 2024 05:02:21 -0400 (EDT)

Update of bug #66023 (group libiconv):

                Category:                 Program => Converters             
                Severity:              3 - Normal => 1 - Wish               
                  Status:                    None => Not a Bug              
             Assigned to:                    None => haible                 
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #1:

As a general guideline, reducing memory usage by a factor of X will reduce
running times by a factor of X², therefore it is a good idea.

However, the reason why reducing memory usage increases execution speed is
that it reduces the use of the memory caches of the CPU. Thus, we need to look
at what happens to the locality of data references. You could probably measure
it through a tool like 'cachegrind'. Without that, let's make an educated
guess.

A 'struct conv_struct' is used in either input direction or output direction.
It is thus important to keep the fields for input close together and the
fields for output close together. Your proposal means that the fields for
output are not close together because 'ofuncs' and 'oindex','oflags',etc. are
quite wide apart.

Thus, it is not a good idea, IMO.


    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature


reply via email to

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