Skip to content

perf: improves RingBuffer by using native PHP arrays#2159

Open
Litarnus wants to merge 1 commit into
masterfrom
ringbuffer-improvement
Open

perf: improves RingBuffer by using native PHP arrays#2159
Litarnus wants to merge 1 commit into
masterfrom
ringbuffer-improvement

Conversation

@Litarnus

Copy link
Copy Markdown
Contributor

Benchmarks showed that using regular PHP arrays compared to SplFixedArray improves pushing into the RingBuffer by around 2x and makes toArray significantly faster because we can utilise array_slice instead of iteration by hand.

We also get free copy-on-write mechanics since that's the default with PHP arrays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant