Skip to main content

Bug Tracker

Side navigation

#6868 closed bug (fixed)

Opened August 04, 2010 04:22AM UTC

Closed September 30, 2010 12:41AM UTC

Last modified November 12, 2010 01:14AM UTC

$.trim very expensive on long strings

Reported by: kemayo Owned by:
Priority: undecided Milestone: 1.4.3
Component: unfiled Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:
Description

I ran $.trim on a ~17kB string, and it caused my browser to ask me if I wanted to stop an unresponsive script.

Attachments (0)
Change History (3)

Changed September 08, 2010 01:41PM UTC by dfens comment:1

<html>
  <head>
  <script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
    <script>
$(document).ready(function() {
  var txt = "   ";
  for (var i =0; i <1700;i++)
  txt+="1234567890";
  $.trim(txt);
  txt += "                          ";
  $(".inner").text(txt);
  alert('done');
});
    </script>
  </head>
  <body>

  <div class="inner">
Hello

</div>
 
  </body>
</html>

works fine

Changed September 30, 2010 12:41AM UTC by dmethvin comment:2

priority: → undecided
resolution: → fixed
status: newclosed

Changed November 12, 2010 01:14AM UTC by dmethvin comment:3

#7477 is a duplicate of this ticket.