serialize() vs. var_export() vs. json_encode() Memory Usage

Permanent Link: serialize() vs. var_export() vs. json_encode() Memory Usage 18. November 2009 RSS Feed for comments on RSS-Feed für Kommentare zu: serialize() vs. var_export() vs. json_encode() Memory Usage comments feed

Based on serialize() vs. var_export() vs. json_encode() Part 2, let's take a look at the (real) memory usage:

Apart from var_export allo methods seem to use about the same. Let's put the usage in relation to each other to get a better view:

With smaller arrays, the memory usage is exactly the same, from 10.000 elements on the values begin to diverge.

3 comments

Slawas Gravatar

Slawa
30.11.2009, 02:33 o'clock

Amazing posts, all three of them. Really helpful in my project.

Brians Gravatar

Brian
04.12.2009, 18:31 o'clock

Thank you for this array of posts and nice graphs. It's nice to have some hard numbers. I assume that all three were done with the same version of php is that correct?

- Brian

Dominik Jungowskis Gravatar

Dominik Jungowski
05.12.2009, 17:15 o'clock

That is correct. All with the same PHP Version (5.2.6) on the same machine (Dell E6400)

Write a comment

(will not be published)