Bug 132548 - Optimize JSRopeString for resolving directly to AtomicString.
Summary: Optimize JSRopeString for resolving directly to AtomicString.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-04 13:51 PDT by Andreas Kling
Modified: 2014-05-04 23:45 PDT (History)
14 users (show)

See Also:


Attachments
Patch (18.04 KB, patch)
2014-05-04 14:19 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff
Patch (18.53 KB, patch)
2014-05-04 16:05 PDT, Andreas Kling
fpizlo: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2014-05-04 13:51:48 PDT
We could make JSRopeString smarter when we know the output is going to be used as an AtomicString.
Comment 1 Andreas Kling 2014-05-04 14:19:01 PDT
Created attachment 230792 [details]
Patch
Comment 2 Andreas Kling 2014-05-04 16:05:19 PDT
Created attachment 230793 [details]
Patch
Comment 3 Benjamin Poulain 2014-05-04 19:31:02 PDT
Comment on attachment 230793 [details]
Patch

I would have done this differently. First use the rope in place to find the AtomicString. If none exist, then create the StringImpl and resolve.

Any reason you went for this two steps resolution?
Comment 4 Andreas Kling 2014-05-04 19:46:22 PDT
(In reply to comment #3)
> (From update of attachment 230793 [details])
> I would have done this differently. First use the rope in place to find the AtomicString. If none exist, then create the StringImpl and resolve.
> 
> Any reason you went for this two steps resolution?

For simplicity. Here we walk the fiber tree once instead of up to 3 times. In your version, we'd have to hash recursively, then check equality recursively and then (worst case) copy into a new string recursively.
Comment 5 Andreas Kling 2014-05-04 21:43:55 PDT
Forgot to mention in ChangeLog, this is a ~20% progression on Dromaeo/dom-query.html
Comment 6 Filip Pizlo 2014-05-04 21:50:20 PDT
Comment on attachment 230793 [details]
Patch

lgtm
Comment 7 Andreas Kling 2014-05-04 23:45:14 PDT
Committed r168256: <http://trac.webkit.org/changeset/168256>