Re: [PHP-DEV] Improvements to Hastable Bucket structure

2015-01-22 Thread Benjamin Coutu
e: [PHP-DEV] Improvements to Hastable Bucket structure Hey: On Thu, Jan 22, 2015 at 3:36 PM, Dmitry Stogov wrote: > Hi, > > Xinchen already tried something similar, but it made PHP slower, because it > made access to Bucket->key->h more expensive - two loads with most probably > two

Re: [PHP-DEV] Improvements to Hastable Bucket structure

2015-01-21 Thread Xinchen Hui
Hey: On Thu, Jan 22, 2015 at 3:36 PM, Dmitry Stogov wrote: > Hi, > > Xinchen already tried something similar, but it made PHP slower, because it > made access to Bucket->key->h more expensive - two loads with most probably > two CPU cache misses instead of one. yes, the patch is here: https://git

Re: [PHP-DEV] Improvements to Hastable Bucket structure

2015-01-21 Thread Dmitry Stogov
Hi, Xinchen already tried something similar, but it made PHP slower, because it made access to Bucket->key->h more expensive - two loads with most probably two CPU cache misses instead of one. Thanks. Dmitry. On Thu, Jan 22, 2015 at 9:43 AM, Benjamin Coutu wrote: > Hi, > > Currently a hashtabl

Re: [PHP-DEV] Improvements to Hastable Bucket structure

2015-01-21 Thread Paul Dragoonis
On 22 Jan 2015 06:43, "Benjamin Coutu" wrote: > > Hi, > > Currently a hashtable bucket has to store both, the numeric index "h" and a potential pointer to a string key "key". > > There is room for improvement here because "h" and "key" are conceptually mutually exclusive. I therefore propose to un

[PHP-DEV] Improvements to Hastable Bucket structure

2015-01-21 Thread Benjamin Coutu
Hi, Currently a hashtable bucket has to store both, the numeric index "h" and a potential pointer to a string key "key". There is room for improvement here because "h" and "key" are conceptually mutually exclusive. I therefore propose to unionize "h" and "key" to effectively save the overhead