Bug 157660 - [NetworkCache] Avoid having to re-parse URLs after deserializing them
Summary: [NetworkCache] Avoid having to re-parse URLs after deserializing them
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-12 20:27 PDT by Chris Dumez
Modified: 2016-05-13 19:25 PDT (History)
9 users (show)

See Also:


Attachments
Patch (11.68 KB, patch)
2016-05-12 20:35 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (9.85 KB, patch)
2016-05-13 12:02 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-05-12 20:27:45 PDT
Avoid having to re-parse URLs after deserializing them. This impacts both our IPC and our disk cache storage code.
We currently serialize URLs as Strings, which means that we have the re-parse them upon deserialization.
Comment 1 Chris Dumez 2016-05-12 20:35:15 PDT
Created attachment 278807 [details]
Patch
Comment 2 Alex Christensen 2016-05-12 21:56:34 PDT
Comment on attachment 278807 [details]
Patch

One encoder is better than the two we had before.  r=me for correctness, but is this really faster?
Also, why are all the member variables signed integers?  I think they should be unsigned.
Comment 3 Chris Dumez 2016-05-12 22:03:55 PDT
(In reply to comment #2)
> Comment on attachment 278807 [details]
> Patch
> 
> One encoder is better than the two we had before.  r=me for correctness, but
> is this really faster?
> Also, why are all the member variables signed integers?  I think they should
> be unsigned.

Do you mind if I change the type of those members in a follow up?
Comment 4 Alexey Proskuryakov 2016-05-12 22:50:34 PDT
Comment on attachment 278807 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=278807&action=review

> Source/WebCore/ChangeLog:9
> +        Avoid having to re-parse URLs after deserializing them. This impacts
> +        both our WK2 IPC and our WK2 network cache storage code.

Is this good when handling untrusted URLs from WebContent in UI process?
Comment 5 Darin Adler 2016-05-12 23:53:54 PDT
I agree with Alexey that it in theory would be a problem trusting data from the web process. Worth talking over Anders and Sam at some point.
Comment 6 Chris Dumez 2016-05-13 09:09:57 PDT
(In reply to comment #5)
> I agree with Alexey that it in theory would be a problem trusting data from
> the web process. Worth talking over Anders and Sam at some point.

Ok, based on Alexey and Darin's feedback, I think I'll restrict the optimization to the disk cache for now and not the IPC.
Comment 7 Chris Dumez 2016-05-13 12:02:20 PDT
Created attachment 278858 [details]
Patch
Comment 8 WebKit Commit Bot 2016-05-13 19:25:31 PDT
Comment on attachment 278858 [details]
Patch

Clearing flags on attachment: 278858

Committed r200909: <http://trac.webkit.org/changeset/200909>
Comment 9 WebKit Commit Bot 2016-05-13 19:25:38 PDT
All reviewed patches have been landed.  Closing bug.