Bug #75521 [Opn->Fbk]: unserialize() >3x slower

From: Date: Tue, 14 Nov 2017 19:18:19 +0000
Subject: Bug #75521 [Opn->Fbk]: unserialize() >3x slower
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212589@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75521&edit=1

 ID:                 75521
 Updated by:         ab@php.net
 Reported by:        sailormax at inbox dot lv
 Summary:            unserialize() >3x slower
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            Performance problem
 Operating System:   Windows 10
 PHP Version:        7.2.0RC6
 Block user comment: N
 Private report:     N

 New Comment:

Thanks for the report. I've tried the snippet and actually don't see any slowdown, by
numbers here using current dev trees.

7.1: 0.38896012306213
7.2: 0.31357884407043
master: 0.1246612071991

Either it's something HW or environment specific :/ Perhaps you could check with the current
snapshots, it could be that something has changed since last RCs. Also be sure the builds you use
are of same bitness and thread safety.

Thanks.


Previous Comments:
------------------------------------------------------------------------
[2017-11-14 08:14:54] sailormax at inbox dot lv

Description:
------------
Difference in speed between 7.1 and 7.2 of unserialize() = >3x
In my test 0.8s vs 0.28s on my PC

Test script:
---------------
$structure = array(
		0,
		true,
		"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
cccccccccccccccccccccccccccccccc ddddddddddddddddddddddddddddddd",
		[1, 2, 3, "aaaaaaaaaaaaaaaaabbbbbbbbbbbbbbccccccccccccccccccccccccc", false]
		);
$encoded = serialize($structure);
$ts = microtime(true);
for ($i=0; $i<100000; $i++)
	$structure = unserialize($encoded);
print (microtime(true) - $ts);



Expected result:
----------------
similar to results of PHP 7.1

Actual result:
--------------
slower >3x


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=75521&edit=1


Thread (10 messages)

« previous php.bugs (#212589) next »