Bug #70490 [Opn]: get_browser function is very slow

From: Date: Sat, 19 Sep 2015 09:21:01 +0000
Subject: Bug #70490 [Opn]: get_browser function is very slow
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196085@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70490&edit=1 ID: 70490 Updated by: yohgaki@php.net Reported by: webtech at mines-telecom dot fr Summary: get_browser function is very slow Status: Open Type: Bug Package: Performance problem Operating System: OS X 10.10.5 PHP Version: 7.0.0RC2 Block user comment: N Private report: N New Comment: I think you are using large browscap.ini. Although browscap.ini is cached in memory, the code searching matched entry is not so fast. If database is large, it takes time. (About 2 sec with debug build CLI server & Core i7 4770S using full_php_browscap.ini) http://browscap.org/ Try lite_php_browscap.ini if you need performance. Previous Comments: ------------------------------------------------------------------------ [2015-09-14 13:08:41] webtech at mines-telecom dot fr I've added the version number of OS X. ------------------------------------------------------------------------ [2015-09-14 13:06:55] 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70490&edit=1

« previous php.bugs (#196085) next »