On Tue, Nov 4, 2008 at 5:58 PM, Ariel Flesler <[EMAIL PROTECTED]> wrote:
> > P.S: I knew you'd be throwin' in your super revolutionary version of > it.. so predictable :-P :D mine was just a suggestion. Clever or recent browsers cast as constant the regexp, but to be sure it happens everywhere, you can "force" in that way. My point is that I still cannot believe a runtime code works faster than a regexp that should perform exactly the same in core. This could depend on regexp engine, but we are still talking about compiled C against runtime interpretated code (unless we are not under V8, TraceMonkey, or SquirrelFish Extreme) In any case, I tested the same over this string: Array(1000).join(" test ") and you are right, your performs in a reasonable time, while the RegExp, casted or not, asks me to stop the script execution. This is hilarius to me, and I can think about a regexp engine problem more than a bad practice, so I guess your porposal makes sense enough, since it is a must for big strings, a little bit slower for small strings. Cheers --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---