PDA

View Full Version : Little Help


filburt1
06-17-2003, 11:31 PM
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:

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

filburt1
06-17-2003, 11:43 PM
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.

Dpcows
06-18-2003, 04:47 AM
And the use of this is ?

Dean C
06-18-2003, 09:53 AM
For one of filby's top secret projects... :x

filburt1
06-18-2003, 10:28 AM
A hack to automatically ban suspiciously active users (free).

Dean C
06-18-2003, 11:26 AM
How does it work then?

Chris M
06-18-2003, 11:53 AM
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

:)

Satan

filburt1
06-18-2003, 12:00 PM
Today at 08:26 AM Mist said this in Post #6 (https://vborg.vbsupport.ru/showthread.php?postid=410285#post410285)
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.

assassingod
06-18-2003, 01:53 PM
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

filburt1
06-18-2003, 01:54 PM
Yeesh that's slow...is that your actual server or a test server?

assassingod
06-18-2003, 01:59 PM
test server.:)