Re: [PATCH] Unpack bools in ACLUserData

From: Kinkie <gkinkie_at_gmail.com>
Date: Thu, 24 Jan 2013 10:44:36 +0100

On Thu, Jan 24, 2013 at 2:58 AM, Amos Jeffries <squid3_at_treenet.co.nz> wrote:
> On 24/01/2013 5:22 a.m., Kinkie wrote:
>>
>> Hi,
>> this patch converts the unsinged integers in ACLUserData to unpacked
>> bools.
>>
>> --
>> /kinkie
>
>
> Are we doing this to reduce the memory footprint? or only to simplify the
> code?

sizeof(bool)==sizeof(char), so it's not for the footprint. It's more
about code clarity.

> This step goes some way towards memory savings by halving the memory
> footprint. To reduce the memory footprint by another half again we should be
> using bool:1.
>
> In micro-benchmarks I ran 100,000,000 X.x=1 assignments; uint->bool saves
> ~20 to 100 ms, bool->bool:1 saves ~5 to -90 ms more)

This is an interesting (although a bit counterintuitive) argument; I
didn't include the downsizing upon suggestions that it may not be
portable and/or standard, and that it would be less effective than
full-size bools. I'm fine either way.

--
    /kinkie
Received on Thu Jan 24 2013 - 09:44:43 MST

This archive was generated by hypermail 2.2.0 : Thu Jan 24 2013 - 12:00:08 MST