RESOLVED FIXED 187671
Reduce size of NetworkLoadMetrics and therefore ResourceResponse
https://bugs.webkit.org/show_bug.cgi?id=187671
Summary Reduce size of NetworkLoadMetrics and therefore ResourceResponse
Alex Christensen
Reported 2018-07-13 16:33:56 PDT
Reduce size of NetworkLoadMetrics and therefore ResourceResponse
Attachments
Patch (7.78 KB, patch)
2018-07-13 16:36 PDT, Alex Christensen
no flags
Patch (10.00 KB, patch)
2018-07-13 17:29 PDT, Alex Christensen
no flags
Patch (10.31 KB, patch)
2018-07-16 12:10 PDT, Alex Christensen
no flags
Patch (10.47 KB, patch)
2018-07-16 12:19 PDT, Alex Christensen
no flags
Patch (10.47 KB, patch)
2018-07-16 12:26 PDT, Alex Christensen
no flags
Alex Christensen
Comment 1 2018-07-13 16:36:53 PDT
Alex Christensen
Comment 2 2018-07-13 17:29:55 PDT
Darin Adler
Comment 3 2018-07-14 06:56:03 PDT
Comment on attachment 345008 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345008&action=review Concept here is fine but std::numeric_limits<unit64_t>::max() is probably better than writing -1. Also if we really want to optimize the size of this it seems strange we really need 64 bits for something like header size. There must be much smaller practical limits for the sizes of various things here. And we could store headers in a sorted vector instead of a map and save a *lot* more space. I am also concerned that this leaves nothing behind to remind us to keep this small. I could easily imagine someone showing up soon with a “cleanup” patch to make this use std::optional and we are not even leaving a comment behind to prevent that. > Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp:246 > + if (networkLoadMetrics.requestHeaderBytesSent != -1ull) -1ull does not make sense. -1 is not an unsigned number. Can we find a correct way to write this?
Chris Dumez
Comment 4 2018-07-14 08:14:04 PDT
(In reply to Darin Adler from comment #3) > Comment on attachment 345008 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=345008&action=review > > Concept here is fine but std::numeric_limits<unit64_t>::max() is probably > better than writing -1. > > Also if we really want to optimize the size of this it seems strange we > really need 64 bits for something like header size. There must be much > smaller practical limits for the sizes of various things here. And we could > store headers in a sorted vector instead of a map and save a *lot* more > space. HTTPHeaderMap is based on Vector nowadays already, not HashMap. > > I am also concerned that this leaves nothing behind to remind us to keep > this small. I could easily imagine someone showing up soon with a “cleanup” > patch to make this use std::optional and we are not even leaving a comment > behind to prevent that. > > > Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp:246 > > + if (networkLoadMetrics.requestHeaderBytesSent != -1ull) > > -1ull does not make sense. -1 is not an unsigned number. Can we find a > correct way to write this?
Alex Christensen
Comment 5 2018-07-16 12:10:05 PDT
Alex Christensen
Comment 6 2018-07-16 12:19:12 PDT
Alex Christensen
Comment 7 2018-07-16 12:26:23 PDT
Alex Christensen
Comment 8 2018-07-16 12:55:46 PDT
Comment on attachment 345109 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345109&action=review > Source/WebCore/platform/network/NetworkLoadMetrics.h:171 > + uint32_t requestHeaderBytesSent; > + uint32_t responseHeaderBytesReceived; I used uint32_t for the header bytes.
WebKit Commit Bot
Comment 9 2018-07-16 13:23:59 PDT
Comment on attachment 345109 [details] Patch Clearing flags on attachment: 345109 Committed r233863: <https://trac.webkit.org/changeset/233863>
WebKit Commit Bot
Comment 10 2018-07-16 13:24:01 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 11 2018-07-16 13:24:24 PDT
Note You need to log in before you can comment on or make changes to this bug.