pthreads_store currently malloc()s a new pthreads_storage for every item, regardless of type. This is wasteful because the underlying HashTable which pthreads uses for shared properties uses Z_PTR to wrap around these storages.
Thus, the access for an integer becomes
(Z_PTR_P(zend_hash_find(propName)))->lval
when instead, it could take one less allocation and also one less indirection by storing a ZVAL_LONG in the HashTable directly, instead of a ZVAL_PTR->pthreads_storage.
This would both improve performance (slightly) and reduce memory usage of Threaded objects.
pthreads_store currently malloc()s a new pthreads_storage for every item, regardless of type. This is wasteful because the underlying HashTable which pthreads uses for shared properties uses Z_PTR to wrap around these storages.
Thus, the access for an integer becomes
(Z_PTR_P(zend_hash_find(propName)))->lval
when instead, it could take one less allocation and also one less indirection by storing a ZVAL_LONG in the HashTable directly, instead of a ZVAL_PTR->pthreads_storage.
This would both improve performance (slightly) and reduce memory usage of
Threaded
objects.