Bug 128995

Summary: Use std::swap() in HashTable::swap()
Product: WebKit Reporter: Zan Dobersek <zan>
Component: New BugsAssignee: Zan Dobersek <zan>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cmarcelo, commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Zan Dobersek 2014-02-18 14:04:55 PST
Use std::swap() in HashTable::swap()
Comment 1 Zan Dobersek 2014-02-18 14:05:51 PST
Created attachment 224544 [details]
Patch
Comment 2 Brent Fulgham 2014-02-19 11:19:55 PST
Comment on attachment 224544 [details]
Patch

It's nice to not reinvent the wheel!  Thanks for catching this.

Do we know if this gives any tiny microptimization based on the compiler being able to do moves instead of all of the copying? We probably don't measure enough to tell.
Comment 3 Zan Dobersek 2014-02-19 11:29:27 PST
Using Clang, Parser/HTML5-8266-ParseOnly.html runs about ~1%  faster when using libc++ (not substantial, but measurable) and regresses slightly when using libstdc++. Haven't tested with GCC.
Comment 4 WebKit Commit Bot 2014-02-19 11:50:15 PST
Comment on attachment 224544 [details]
Patch

Clearing flags on attachment: 224544

Committed r164378: <http://trac.webkit.org/changeset/164378>
Comment 5 WebKit Commit Bot 2014-02-19 11:50:17 PST
All reviewed patches have been landed.  Closing bug.