# Lists: a simple way to improve PHP performance

- Thread: https://externals.io/message/84530
- Original archive: https://news-web.php.net/php.internals/84530
- Started by Ludovic Urbain on 2015-03-11T09:01:40+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #84530 — Ludovic Urbain — 2015-03-11T09:01:40+00:00

URL: https://externals.io/message/84530#84530

Hello,


I've been working with PHP for a while and it's always sad to see array()'s
performance being so terrible, in so many cases where a simple list would
have done the trick without any slowdown.

So why don't we add a basic list type to PHP ?  There's nothing to lose,
everything to gain, and it will have a fast creation time, unlike the "php
simple array" because it will just be a list.

I can take care of the programming and testing by myself if necessary.


Thanks for your time,



Ludovic

-- 
Ludovic Urbain
www.kanpeki.be

---

## #84531 — Camilo Sperberg — 2015-03-11T09:24:10+00:00

URL: https://externals.io/message/84530#84531 · In reply to: #84530

Isn’t this already implemented in the SPL library?
http://php.net/manual/en/spl.datastructures.php

--  
Met vriendelijke groet,
Camilo Sperberg
Sent with Airmail


> Hello,
>  
>  
> I've been working with PHP for a while and it's always sad to see array()'s
> performance being so terrible, in so many cases where a simple list would
> have done the trick without any slowdown.
>  
> So why don't we add a basic list type to PHP ? There's nothing to lose,
> everything to gain, and it will have a fast creation time, unlike the "php
> simple array" because it will just be a list.
>  
> I can take care of the programming and testing by myself if necessary.
>  
>  
> Thanks for your time,
>  
>  
>  
> Ludovic
>  
> --
> Ludovic Urbain
> www.kanpeki.be

---

## #84533 — Ludovic Urbain — 2015-03-11T09:45:57+00:00

URL: https://externals.io/message/84530#84533 · In reply to: #84531

That's a good question, I never tried the SPL library.

But if we're to stick to whatever information is readily available, it's
not good enough, as Spl seems to be 15-30% faster when I'm looking for 10x
faster - however I'm looking at a really specific portion of performance
which would probably be list creation (I came across the performance issue
in the benchmarks game in the binary tree program, could not come closer
than 300x times C performance, all due to array() inefficiency).

Still, it could make more sense to fix the SPL library than add yet another
one.

I will run benchmarks on it to figure out how much faster it really is,
then come back to you on that one.

Thanks.

2015-03-11 10:24 GMT+01:00 Camilo Sperberg <unreal4u@gmail.com>:

> Isn’t this already implemented in the SPL library?
> http://php.net/manual/en/spl.datastructures.php
>
> --
> Met vriendelijke groet,
> Camilo Sperberg
> Sent with Airmail
>
> 
> > […]
> array()'s
> > […]
> "php
> > […]
>
>


-- 
Ludovic Urbain
www.kanpeki.be
