GetDotted Domains

Viewing Thread:
"PHP array sort times."

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Tue 27/09/05 at 01:21
Regular
"Pouch Ape"
Posts: 14,499
Quick question: Lately I've been working with PHP arrays for sorting data - it's perfect for small shops and other things that need listing without the client forking out for SQL. My question is, are there any benchmark tests for PHP array sorting versus SQL? I read somewhere on the PHP.net site that they're pretty much equal up to about 80,000 records, and what I've been using them for is much, much less (one site has about 300 properties - the listings load instantly, even on 56k).

So yeah, PHP versus SQL in the array sorting department - do they work on a similar technology/principle? How soon before my property site starts clogging up?

Cheers!

EDIT: Oh, I forgot to add that obviously these are flat-file systems, there is no 'database' as such, more of a dataset of folders that correspond to fields. The PHP array sorting times takes into account loading all the data from a 'field', then sorting that for the desired listing type. I can provide code examples if need be.
Tue 27/09/05 at 18:32
Regular
"Pouch Ape"
Posts: 14,499
Hmm, well I've only got to use it for simple preg_match searches, as well as general listings, so all is cool. I'm quite chuffed actually, it's a really neat little system, and I worked it out all by myself. Hurrah!
Tue 27/09/05 at 16:48
Regular
"Devil in disguise"
Posts: 3,151
monkey_man wrote:
> So yeah, PHP versus SQL in the array sorting department - do they
> work on a similar technology/principle? How soon before my property
> site starts clogging up?
>

Probably never. You're much more likely to start hitting other limitations before speed becomes an issue. Some years back before PHP and MySQL came into the mainstream, I worked on a property website. It was CGI(Perl), it used flatfiles and of course the server was much slower than anything around these days. It had several thousand properties on it and ran fine. We switched it to a DB eventually but only because we wanted to do some data manipulation & searching that wasnt practical with flatfiles.
The fact of the matter is, things like MySQL have become mainstream not because they are faster or better but rather because languages like PHP have supported them so well and thus made them incredibly easy to use. If you know how to create/use a DB, its simply less code to make use of it than to use flatfiles now. But unless you move to large datasets (where a DB's indexing will make selecting faster) or need to do complex querying (joins etc.), you'll often find flatfiles faster.
Tue 27/09/05 at 01:21
Regular
"Pouch Ape"
Posts: 14,499
Quick question: Lately I've been working with PHP arrays for sorting data - it's perfect for small shops and other things that need listing without the client forking out for SQL. My question is, are there any benchmark tests for PHP array sorting versus SQL? I read somewhere on the PHP.net site that they're pretty much equal up to about 80,000 records, and what I've been using them for is much, much less (one site has about 300 properties - the listings load instantly, even on 56k).

So yeah, PHP versus SQL in the array sorting department - do they work on a similar technology/principle? How soon before my property site starts clogging up?

Cheers!

EDIT: Oh, I forgot to add that obviously these are flat-file systems, there is no 'database' as such, more of a dataset of folders that correspond to fields. The PHP array sorting times takes into account loading all the data from a 'field', then sorting that for the desired listing type. I can provide code examples if need be.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Thank you very much for your help!
Top service for free - excellent - thank you very much for your help.
First Class!
I feel that your service on this occasion was absolutely first class - a model of excellence. After this, I hope to stay with Freeola for a long time!

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.