Kurt George Gjerde wrote:
Hi,
Thanks for replying. I did some benchmarks today. Staggering.
Indeed.
[...]
I then added localtime() to STDERR to see if that could slow it down a bit:
timethese(2000, {
'log_error' => sub { $r->log_error("benchmarking log_error") },
'STDERR'=> sub { p
Hi,
Thanks for replying. I did some benchmarks today. Staggering.
B1:
timethese(2000, {
'log_error' => sub { $r->log_error("benchmarking log_error") },
'STDERR'=> sub { print STDERR "benchmarking log_error\n" },
});
Result:
Benchmark: timing 2000 iterations of STDERR, log_error.
Kurt George Gjerde wrote:
Hi,
Are there any reasons why
$r->log_error($msg)
is (much) slower than
print STDERR '['.scalar(localtime()).'] [error] '.$msg."\n"
?
Both are producing the same output (except that the latter goes to the
main error_log, and the former to the virtual host error log).