From: Dr J R Stockton on 4 Aug 2010 15:41 In comp.lang.javascript message <0df43f3b-dfc9-41a7-9e42-bf85f31ff2f6(a)t2 0g2000yqa.googlegroups.com>, Tue, 3 Aug 2010 02:00:48, Asen Bozhilov <asen.bozhilov(a)gmail.com> posted: > I am just using mathematical operation plus `replace' which I >suppose is faster than than version used by FAQ. You can easily test that using a * * COPY * * of <URL:http://www.merlyn.demon.co.uk/js-quick.htm>. 'Press' Demo 6 times, edit in your functions and their calls, press Eval. Repeat increasing K_ and pressing Eval until you get reasonable times below the buttons. In Firefox 3.0.19, WinXP sp3 P4/3GHz, K_ = 15000, I get 0,11,140,276 and similar - the FAQ is a little over twice as fast. Chrome 5.0, 0,10,34,59. Safari 5.0, 0,1,37,59. Opera 10.10, 0,0,140,422. But IE8, 0,0,344,297 - perhaps MS are comparatively good at RegExps. The FAQ does need good, realistic examples of RegExps, though. -- (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05. Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.
|
Pages: 1 Prev: XY graph Next: FAQ Topic - When should I use eval? (2010-08-05) |