PHP lie load iterator

I have an iterator class that iterates over an array of objects and lazily loads from the database when necessary (when it does not load into memory). The problem is that it repeats about 200,000 times, and I found out from here: http://www.garfieldtech.com/blog/magic-benchmarks that the iterator interface is incredibly slow.

Does anyone know a good way to lazy load without using an iterator interface?

+5
source share
2 answers

You can use a simple old loop for.

, 200 000 DB , . , , .

- :)

+6

for Singleton .

0

All Articles