stas Mon Dec 4 18:35:43 2006 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/standard basic_functions.c string.c
Log:
Improve tolower()-related functions on Windows and VC2005 by caching locale
and using
tolower_l function.
# Gives 10-18% speedup on bench.php
# Does not change behaviour for non-windows
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.725.2.31.2.31&r2=1.725.2.31.2.32&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.725.2.31.2.31
php-src/ext/standard/basic_functions.c:1.725.2.31.2.32
--- php-src/ext/standard/basic_functions.c:1.725.2.31.2.31 Sun Nov 26
17:02:13 2006
+++ php-src/ext/standard/basic_functions.c Mon Dec 4 18:35:42 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.725.2.31.2.31 2006/11/26 17:02:13 iliaa Exp $ */
+/* $Id: basic_functions.c,v 1.725.2.31.2.32 2006/12/04 18:35:42 stas Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -4157,6 +4157,7 @@
if (BG(locale_string) != NULL) {
setlocale(LC_ALL, "C");
setlocale(LC_CTYPE, "");
+ zend_update_current_locale();
}
STR_FREE(BG(locale_string));
BG(locale_string) = NULL;
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.29&r2=1.445.2.14.2.30&diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.445.2.14.2.29
php-src/ext/standard/string.c:1.445.2.14.2.30
--- php-src/ext/standard/string.c:1.445.2.14.2.29 Fri Nov 24 21:59:09 2006
+++ php-src/ext/standard/string.c Mon Dec 4 18:35:42 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.445.2.14.2.29 2006/11/24 21:59:09 tony2001 Exp $ */
+/* $Id: string.c,v 1.445.2.14.2.30 2006/12/04 18:35:42 stas Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -3971,6 +3971,7 @@
}
retval = setlocale (cat, loc);
+ zend_update_current_locale();
if (retval) {
/* Remember if locale was changed */
if (loc) {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php