Hi Peter, Am 16.12.2009 um 10:28 schrieb Peter Schneider:
> while I was 'cleaning up' our code base I've come along the JSON > class of > qooxdoo. > Is there any reason why it uses the evil eval() function for > evaluating and > parsing the backend responses? Wouldn't "Function" be the better > choice? Why would it? There doesn't seem to be a real difference to me (except regarding scoping, but this should be irrelevant here). > I've tried the following replacement in our application that works > quite good > (and is about 6 to 7 times faster!): Let me guess: You have Firebug enabled, right? As mentioned on this list a short while ago, Firebug can _severely_ affect JavaScript performance. For some more performance tests, take a look at this page: http://weblogs.asp.net/yuanjian/archive/2009/03/22/json-performance-comparison-of-eval-new-function-and-json.aspx The Function approach takes about the same time as the eval() call (with the exception of the Safari 4 beta where it's way slower - but I guess this is fixed in the current Safari version). Please note that the results for Firefox in the first two tables seem to indicate that Function() is way faster - but if you scroll down, there is another table with Firebug turned off, and the results are quite different! Regards, Andreas J. ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel