Changeset 30042 in webkit


Ignore:
Timestamp:
Feb 6, 2008 9:53:53 AM (16 years ago)
Author:
ggaren@apple.com
Message:

Reviewed by Darin Adler.

PLT speedup related to <rdar://problem/5659272> REGRESSION: PLT .4%
slower due to r28884 (global variable symbol table optimization)


Tweaked RefCounted::deref() to be a little more efficient.

1% - 1.5% speedup on my machine. .7% speedup on Stephanie's machine.


  • wtf/RefCounted.h: (WTF::RefCounted::deref): Don't modify m_refCount if we're just going to delete the object anyway. Also, use a simple == test, which might be faster than <= on some hardware.
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r30041 r30042  
     12008-02-06  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        PLT speedup related to <rdar://problem/5659272> REGRESSION: PLT .4%
     6        slower due to r28884 (global variable symbol table optimization)
     7       
     8        Tweaked RefCounted::deref() to be a little more efficient.
     9
     10        1% - 1.5% speedup on my machine. .7% speedup on Stephanie's machine.
     11       
     12        * wtf/RefCounted.h:
     13        (WTF::RefCounted::deref): Don't modify m_refCount if we're just going
     14        to delete the object anyway. Also, use a simple == test, which might be
     15        faster than <= on some hardware.
     16
    1172008-02-06  Darin Adler  <darin@apple.com>
    218
  • trunk/JavaScriptCore/wtf/RefCounted.h

    r29470 r30042  
    4646    {
    4747        ASSERT(!m_deletionHasBegun);
    48         if (--m_refCount <= 0) {
     48        if (m_refCount == 1) {
    4949#ifndef NDEBUG
    5050            m_deletionHasBegun = true;
    5151#endif
    5252            delete static_cast<T*>(this);
    53         }
     53        } else
     54            --m_refCount;
    5455    }
    5556
Note: See TracChangeset for help on using the changeset viewer.