Opened 13 years ago

Closed 13 years ago

#400 closed defect (fixed)

error.php is slow

Reported by: dmorton Owned by: dmorton
Priority: high Milestone: 1.0.3
Component: PHP scripts Version: 1.0.2 Devel
Severity: major Keywords:
Cc:

Description

I started doing some php profiling, and discovered up to half of the time

during a page load is spent inside userErrorHandler and especially recomputing a date() which may or may not be used.

        Real         User        System             secs/    cumm
%Time (excl/cumm)  (excl/cumm)  (excl/cumm) Calls    call    s/call
Memory Usage Name
--
48.0 0.10 0.10  0.09 0.09  0.01 0.01   171  0.0000   0.0000            0
date
6.0 0.02 0.02  0.01 0.01  0.00 0.00    12  0.0000   0.0000            0
sizeof
6.0 0.01 0.01  0.01 0.01  0.00 0.00    93  0.0000   0.0000            0
define
6.0 0.01 0.01  0.01 0.01  0.00 0.00     6  0.0000   0.0000            0
defined
4.0 0.00 0.00  0.01 0.01  0.00 0.00     8  0.0000   0.0000            0
mysql_real_escape_string
2.0 0.00 0.00  0.00 0.00  0.00 0.00    13  0.0000   0.0000            0
mysql_select_db
2.0 0.00 0.00  0.00 0.00  0.00 0.00    48  0.0000   0.0000            0
ThemeSmarty->assign
2.0 0.00 0.00  0.00 0.00  0.00 0.00    12  0.0000   0.0000            0
DB_result->DB_result
2.0 0.02 0.02  0.00 0.00  0.00 0.00     4  0.0000   0.0000            0
array_merge
2.0 0.00 0.00  0.00 0.00  0.00 0.00    50  0.0000   0.0000            0
is_array
2.0 0.00 0.00  0.00 0.00  0.00 0.00     8  0.0000   0.0000            0
preg_split
2.0 0.01 0.11  0.00 0.09  0.00 0.01   171  0.0000   0.0000            0
userErrorHandler

As near as I can tell, the only reason for this function is to make PHP notices and debug statements available to the pear logger object, so we can for instance do an html popup to catch the error. nice maybe for development and testing, but completely unneeded in production.

Unless there are any objections, I'm just going to remove error.php and all references to it. PHP errors are normally sent to a log file anyway.

Change History (2)

comment:1 Changed 13 years ago by dmorton

  • Resolution set to fixed
  • Status changed from new to closed

The problem is php5 E_STRICT warnings from the PEAR, PEAR_DB, and Smarty

libs. the custom error handler gets called for all of them. There is no way to resolve this, as php4 and php5 have incompatible syntax at the STRICT level.

In [1161] I made the default to not include error.php, but it can be turned on with a config item in config.php.

comment:2 Changed 13 years ago by anonymous

PHP 5.1.3 removed the E_STRICT deprecation notice from "var". This

takes care of the warnings from smarty, but we still have other errors from pear and pear_db

Note: See TracTickets for help on using tickets.