rfc:error-optimizations
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:error-optimizations [2010/08/23 20:19] – kalle | rfc:error-optimizations [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2010-08-21 | * Date: 2010-08-21 | ||
* Author: Kalle Sommer Nielsen < | * Author: Kalle Sommer Nielsen < | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
Line 22: | Line 22: | ||
zend_error_arguments error_stack[]; | zend_error_arguments error_stack[]; | ||
int error_stack_size: | int error_stack_size: | ||
+ | ... | ||
</ | </ | ||
Line 50: | Line 51: | ||
zend_error_arguments arguments; | zend_error_arguments arguments; | ||
- | ... | + | /* put the data into the arguments structure */ |
if (EG(error_stack_enabled) && EG(error_stack_logging)) { | if (EG(error_stack_enabled) && EG(error_stack_logging)) { | ||
Line 57: | Line 58: | ||
if (EG(error_stack_logging)) { | if (EG(error_stack_logging)) { | ||
/* dispatch to error logging hook */ | /* dispatch to error logging hook */ | ||
+ | } else { | ||
+ | /* no logging, increase the stack size */ | ||
+ | |||
+ | ++EG(error_stack_size); | ||
} | } | ||
} else { | } else { | ||
- | | + | |
} | } | ||
</ | </ | ||
Line 69: | Line 74: | ||
<code c> | <code c> | ||
if (EG(error_stack_enabled) && EG(error_stack_size)) { | if (EG(error_stack_enabled) && EG(error_stack_size)) { | ||
- | char *error; | + | char *error |
+ | int error_length; | ||
- | /* Dispatch | + | /* dispatch |
+ | /* NOTE: This is just a pseudo function name for formatting */ | ||
+ | zend_format_error_arguments(& | ||
- | | + | |
} else { | } else { | ||
- | | + | |
} | } | ||
</ | </ | ||
+ | |||
+ | ==== $php_errormsg ==== | ||
+ | |||
+ | This one is a tricky one, as we do not have any hooks for altering variables at reading, nor do we have JIT assignments. I think the best solution here is to simply remove $php_errormsg and require userland to use error_get_last() if they *REALLY* want the last errors, without depending on the track_errors ini options to be on. | ||
+ | |||
+ | If its not removed, then we cannot gain any optimization with track_errors = On at all, so if thats the case, it has to be taken into account when initializing the error_stack executor globals. | ||
==== Memory usage ==== | ==== Memory usage ==== | ||
Line 83: | Line 97: | ||
Obvious the memory usage here can grow quite rapidly, but people who would use this feature already takes great care of their code to not assume the opposite. | Obvious the memory usage here can grow quite rapidly, but people who would use this feature already takes great care of their code to not assume the opposite. | ||
- | ===== Notes ===== | + | ==== ZTS performance |
- | * This is a very early WIP, the idea may change, or render obsolete | + | Since the error stack is hooked into the executor globals, which requires tsrm_ls to be available |
rfc/error-optimizations.1282594746.txt.gz · Last modified: 2017/09/22 13:28 (external edit)