|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-09-14 13:06 UTC] webtech at mines-telecom dot fr
Description: ------------ $aBrowserInfos=get_browser(null,true); Test script: --------------- $time_start = microtime(true); $aBrowserInfos=get_browser(null,true); $time_end = microtime(true); $time = $time_end - $time_start; echo "get_browser takes $time sec"; Expected result: ---------------- Less than 50 ms... Actual result: -------------- get_browser takes 3.3583149909973 sec PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 04:00:02 2025 UTC |
Hello there, I detected the get_browser command as the lack of performance on my website today. Then I've found this bug here. Could you please implement a hashmap or something similar for that command? I cannot believe that searching through an ini file needs so much time. You could for example split the search up and delegate it to multiple threads. Here is my example: <?php $dTime1 = microtime(true); $oBrowser = get_browser('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0'); $dTime2 = microtime(true); $oBrowser2 = get_browser('DoesntExist'); $dTime3 = microtime(true); echo sprintf('%.4f', $dTime2 - $dTime1), "<br>"; echo sprintf('%.4f', $dTime3 - $dTime2), "<br>"; ?> Searching for a non-existent entry still requires so much time like the regular search (> 1 second). Kind Regards David Gausmann