pmmp / ext-pmmpthread

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

First look at single-copy strings #93

Closed dktapps closed 1 year ago

dktapps commented 1 year ago

This is an experimental implementation of #71.

If this works, it would offer some nice performance advantages to PM, since its inter-thread channels would benefit from this, as would async tasks.

dktapps commented 1 year ago

merging-members.phpt now fails because of a bug in local cache handling, which is not caused by this PR, but now shows up in this test because strings are now retained in local caches.

dktapps commented 1 year ago

Local testing indicates that this offers significant performance gains for channel-style use-cases seen in PM. In particular, since PM sends far more traffic out than it receives, this change offers a significant performance advantage to the main server thread.

It's unclear exactly how much real-world benefit this will have, but I'm very happy with the results so far.