Changeset 201784 in webkit
- Timestamp:
- Jun 7, 2016 6:53:44 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r201782 r201784 1 2016-06-07 Andreas Kling <akling@apple.com> 2 3 CachedScript should avoid recomputing its hash multiple times. 4 <https://webkit.org/b/158506> 5 6 Reviewed by Saam Barati. 7 8 JSBench was hitting CachedScript::script() hard and spending lots of time hashing scripts. 9 Since we're already caching the hash in a member variable, don't bother rehashing if we've 10 already done it before. 11 12 This takes total time spent in StringImpl::hashSlowCase() from 1600ms to 77ms on my MBP. 13 14 * loader/cache/CachedScript.cpp: 15 (WebCore::CachedScript::script): 16 1 17 2016-06-07 Keith Rollin <krollin@apple.com> 2 18 -
trunk/Source/WebCore/loader/cache/CachedScript.cpp
r197628 r201784 94 94 if (!m_script) { 95 95 m_script = m_decoder->decodeAndFlush(m_data->data(), encodedSize()); 96 m_scriptHash = m_script.impl()->hash(); 96 ASSERT(!m_scriptHash || m_scriptHash == m_script.impl()->hash()); 97 if (m_decodingState == NeverDecoded) 98 m_scriptHash = m_script.impl()->hash(); 97 99 m_decodingState = DataAndDecodedStringHaveDifferentBytes; 98 100 setDecodedSize(m_script.sizeInBytes());
Note: See TracChangeset
for help on using the changeset viewer.