#37168 [Opn->Fbk]: WDDX serializer inefficient with larger structures
| From: | iliaa@php.net | Date: | Mon, 13 Nov 2006 21:40:56 +0000 |
| Subject: | #37168 [Opn->Fbk]: WDDX serializer inefficient with larger structures | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-104931@lists.php.net to get a copy of this message | ||
ID: 37168
Updated by: iliaa@php.net
Reported By: dolecek at sky dot cz
-Status: Open
+Status: Feedback
Bug Type: WDDX related
Operating System: Windows, NetBSD
PHP Version: 5.1.4
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
There have been major changes in the memory allocator for
Win32 which should help with the performance.
Previous Comments:
------------------------------------------------------------------------
[2006-05-27 09:28:06] dolecek at sky dot cz
I figured I used a malloc() debug option when I run the test on NetBSD
(/etc/malloc.conf -> 'J'), which caused each realloc() call to
explicitly malloc() new piece of memory and free the old. With that
disabled, the WDDX serializer result is much better on NetBSD (this is
without the patch, run with PHP 5.1.4) and actually can complete the
benchmark:
wddx_serialize_value() (without /etc/malloc.conf -> J):
0050: 0.0027
0100: 0.0058
0200: 0.0152
0400: 0.0724
0800: 0.3820
1600: 1.6633
3200: 6.9623
6400: 28.6273
For comparison, this is result with standard serialize():
0050: 0.0016
0100: 0.0032
0200: 0.0092
0400: 0.0275
0800: 0.1174
1600: 0.5613
3200: 2.3775
6400: 9.8372
So, the WDDX serializer still shows strong non-linear behaviour.
wddx_serialize_value() with patch (and without /etc/malloc.conf->J):
0050: 0.0026
0100: 0.0048
0200: 0.0104
0400: 0.0227
0800: 0.0476
1600: 0.0933
3200: 0.1914
6400: 0.3859
serialize() result after applying similar patch to ext/standard/var.c:
0050: 0.0015
0100: 0.0028
0200: 0.0061
0400: 0.0151
0800: 0.0320
1600: 0.0670
3200: 0.1374
6400: 0.2744
------------------------------------------------------------------------
[2006-05-23 22:07:24] dolecek at sky dot cz
Changing the OS to Windows, NetBSD.
------------------------------------------------------------------------
[2006-05-02 19:33:16] dolecek at sky dot cz
Fine, the difference is entirely dependant on platform realloc()
implementation. Anyone can try the patch on MS Windows? I don't have
native compiler there. Thanks.
------------------------------------------------------------------------
[2006-05-02 13:36:00] iliaa@php.net
I tried your patch on linux 2.6 and MacOSX 10.3.4 and in both
cases had no visible difference (beyond the margin of error)
in terms of speed and time taken to execute the code.
------------------------------------------------------------------------
[2006-04-23 21:32:41] dolecek at sky dot cz
Also, it would be useful to know if my patch improves performance on
your system (even though the time increase is linear even without my
patch on your system). Could you include results without and with patch
on your system, please?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/37168
--
Edit this bug report at http://bugs.php.net/?id=37168&edit=1