Thanks. But we can do better still:
  1. it seems that the slow part for trimming is trimming
     spaces at the *end* which is rather irrelevant here.
  2. in fact, we don't need _any_ trimming here, we could
     just have a reg exp that matches the begging and 
     ignores leading spaces.

Of course, (2) is more work/code than (1). I'll give them
a try and report back.


On Sat, 2009-01-31 at 04:08 -0800, Ariel Flesler wrote:
> http://dev.jquery.com/ticket/2279#comment:7
> 
> --
> Ariel Flesler
> http://flesler.blogspot.com
> 
> On 30 ene, 22:02, dimi <[email protected]> wrote:
> > Hi folks,
> >
> > I have a large HTML fragment that I load via AJAX. The fragment is big
> > (~660KB),
> > and it takes over 2s (more like 2.7s) to insert it.
> >
> > I've profiled the code, and it turns out that most of the time is
> > spent in the .trim()
> > function. It is being called from .clean() (around line 835):
> >
> >                                 // Trim whitespace, otherwise indexOf won't 
> > work as expected
> >                                 var tags = jQuery.trim( elem 
> > ).toLowerCase();
> >
> > Is this something that can be fixed?
> >
> > Dimi.
> -- 
Dimi Paun <[email protected]>
Lattica, Inc.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" 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/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to