# [PATCH] Remove nTableSize from HashTable?

- Thread: https://externals.io/message/43352
- Original archive: https://news-web.php.net/php.internals/43352
- Started by Matt Wilmas on 2009-03-15T16:22:06+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #43352 — Matt Wilmas — 2009-03-15T16:22:06+00:00

URL: https://externals.io/message/43352#43352

Hi Dmitry, all,

Just a quick one... ;^)  Is there much, if any, advantage to removing the 
HashTable member nTableSize?  It's just nTableMask + 1, so it can be derived 
easily in the couple places that need it...  Figured it can't hurt to make 
things smaller, and it only adds a couple addition operations for resizing, 
basically. :-)

Patches if you want the change (or tell me to commit):
http://realplain.com/php/tablesize.diff
http://realplain.com/php/tablesize_5_3.diff


- Matt

---

## #43355 — Marcus Boerger — 2009-03-15T23:28:24+00:00

URL: https://externals.io/message/43352#43355 · In reply to: #43352

Hello Matt,

  if there is no advantage in doing so, why offer a patch?

Ok, you probably meant disadvantage. And the advantge of doing so is
probably a lower memory foot print. Did you by any chance run any
profiling? Without numbers, I guess it is not worth the effort changing
a core component.

Sunday, March 15, 2009, 5:22:06 PM, you wrote:

> Hi Dmitry, all,

> Just a quick one... ;^)  Is there much, if any, advantage to removing the 
> HashTable member nTableSize?  It's just nTableMask + 1, so it can be derived
> easily in the couple places that need it...  Figured it can't hurt to make 
> things smaller, and it only adds a couple addition operations for resizing,
> basically. :-)

> Patches if you want the change (or tell me to commit):
> http://realplain.com/php/tablesize.diff
> http://realplain.com/php/tablesize_5_3.diff


> - Matt 





Best regards,
 Marcus

---

## #43362 — Dmitry Stogov — 2009-03-16T10:12:59+00:00

URL: https://externals.io/message/43352#43362 · In reply to: #43352

Hi Matt,

I don't see a lot of reason in this patch as the benefit is near 
invisible and readability becomes worse.

Also the patch can break third-party modules like APC and Zend 
extensions. Even it's not a big problem as they can be easily fixed, I'm 
against of changing of core components without real benefit.

Thanks. Dmitry.



Matt Wilmas wrote:
> Hi Dmitry, all,
> 
> Just a quick one... ;^)  Is there much, if any, advantage to removing 
> the HashTable member nTableSize?  It's just nTableMask + 1, so it can be 
> derived easily in the couple places that need it...  Figured it can't 
> hurt to make things smaller, and it only adds a couple addition 
> operations for resizing, basically. :-)
> 
> Patches if you want the change (or tell me to commit):
> http://realplain.com/php/tablesize.diff
> http://realplain.com/php/tablesize_5_3.diff
> 
> 
> - Matt
