2013/6/24 Mohamed Ashraf mohamed.ashraf.213@gmail.com:
On Monday, June 24, 2013 at 4:19 PM, Dieter Adriaenssens wrote:
2013/6/22 Mohamed Ashraf mohamed.ashraf.213@gmail.com:
On Sat, Jun 22, 2013 at 10:27 AM, Rouslan Placella rouslan@placella.com wrote:
On 06/22/2013 01:21 AM, Mohamed Ashraf wrote:
On Saturday, June 22, 2013 at 12:49 AM, Rouslan Placella wrote:
On 06/16/2013 12:59 PM, Mohamed Ashraf wrote:
On Wed, Jun 12, 2013 at 9:58 AM, Rouslan Placella rouslan@placella.com wrote:
Some of my thoughts are:
- Try/catch has a performance penalty
it is not too big as can be seen here http://jsperf.com/try-catch-performance-overhead
Really? On some browsers it's about 20 times slower on the very benchmark that you are linking to!
Really!! That is strange I tested it multiple times and everytime it showed they are all equal in time. Which test case was 20 times slower?
Opera 11 would be one of them. IE 10 is also quite bad, but by a lower magnitude...
the reduction in performance is usually in wrapping the inside of a function with try and catch. I was thinking of doing the other way and wrapping the functions from outside like this
var temp = PMA_foo PMA_foo = function() { try{ temp.apply(window, arguments); } catch(e) { my_method(e); } }
I am thinking of doing this to all global functions starting with PMA_ and according to the benchmark this should have an equivalent performance to the no try catch performance. also if we don't do anything of the sort then we would never get a stacktrace.
Just wondering, if you add try-catch phrases to the current PMA_* functions, I guess they should be added to future PMA_* functions as well?
I am using javascript to wrap the code around at runtime. Any new function would be wrapped automatically if I do my job right
Sounds good! -- Kind regards,
Dieter Adriaenssens