pmmp / ext-pmmpthread

Fork of https://github.com/krakjoe/pthreads with a revamped API and PHP 8.1+ support
Other
81 stars 17 forks source link

De-duplicate interned strings during class copying #102

Open dktapps opened 1 year ago

dktapps commented 1 year ago

During class copying, it's likely that many copies of the same string will be made, for example the names of properties and inherited methods. We can avoid this by putting interned strings into PTHREADS_ZG(resolve), allowing strings with the same origin pointer to reuse the same destination string. This will both improve performance and reduce memory usage.