Post count fever

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Post count fever
« Reply #105, on April 6th, 2011, 08:05 PM »
Quote from Dragooon on April 6th, 2011, 08:02 PM
In my tests serializing/unserializing a 1.5MB array was as fast as including a file with that array, which was much faster than JSON..for some surprising reason.
What version of PHP was that? What was the source data?

I benchmarked it a bit back and found that it was fastest to json_decode the array but the entire array was nested arrays of numbers, and we're talking a 26k string when JSON encoded. (Remember, for the majority of the time, the hurt of serialize isn't an issue, it's the hurt of json_decode vs unserialize vs raw array that we're interested in)
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841
Re: Post count fever
« Reply #106, on April 6th, 2011, 08:09 PM »
Quote from Arantor on April 6th, 2011, 08:05 PM
Quote from Dragooon on April 6th, 2011, 08:02 PM
In my tests serializing/unserializing a 1.5MB array was as fast as including a file with that array, which was much faster than JSON..for some surprising reason.
What version of PHP was that? What was the source data?

I benchmarked it a bit back and found that it was fastest to json_decode the array but the entire array was nested arrays of numbers, and we're talking a 26k string when JSON encoded. (Remember, for the majority of the time, the hurt of serialize isn't an issue, it's the hurt of json_decode vs unserialize vs raw array that we're interested in).
It was PHP 5.3.2 and the source data was actually a 2.7MB array containing information about 630 vbulletin forums along with permission combinations for each of 103 groups of every forum. include and serialize was about the same at 0.35 seconds whereas json was about at 0.4-0.5. Apparently they can be faster than each other depending upon the size and type of data.
The way it's meant to be

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Post count fever
« Reply #107, on April 6th, 2011, 08:16 PM »
Yup, textual content is processed slower than numeric content in the JSON functions from everything I've seen.

Would still be interested to know how unserialize and json_decode performed rather than serialize and json_encode; I spend less time writing that data than I do reading it, invariably.

Nao

  • Dadman with a boy
  • Posts: 16,082

Masterd

  • We came to an (W)edge, now it's time to get over the hedge.
  • Posts: 50
Re: Post count fever
« Reply #109, on April 10th, 2011, 05:35 PM »
If you want ot be the best, you need to try first.

DoctorMalboro

  • I like rounded borders.
  • Posts: 316
Re: Post count fever
« Reply #110, on April 10th, 2011, 10:33 PM »
No one can try to be like me? I have like Adonis DNA and tiger blood in me!

Masterd

  • We came to an (W)edge, now it's time to get over the hedge.
  • Posts: 50
Re: Post count fever
« Reply #111, on April 13th, 2011, 10:06 PM »
Post count on this site is really growing bigger and bigger.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Post count fever
« Reply #112, on April 13th, 2011, 10:49 PM »
I think it's related to the fact that there are new posts being sent! But it warrants further research...

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Post count fever
« Reply #113, on April 13th, 2011, 10:53 PM »
Yeah, we let a couple of hardcore spammers here...

DoctorMalboro

  • I like rounded borders.
  • Posts: 316
Re: Post count fever
« Reply #114, on April 13th, 2011, 11:51 PM »
Like me? :sob: :sob:


 :eheh:

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Post count fever
« Reply #115, on April 14th, 2011, 09:01 AM »
Pete opened Pandora's box in the first place... Anyone posted over there is a spammer anyway. :niark:

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Post count fever
« Reply #117, on April 14th, 2011, 10:24 AM »
Spam is acceptable as long as it's manageable... (e.g. it stays in a couple of spam topics, things like that.)
But overall it's not really something I condone.

DoctorMalboro

  • I like rounded borders.
  • Posts: 316
Re: Post count fever
« Reply #118, on April 14th, 2011, 01:21 PM »
This is friendly spam, not the kind of retarded forum spam...

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278