Please upload and run the attached script. What it does: make a bunch of junk data in an array, shift it like a queue (drop first element and add one on the end), then test serializing and unserializing times.
Output should be like:
Code:
Making junk data...Done (8.9 msec so far; array has 100 elements)
Moving queue on junk data by one element...Done (9.2 msec so far; array has 100 elements)
Serializing...Done (9.6 msec so far; serialized data is 2282 chars)
Unserializing...Done
Finished in 9.9 msec
Side note: you wouldn't believe how insanely fast unserialize() is compared to serialize()...an array with 50,000 elements took a couple seconds to serialize but around 4 milliseonds to unserialize.
Making junk data...Done (20 msec so far; array has 100 elements)
Moving queue on junk data by one element...Done (20.4 msec so far; array has 100 elements)
Serializing...Done (20.9 msec so far; serialized data is 2282 chars)
Unserializing...Done
Finished in 21.2 msec
Today at 08:26 AM Mist said this in Post #6 How does it work then?
It'll store the last 100 activity timestamps, shifting them like a queue. To simply the database, it'll just be one column but will contain serialized data (an array with the 100 elements). Trying to get it down to one query, though, and I don't know how.
Making junk data...Done (24.7 msec so far; array has 100 elements)Moving queue on junk data by one element...Done (70.2 msec so far; array has 100 elements)Serializing...Done (120.9 msec so far; serialized data is 2282 chars)Unserializing...DoneFinished in 121 msec