Re: Directly embed small strings in zvals
| From: | Benjamin Coutu | Date: | Thu, 27 Oct 2016 19:40:00 +0000 |
| Subject: | Re: Directly embed small strings in zvals | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-96630@lists.php.net to get a copy of this message | ||
Ouch, forgot my powers of two there during a weak moment - what a careless mistake. Sorry about
that!
Given the low entropy I highly doubt this to be of much benefit.
========== Original ==========
From: Lauri Kenttä <lauri.kentta@gmail.com>
To: Benjamin Coutu <ben.coutu@zeyos.com>
Date: Thu, 27 Oct 2016 17:12:15 +0200
Subject: Re: [PHP-DEV] Directly embed small strings in zvals
>
>
> On 2016-10-27 18:02, Benjamin Coutu wrote:
> > Limiting ourselves to these common 64 characters ([a-zA-Z0-9_.]) would
> > allow us to effectively store (256 / 64) * 7 = 28 characters in those
> > available 7-bytes plus 1 byte (minus pointer tag bit) for the length.
>
> That's wrong. 256 = 2**8, and 64 = 2**6, so you get 8/6*7 = 9 chars..
> Not really better than 7 chars, especially considering that all
> operations on single characters would be slower than usual.
>