Re: [PHP-DEV] Directly embed small strings in zvals

2016-10-27 Thread Benjamin Coutu
-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

Re: [PHP-DEV] Directly embed small strings in zvals

2016-10-27 Thread Lauri Kenttä
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,

Re: [PHP-DEV] Directly embed small strings in zvals

2016-10-27 Thread Benjamin Coutu
, Dmitry Stogov , Xinchen Hui Date: Tue, 13 Sep 2016 18:29:10 +0200 Subject: [PHP-DEV] Directly embed small strings in zvals > Hello everyone, > > I was wondering if it would make sense to store small strings (length <= 7) > directly inside the zval struct, thereby avoiding the

Re: [PHP-DEV] Directly embed small strings in zvals

2016-09-14 Thread Andrea Faulds
Hi Dmitry, Dmitry Stogov wrote: I was skeptical about this idea, but the PoC looks interesting and quite simple. This might be too big change for 7.*, if we won't completely hide implementation details for extensions using existing macros... I've wondered about 7.x. You can't *completely* h

Re: [PHP-DEV] Directly embed small strings in zvals

2016-09-14 Thread Andrea Faulds
Hi Dmitry, Andrea Faulds wrote: One nice thing, though, is that the API itself doesn't really change, you just have to be more careful about how you use it. So, optimistically, breakage might be quite small. I don't know how much breakage there is currently. Sorry, I made a mistake here, I was

Re: [PHP-DEV] Directly embed small strings in zvals

2016-09-13 Thread Dmitry Stogov
ome benchmarks? real-life apps? Thanks. Dmitry. From: Andrea Faulds Sent: Tuesday, September 13, 2016 9:26:03 PM To: internals@lists.php.net Subject: Re: [PHP-DEV] Directly embed small strings in zvals Hi Ben! Benjamin Coutu wrote: > I was wondering if it wo

Re: [PHP-DEV] Directly embed small strings in zvals

2016-09-13 Thread Andrea Faulds
Hi Ben! Benjamin Coutu wrote: I was wondering if it would make sense to store small strings (length <= 7) directly inside the zval struct, thereby avoiding the need to extra allocate a zend_string, which would also not entail any costly indirection and refcounting for such strings. The idea

[PHP-DEV] Directly embed small strings in zvals

2016-09-13 Thread Benjamin Coutu
Hello everyone, I was wondering if it would make sense to store small strings (length <= 7) directly inside the zval struct, thereby avoiding the need to extra allocate a zend_string, which would also not entail any costly indirection and refcounting for such strings. The idea would be to add