ID: 37168 User updated by: dolecek at sky dot cz Reported By: dolecek at sky dot cz -Status: Feedback +Status: Open Bug Type: WDDX related Operating System: Windows, NetBSD -PHP Version: 5.1.4 +PHP Version: 5.2.1-dev New Comment:
The result with 5.2.1-dev is somewhat erratic and actually worse then before: 50: 0.0067908763885498 100: 0.013392925262451 200: 0.027522087097168 400: 0.055379152297974 800: 1.2351222038269 1600: 0.25271010398865 3200: 0.54318714141846 6400: 57.312628030777 I've run the test several times with same results. It's especially strange '800' test is consistenly so much slower then 1600 test, and this repeats on every run. Seems the Windows it is actually a lot worse with the new Windows allocator then what was there before, or perhaps the new allocator doesn't handle the realloc() calls generated by smart string macros too well. It would be interesting to try how much difference would my patch make on Windows. Previous Comments: ------------------------------------------------------------------------ [2006-11-13 21:40:55] [EMAIL PROTECTED] 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. ------------------------------------------------------------------------ [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] [EMAIL PROTECTED] 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. ------------------------------------------------------------------------ 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
