#10 ✓ resolved
Flavio

[Dup Trac #9466] IE6 Leak/degrade

Reported by Flavio | April 14th, 2008 @ 05:07 PM | in 1.6.0.3

Greetings,

I think I found a leak which degrades performance on IE6. The flaw does not show up neither in Firefox nor in IE7. Here is a sample page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta http-equiv="refresh" content="1;url="/> 
    <title>LeakTest</title>
    <script type="text/javascript" src="http://prototypejs.org/assets/20..."></script>
  </head>
  <body>
    <form>
      <div id="divId" style="width:10em">Test</div>
      <input name="test" value="1"/><input name="test" value="1"/><input name="test" value="1"/><br/>
      <input name="test" value="1"/><input name="test" value="1"/><input name="test" value="1"/><br/>
      <input name="test" value="1"/><input name="test" value="1"/><input name="test" value="1"/><br/>
      <input name="test" value="1"/><input name="test" value="1"/><input name="test" value="1"/><br/>
      <input name="test" value="1"/><input name="test" value="1"/><input name="test" value="1"/><br/>
      <input name="test" value="1"/><input name="test" value="1"/><input name="test" value="1"/><br/>
      <input name="test" value="1"/><input name="test" value="1"/><input name="test" value="1"/><br/>
      <input name="test" value="1"/><input name="test" value="1"/><input name="test" value="1"/><br/>
      <input name="test" value="1"/><input name="test" value="1"/><input name="test" value="1"/><br/>
      <input name="test" value="1"/><input name="test" value="1"/><input name="test" value="1"/><br/>
      <input id="time" value="" style="border: 1px solid"/>
    </form>
    
    <script type="text/javascript">
      function c(event) {
        alert('Hello');
      }

      $('divId').observe('click', c);
      
      t = new Date().getTime();
      $$('input').invoke('disable');
      t = new Date().getTime() - t;
      
      $('time').value = t;
    </script>
  </body>
</html>

The mass disable is just to show the performance degrade: every time the page reloads, the time needed to disable the inputs goes up and up. The problem is caused by the observe function; removing it, or calling *stopObserving*, would fix it.

Notice also that there is no leak in prototype 1.5.1.2: it leaks only in 1.6.0 and 1.6.0.2.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

The Prototype JavaScript library.

Shared Ticket Bins

Attachments

Pages