On Sunday 07 June 2009 15:49:31 Iceberg wrote: > On Jun7, 6:35pm, Alexey Nezhdanov <[email protected]> wrote: > > > 2) is_integer is a fast call, but with 1.1k (!) calls ... > > > > Replaced it with my own version: > > integer_pat=re.compile('[0-9]+$') > > is_integer=lambda x: integer_pat.match(x) > > it's about 2.3 times faster. C version would be even better. > > If so, perhaps this is even better: > > integer_pat=re.compile('[0-9]+$') > is_integer=integer_pat.match OH! You win almost 1.5 times. 2.340s vs mine 0m3.328s for 20k operations.
> Because lambda is considered as much slower than built-in functions, > AFAIK. -- Sincerely yours Alexey Nezhdanov --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

