> On 30.5.2023, at 19:21, Larry Garfield <la...@garfieldtech.com> wrote:
> 
> On Tue, May 30, 2023, at 4:27 PM, Boro Sitnikovski wrote:
>> Hi,
>> 
>> Thank you for your thoughts.
>> 
>>> I would say the more common desired behavior is the one in your first
>>> example. And even for that we don't have a native function.
>> 
>> This Google search might give more insight into the number of 
>> discussions about a grouping functionality: 
>> https://www.google.com/search?q=php+group+elements+site:stackoverflow.com
>> 
>>> Your behavior can be implemented in userland like so:
>>> https://3v4l.org/epvHm
>> 
>> Correct, but then again, we can also implement 
>> `array_map`/`array_filter`/etc. in userland :)
>> 
>>> I think you need to make a case as to why the behavior you describe
>>> justifies a native function.
>> 
>> Similar to my previous answer, but also in general - ease of access and 
>> also performance.
> 
> Do you have benchmarks showing that implementing it in C would be notably 
> faster?  That would help the case that it should be written in C.
> 
> Also, please do not top-post.
> 
> --Larry Garfield
> 
> -- 
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: https://www.php.net/unsub.php

Sorry for the top-posting, my bad.

I ran some performance benchmarks and the improvement is about 25% - some 
details on the following gist: 
https://gist.github.com/bor0/3fa539263335fa415faa67606a469f2e?permalink_comment_id=4584327#gistcomment-4584327

Reply via email to