[prev in list] [next in list] [prev in thread] [next in thread]
List: asterisk-dev
Subject: [asterisk-dev] performance of DONT_OPTIMIZE
From: Tzafrir Cohen <tzafrir.cohen () xorcom ! com>
Date: 2013-11-27 19:41:27
Message-ID: 20131127194127.GC2392 () xorcom ! com
[Download RAW message or body]
Hi
https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace reads:
| Running a production server with DONT_OPTIMIZE is generally safe. You'll
| notice the binary files may be a bit larger, but in terms of Asterisk
| performance, impact should be negligible.
The effect of DONT_OPTIMIZE is setting the optimization build flag to
-O0 (rather than -O6).
As a side note, recent versions of gcc (4.8) have -Og:
| Optimize debugging experience. -Og enables optimizations that do not
| interfere with debugging. It should be the optimization level of choice
| for the standard edit-compile-debug cycle, offering a reasonable level
| of optimization while maintaining fast compilation and a good debugging
| experience.
It would probably be better than -O0, if available (thanks ot Tim_Today
on #asterisk-dev).
Common wisdom is that optimization level does impact performance.
Consider the following (pathalogical, though) example:
$ cat /tmp/test.c
int main() {
int i;
for(i=1; i<100000000; i++)
;
return 0;
}
$ gcc -O0 /tmp/test.c -o /tmp/test; time /tmp/test
real 0m0.214s
user 0m0.212s
sys 0m0.000s
$ gcc -O2 /tmp/test.c -o /tmp/test; time /tmp/test
real 0m0.001s
user 0m0.000s
sys 0m0.000s
The unoptimized version would have indeed preserved the code. But I want
the compiler to provide me with better performance.
A simple artificial test shows a noticable (-40% or so) performance
penalty on the following loop:
exten => time,n,Set(i=100000)
exten => time,n,While($[${i} > 0])
exten => time,n,Set(i=$[${i} - 1])
exten => time,n,EndWhile
So I wonder if Asterisk's performance is that much not CPU bound that
the effect of a similar penalty will be negligible. Any numbers?
--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen@xorcom.com
+972-50-7952406 mailto:tzafrir.cohen@xorcom.com
http://www.xorcom.com
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic