For a project I am working on, I have a list of words that needs to be in an array. There are a lot of words (about 20,000 split across 3 arrays). I thought it would be faster to serialize the array and store it in another file and unserialize it when I needed it. This worked, but was difficult to update. An explode is much easier to update, but is it more efficient?
…and the winner is (to my surprise) Explode.
Update: Added Memory usage.
Update 2: Added json_decode();
Explode took 1.78813934326E-5 Seconds Explode used 744 b of memory Unserialize took 0.000228881835938 Seconds Unserialize used 71.79 kb of memory JSON Decode took 0.00021505355835 Seconds JSON Decode used 76.73 kb of memory
Here is what I used to test.