|
|
Chromium Code Reviews|
Created:
3 years, 6 months ago by stanisc Modified:
3 years, 6 months ago CC:
chromium-reviews, mlamouri+watch-content_chromium.org, caseq+blink_chromium.org, creis+watch_chromium.org, blink-reviews-api_chromium.org, nasko+codewatch_chromium.org, jam, tyoshino+watch_chromium.org, lushnikov+blink_chromium.org, loading-reviews+fetch_chromium.org, pfeldman+blink_chromium.org, dglazkov+blink, platform-architecture-syd+reviews-web_chromium.org, darin-cc_chromium.org, gavinp+loader_chromium.org, devtools-reviews_chromium.org, blink-reviews, apavlov+blink_chromium.org, kinuko+watch, Nate Chapin, loading-reviews_chromium.org, kozyatinskiy+blink_chromium.org Target Ref:
refs/heads/master Project:
chromium Visibility:
Public. |
DescriptionClass/struct layout optimization for blink Resource related classes
Reduces sizeof(Resource) by 160 bytes from 1632 bytes to 1472 bytes.
Also the following nested classes are optimized:
- ResourceRequest - 416 to 368 bytes
- ResourceResponse - 696 to 624 bytes
- ResourceLoaderOptions 112 to 88 bytes
The optimization is achieved by a combination of the following
methods:
1) Making enums based on uint8_t or int8_t which reduces their size
from 4 bytes to 1 byte.
2) Packing smaller sizing fields together forming 8 byte groups of
fields to avoid padding.
3) Grouping bitfields together - disperse bitfields waste a lot of
space due to padding
The total number of Resource instances is typically 200-500
depending on site so the expected memory improvement is may be up to
100 KB per tab. But the change is straightforward and low risk.
Here is an example of optimization.
Before:
class blink::ResourceResponse [sizeof = 696] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] int http_status_code_
<padding> (4 bytes)
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=1] bool was_cached_ : 1
<padding> (3 bytes)
data +0xb4 [sizeof=4] unsigned int connection_id_
data +0xb8 [sizeof=1] bool connection_reused_ : 1
<padding> (7 bytes)
data +0xc0 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0xc8 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0xd0 [sizeof=1] bool is_null_ : 1
<padding> (7 bytes)
data +0xd8 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0xe8 [sizeof=1] bool have_parsed_age_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_date_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_last_modified_header_ : 1
<padding> (7 bytes)
data +0xf0 [sizeof=8] double age_
data +0xf8 [sizeof=8] double date_
data +0x100 [sizeof=8] double expires_
data +0x108 [sizeof=8] double last_modified_
data +0x110 [sizeof=1] bool has_major_certificate_errors_
<padding> (3 bytes)
data +0x114 [sizeof=4] blink::ResourceResponse::SecurityStyle
security_style_
data +0x118 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x190 [sizeof=4] blink::ResourceResponse::HTTPVersion http_version_
<padding> (4 bytes)
data +0x198 [sizeof=8] __int64 app_cache_id_
data +0x1a0 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x210 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x220 [sizeof=1] bool was_fetched_via_spdy_
data +0x221 [sizeof=1] bool was_fetched_via_proxy_
data +0x222 [sizeof=1] bool was_fetched_via_service_worker_
data +0x223 [sizeof=1] bool was_fetched_via_foreign_fetch_
data +0x224 [sizeof=1] bool was_fallback_required_by_service_worker_
<padding> (3 bytes)
data +0x228 [sizeof=4] blink::WebServiceWorkerResponseType
service_worker_response_type_
<padding> (4 bytes)
data +0x230 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x240 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x248 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x258 [sizeof=1] bool did_service_worker_navigation_preload_
<padding> (7 bytes)
data +0x260 [sizeof=8] __int64 response_time_
data +0x268 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0x270 [sizeof=2] unsigned short remote_port_
<padding> (6 bytes)
data +0x278 [sizeof=8] __int64 encoded_data_length_
data +0x280 [sizeof=8] __int64 encoded_body_length_
data +0x288 [sizeof=8] __int64 decoded_body_length_
data +0x290 [sizeof=8] WTF::String downloaded_file_path_
data +0x298 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x2a0 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x2a8 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
After:
class blink::ResourceResponse [sizeof = 624] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] unsigned int connection_id_
data +0x8c [sizeof=4] int http_status_code_
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0xb8 [sizeof=2] unsigned short remote_port_
data +0xba [sizeof=1] bool was_cached_ : 1
data +0xba [sizeof=1] bool connection_reused_ : 1
data +0xba [sizeof=1] bool is_null_ : 1
data +0xba [sizeof=1] bool have_parsed_age_header_ : 1
data +0xba [sizeof=1] bool have_parsed_date_header_ : 1
data +0xba [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xba [sizeof=1] bool have_parsed_last_modified_header_ : 1
data +0xba [sizeof=1] bool has_major_certificate_errors_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_spdy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_proxy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_service_worker_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_foreign_fetch_ : 1
data +0xbb [sizeof=1] bool was_fallback_required_by_service_worker_ : 1
data +0xbb [sizeof=1] bool did_service_worker_navigation_preload_ : 1
data +0xbc [sizeof=1] blink::WebServiceWorkerResponseType
service_worker_response_type_
data +0xbd [sizeof=1] blink::ResourceResponse::HTTPVersion http_version_
data +0xbe [sizeof=1] blink::ResourceResponse::SecurityStyle
security_style_
<padding> (1 bytes)
data +0xc0 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x138 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0x140 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0x148 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0x158 [sizeof=8] double age_
data +0x160 [sizeof=8] double date_
data +0x168 [sizeof=8] double expires_
data +0x170 [sizeof=8] double last_modified_
data +0x178 [sizeof=8] __int64 app_cache_id_
data +0x180 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x1f0 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x200 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x210 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x218 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x228 [sizeof=8] __int64 response_time_
data +0x230 [sizeof=8] __int64 encoded_data_length_
data +0x238 [sizeof=8] __int64 encoded_body_length_
data +0x240 [sizeof=8] __int64 decoded_body_length_
data +0x248 [sizeof=8] WTF::String downloaded_file_path_
data +0x250 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x258 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x260 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
BUG=710933
Review-Url: https://codereview.chromium.org/2920663002
Cr-Commit-Position: refs/heads/master@{#479798}
Committed: https://chromium.googlesource.com/chromium/src/+/a8599ca28499cb5770adc9219857b3a0dff4b90b
Patch Set 1 #
Total comments: 8
Patch Set 2 : Addressed feedback #
Total comments: 2
Patch Set 3 : Addressed second round of feedback #Patch Set 4 : Rebase #Messages
Total messages: 39 (20 generated)
The CQ bit was checked by stanisc@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from
==========
Restore ImageResourceTest.cpp
More progress
Progress
Progress
Derive several enums from uint8_t or int8_t
Experiment
BUG=
==========
to
==========
Class/struct layout optimization for blink Resource related classes
Reduces sizeof(Resource) by 168 bytes from 1632 bytes to 1464 bytes.
Also the following nested classes are optimized:
- ResourceRequest - 416 to 368 bytes
- ResourceResponse - 696 to 624 bytes
- ResourceLoaderOptions 112 to 88 bytes
The optimization is achieved by a combination of the following
methods:
1) Making enums based on uint8_t or int8_t which reduces their size
from 4 bytes to 1 byte.
2) Packing smaller sizing fields together forming 8 byte groups of
fields to avoid padding.
3) Grouping bitfields together - disperse bitfields waste a lot of
space due to padding
Here is an example of optimization.
Before:
class blink::ResourceResponse [sizeof = 696] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] int http_status_code_
<padding> (4 bytes)
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=1] bool was_cached_ : 1
<padding> (3 bytes)
data +0xb4 [sizeof=4] unsigned int connection_id_
data +0xb8 [sizeof=1] bool connection_reused_ : 1
<padding> (7 bytes)
data +0xc0 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0xc8 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0xd0 [sizeof=1] bool is_null_ : 1
<padding> (7 bytes)
data +0xd8 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0xe8 [sizeof=1] bool have_parsed_age_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_date_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_last_modified_header_ : 1
<padding> (7 bytes)
data +0xf0 [sizeof=8] double age_
data +0xf8 [sizeof=8] double date_
data +0x100 [sizeof=8] double expires_
data +0x108 [sizeof=8] double last_modified_
data +0x110 [sizeof=1] bool has_major_certificate_errors_
<padding> (3 bytes)
data +0x114 [sizeof=4] blink::ResourceResponse::SecurityStyle
security_style_
data +0x118 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x190 [sizeof=4] blink::ResourceResponse::HTTPVersion http_version_
<padding> (4 bytes)
data +0x198 [sizeof=8] __int64 app_cache_id_
data +0x1a0 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x210 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x220 [sizeof=1] bool was_fetched_via_spdy_
data +0x221 [sizeof=1] bool was_fetched_via_proxy_
data +0x222 [sizeof=1] bool was_fetched_via_service_worker_
data +0x223 [sizeof=1] bool was_fetched_via_foreign_fetch_
data +0x224 [sizeof=1] bool was_fallback_required_by_service_worker_
<padding> (3 bytes)
data +0x228 [sizeof=4] blink::WebServiceWorkerResponseType
service_worker_response_type_
<padding> (4 bytes)
data +0x230 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x240 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x248 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x258 [sizeof=1] bool did_service_worker_navigation_preload_
<padding> (7 bytes)
data +0x260 [sizeof=8] __int64 response_time_
data +0x268 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0x270 [sizeof=2] unsigned short remote_port_
<padding> (6 bytes)
data +0x278 [sizeof=8] __int64 encoded_data_length_
data +0x280 [sizeof=8] __int64 encoded_body_length_
data +0x288 [sizeof=8] __int64 decoded_body_length_
data +0x290 [sizeof=8] WTF::String downloaded_file_path_
data +0x298 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x2a0 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x2a8 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
After:
class blink::ResourceResponse [sizeof = 624] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] unsigned int connection_id_
data +0x8c [sizeof=4] int http_status_code_
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0xb8 [sizeof=2] unsigned short remote_port_
data +0xba [sizeof=1] bool was_cached_ : 1
data +0xba [sizeof=1] bool connection_reused_ : 1
data +0xba [sizeof=1] bool is_null_ : 1
data +0xba [sizeof=1] bool have_parsed_age_header_ : 1
data +0xba [sizeof=1] bool have_parsed_date_header_ : 1
data +0xba [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xba [sizeof=1] bool have_parsed_last_modified_header_ : 1
data +0xba [sizeof=1] bool has_major_certificate_errors_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_spdy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_proxy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_service_worker_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_foreign_fetch_ : 1
data +0xbb [sizeof=1] bool was_fallback_required_by_service_worker_ : 1
data +0xbb [sizeof=1] bool did_service_worker_navigation_preload_ : 1
data +0xbc [sizeof=1] blink::WebServiceWorkerResponseType
service_worker_response_type_
data +0xbd [sizeof=1] blink::ResourceResponse::HTTPVersion http_version_
data +0xbe [sizeof=1] blink::ResourceResponse::SecurityStyle
security_style_
<padding> (1 bytes)
data +0xc0 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x138 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0x140 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0x148 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0x158 [sizeof=8] double age_
data +0x160 [sizeof=8] double date_
data +0x168 [sizeof=8] double expires_
data +0x170 [sizeof=8] double last_modified_
data +0x178 [sizeof=8] __int64 app_cache_id_
data +0x180 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x1f0 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x200 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x210 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x218 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x228 [sizeof=8] __int64 response_time_
data +0x230 [sizeof=8] __int64 encoded_data_length_
data +0x238 [sizeof=8] __int64 encoded_body_length_
data +0x240 [sizeof=8] __int64 decoded_body_length_
data +0x248 [sizeof=8] WTF::String downloaded_file_path_
data +0x250 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x258 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x260 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
BUG=710933
==========
Patchset #1 (id:1) has been deleted
Description was changed from
==========
Class/struct layout optimization for blink Resource related classes
Reduces sizeof(Resource) by 168 bytes from 1632 bytes to 1464 bytes.
Also the following nested classes are optimized:
- ResourceRequest - 416 to 368 bytes
- ResourceResponse - 696 to 624 bytes
- ResourceLoaderOptions 112 to 88 bytes
The optimization is achieved by a combination of the following
methods:
1) Making enums based on uint8_t or int8_t which reduces their size
from 4 bytes to 1 byte.
2) Packing smaller sizing fields together forming 8 byte groups of
fields to avoid padding.
3) Grouping bitfields together - disperse bitfields waste a lot of
space due to padding
Here is an example of optimization.
Before:
class blink::ResourceResponse [sizeof = 696] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] int http_status_code_
<padding> (4 bytes)
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=1] bool was_cached_ : 1
<padding> (3 bytes)
data +0xb4 [sizeof=4] unsigned int connection_id_
data +0xb8 [sizeof=1] bool connection_reused_ : 1
<padding> (7 bytes)
data +0xc0 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0xc8 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0xd0 [sizeof=1] bool is_null_ : 1
<padding> (7 bytes)
data +0xd8 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0xe8 [sizeof=1] bool have_parsed_age_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_date_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_last_modified_header_ : 1
<padding> (7 bytes)
data +0xf0 [sizeof=8] double age_
data +0xf8 [sizeof=8] double date_
data +0x100 [sizeof=8] double expires_
data +0x108 [sizeof=8] double last_modified_
data +0x110 [sizeof=1] bool has_major_certificate_errors_
<padding> (3 bytes)
data +0x114 [sizeof=4] blink::ResourceResponse::SecurityStyle
security_style_
data +0x118 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x190 [sizeof=4] blink::ResourceResponse::HTTPVersion http_version_
<padding> (4 bytes)
data +0x198 [sizeof=8] __int64 app_cache_id_
data +0x1a0 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x210 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x220 [sizeof=1] bool was_fetched_via_spdy_
data +0x221 [sizeof=1] bool was_fetched_via_proxy_
data +0x222 [sizeof=1] bool was_fetched_via_service_worker_
data +0x223 [sizeof=1] bool was_fetched_via_foreign_fetch_
data +0x224 [sizeof=1] bool was_fallback_required_by_service_worker_
<padding> (3 bytes)
data +0x228 [sizeof=4] blink::WebServiceWorkerResponseType
service_worker_response_type_
<padding> (4 bytes)
data +0x230 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x240 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x248 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x258 [sizeof=1] bool did_service_worker_navigation_preload_
<padding> (7 bytes)
data +0x260 [sizeof=8] __int64 response_time_
data +0x268 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0x270 [sizeof=2] unsigned short remote_port_
<padding> (6 bytes)
data +0x278 [sizeof=8] __int64 encoded_data_length_
data +0x280 [sizeof=8] __int64 encoded_body_length_
data +0x288 [sizeof=8] __int64 decoded_body_length_
data +0x290 [sizeof=8] WTF::String downloaded_file_path_
data +0x298 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x2a0 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x2a8 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
After:
class blink::ResourceResponse [sizeof = 624] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] unsigned int connection_id_
data +0x8c [sizeof=4] int http_status_code_
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0xb8 [sizeof=2] unsigned short remote_port_
data +0xba [sizeof=1] bool was_cached_ : 1
data +0xba [sizeof=1] bool connection_reused_ : 1
data +0xba [sizeof=1] bool is_null_ : 1
data +0xba [sizeof=1] bool have_parsed_age_header_ : 1
data +0xba [sizeof=1] bool have_parsed_date_header_ : 1
data +0xba [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xba [sizeof=1] bool have_parsed_last_modified_header_ : 1
data +0xba [sizeof=1] bool has_major_certificate_errors_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_spdy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_proxy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_service_worker_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_foreign_fetch_ : 1
data +0xbb [sizeof=1] bool was_fallback_required_by_service_worker_ : 1
data +0xbb [sizeof=1] bool did_service_worker_navigation_preload_ : 1
data +0xbc [sizeof=1] blink::WebServiceWorkerResponseType
service_worker_response_type_
data +0xbd [sizeof=1] blink::ResourceResponse::HTTPVersion http_version_
data +0xbe [sizeof=1] blink::ResourceResponse::SecurityStyle
security_style_
<padding> (1 bytes)
data +0xc0 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x138 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0x140 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0x148 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0x158 [sizeof=8] double age_
data +0x160 [sizeof=8] double date_
data +0x168 [sizeof=8] double expires_
data +0x170 [sizeof=8] double last_modified_
data +0x178 [sizeof=8] __int64 app_cache_id_
data +0x180 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x1f0 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x200 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x210 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x218 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x228 [sizeof=8] __int64 response_time_
data +0x230 [sizeof=8] __int64 encoded_data_length_
data +0x238 [sizeof=8] __int64 encoded_body_length_
data +0x240 [sizeof=8] __int64 decoded_body_length_
data +0x248 [sizeof=8] WTF::String downloaded_file_path_
data +0x250 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x258 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x260 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
BUG=710933
==========
to
==========
Class/struct layout optimization for blink Resource related classes
Reduces sizeof(Resource) by 168 bytes from 1632 bytes to 1464 bytes.
Also the following nested classes are optimized:
- ResourceRequest - 416 to 368 bytes
- ResourceResponse - 696 to 624 bytes
- ResourceLoaderOptions 112 to 88 bytes
The optimization is achieved by a combination of the following
methods:
1) Making enums based on uint8_t or int8_t which reduces their size
from 4 bytes to 1 byte.
2) Packing smaller sizing fields together forming 8 byte groups of
fields to avoid padding.
3) Grouping bitfields together - disperse bitfields waste a lot of
space due to padding
BUG=710933
==========
Description was changed from
==========
Class/struct layout optimization for blink Resource related classes
Reduces sizeof(Resource) by 168 bytes from 1632 bytes to 1464 bytes.
Also the following nested classes are optimized:
- ResourceRequest - 416 to 368 bytes
- ResourceResponse - 696 to 624 bytes
- ResourceLoaderOptions 112 to 88 bytes
The optimization is achieved by a combination of the following
methods:
1) Making enums based on uint8_t or int8_t which reduces their size
from 4 bytes to 1 byte.
2) Packing smaller sizing fields together forming 8 byte groups of
fields to avoid padding.
3) Grouping bitfields together - disperse bitfields waste a lot of
space due to padding
BUG=710933
==========
to
==========
Class/struct layout optimization for blink Resource related classes
Reduces sizeof(Resource) by 168 bytes from 1632 bytes to 1464 bytes.
Also the following nested classes are optimized:
- ResourceRequest - 416 to 368 bytes
- ResourceResponse - 696 to 624 bytes
- ResourceLoaderOptions 112 to 88 bytes
The optimization is achieved by a combination of the following
methods:
1) Making enums based on uint8_t or int8_t which reduces their size
from 4 bytes to 1 byte.
2) Packing smaller sizing fields together forming 8 byte groups of
fields to avoid padding.
3) Grouping bitfields together - disperse bitfields waste a lot of
space due to padding
Here is an example of optimization.
Before:
class blink::ResourceResponse [sizeof = 696] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] int http_status_code_
<padding> (4 bytes)
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=1] bool was_cached_ : 1
<padding> (3 bytes)
data +0xb4 [sizeof=4] unsigned int connection_id_
data +0xb8 [sizeof=1] bool connection_reused_ : 1
<padding> (7 bytes)
data +0xc0 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0xc8 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0xd0 [sizeof=1] bool is_null_ : 1
<padding> (7 bytes)
data +0xd8 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0xe8 [sizeof=1] bool have_parsed_age_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_date_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_last_modified_header_ : 1
<padding> (7 bytes)
data +0xf0 [sizeof=8] double age_
data +0xf8 [sizeof=8] double date_
data +0x100 [sizeof=8] double expires_
data +0x108 [sizeof=8] double last_modified_
data +0x110 [sizeof=1] bool has_major_certificate_errors_
<padding> (3 bytes)
data +0x114 [sizeof=4] blink::ResourceResponse::SecurityStyle
security_style_
data +0x118 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x190 [sizeof=4] blink::ResourceResponse::HTTPVersion http_version_
<padding> (4 bytes)
data +0x198 [sizeof=8] __int64 app_cache_id_
data +0x1a0 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x210 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x220 [sizeof=1] bool was_fetched_via_spdy_
data +0x221 [sizeof=1] bool was_fetched_via_proxy_
data +0x222 [sizeof=1] bool was_fetched_via_service_worker_
data +0x223 [sizeof=1] bool was_fetched_via_foreign_fetch_
data +0x224 [sizeof=1] bool was_fallback_required_by_service_worker_
<padding> (3 bytes)
data +0x228 [sizeof=4] blink::WebServiceWorkerResponseType
service_worker_response_type_
<padding> (4 bytes)
data +0x230 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x240 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x248 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x258 [sizeof=1] bool did_service_worker_navigation_preload_
<padding> (7 bytes)
data +0x260 [sizeof=8] __int64 response_time_
data +0x268 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0x270 [sizeof=2] unsigned short remote_port_
<padding> (6 bytes)
data +0x278 [sizeof=8] __int64 encoded_data_length_
data +0x280 [sizeof=8] __int64 encoded_body_length_
data +0x288 [sizeof=8] __int64 decoded_body_length_
data +0x290 [sizeof=8] WTF::String downloaded_file_path_
data +0x298 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x2a0 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x2a8 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
After:
class blink::ResourceResponse [sizeof = 624] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] unsigned int connection_id_
data +0x8c [sizeof=4] int http_status_code_
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0xb8 [sizeof=2] unsigned short remote_port_
data +0xba [sizeof=1] bool was_cached_ : 1
data +0xba [sizeof=1] bool connection_reused_ : 1
data +0xba [sizeof=1] bool is_null_ : 1
data +0xba [sizeof=1] bool have_parsed_age_header_ : 1
data +0xba [sizeof=1] bool have_parsed_date_header_ : 1
data +0xba [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xba [sizeof=1] bool have_parsed_last_modified_header_ : 1
data +0xba [sizeof=1] bool has_major_certificate_errors_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_spdy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_proxy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_service_worker_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_foreign_fetch_ : 1
data +0xbb [sizeof=1] bool was_fallback_required_by_service_worker_ : 1
data +0xbb [sizeof=1] bool did_service_worker_navigation_preload_ : 1
data +0xbc [sizeof=1] blink::WebServiceWorkerResponseType
service_worker_response_type_
data +0xbd [sizeof=1] blink::ResourceResponse::HTTPVersion http_version_
data +0xbe [sizeof=1] blink::ResourceResponse::SecurityStyle
security_style_
<padding> (1 bytes)
data +0xc0 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x138 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0x140 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0x148 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0x158 [sizeof=8] double age_
data +0x160 [sizeof=8] double date_
data +0x168 [sizeof=8] double expires_
data +0x170 [sizeof=8] double last_modified_
data +0x178 [sizeof=8] __int64 app_cache_id_
data +0x180 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x1f0 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x200 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x210 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x218 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x228 [sizeof=8] __int64 response_time_
data +0x230 [sizeof=8] __int64 encoded_data_length_
data +0x238 [sizeof=8] __int64 encoded_body_length_
data +0x240 [sizeof=8] __int64 decoded_body_length_
data +0x248 [sizeof=8] WTF::String downloaded_file_path_
data +0x250 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x258 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x260 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
The total number of Resource instances is typically 200-500 depending on site so
the expected memory improvement is may be up to 100 KB per tab. But the change
is straightforward and low risk.
BUG=710933
==========
stanisc@chromium.org changed reviewers: + alexmos@chromium.org, dcheng@chromium.org, drott@chromium.org
drott@chromium.org: Please review changes in WebKit/Source/platform dcheng@chromium.org: Please review changes in WebKit/Source/core, WebKit/Source/web/tests, and WebKit/public alexmos@chromium.org: Please review changes in content
Miscellaneous questions: 1) is there some long-term plan to help maintain good packing order? 2) what are the guidelines for whether or not things should be packed into bitfields? https://codereview.chromium.org/2920663002/diff/20001/content/public/renderer... File content/public/renderer/associated_resource_fetcher.h (right): https://codereview.chromium.org/2920663002/diff/20001/content/public/renderer... content/public/renderer/associated_resource_fetcher.h:19: enum class WebCachePolicy : uint8_t; Can we just #include the enum header? It seems easy for this to get out of sync. https://codereview.chromium.org/2920663002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/platform/loader/fetch/Resource.h (right): https://codereview.chromium.org/2920663002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/loader/fetch/Resource.h:436: bool needs_synchronous_cache_hit_ : 1; Is the bitfield packing necessary? We don't pack everything as bitfields, so it's not clear why some objects are packed and others aren't.
I am more comfortable reviewing things in platform/fonts - If possible, I suggest to find a better owner for platform/loader.
stanisc@chromium.org changed reviewers: - drott@chromium.org
Patchset #2 (id:40001) has been deleted
stanisc@chromium.org changed reviewers: + noel@chromium.org
+noel@ for WebKit/Source/platform > 1) is there some long-term plan to help maintain good packing order? We've discussed a few ideas but currently there is no good long-term plan. One possibility is to add a statis assert that verifies the class size against either a hard-coded number or a sum of sizeof of individual fields. That might be acceptable for high impact low maintenance classes but would be cumbersome for more complex classes like the ones touched in this change. Overall the cost/benefit ratio of maintaining the opimal layout is pretty low for most classes. > 2) what are the guidelines for whether or not things should be packed into bitfields? Good question. There is a tradeoff between a low size and higher CPU cost to access a bitfield. Bitfields shouldn't be used if a field is accessed on a hot path. Also bitfield can't be used for a boolen field which is passed around by reference or pointer. My approach so far was to leverage already existing bitfields but avoid introducing new ones. The only exception to that was introducing bitfield in Resource.h because I tried to squeeze in another 16 bytes of class size saving. https://codereview.chromium.org/2920663002/diff/20001/content/public/renderer... File content/public/renderer/associated_resource_fetcher.h (right): https://codereview.chromium.org/2920663002/diff/20001/content/public/renderer... content/public/renderer/associated_resource_fetcher.h:19: enum class WebCachePolicy : uint8_t; On 2017/06/05 18:15:40, dcheng wrote: > Can we just #include the enum header? It seems easy for this to get out of sync. Done. https://codereview.chromium.org/2920663002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/platform/loader/fetch/Resource.h (right): https://codereview.chromium.org/2920663002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/loader/fetch/Resource.h:436: bool needs_synchronous_cache_hit_ : 1; On 2017/06/05 18:15:40, dcheng wrote: > Is the bitfield packing necessary? We don't pack everything as bitfields, so > it's not clear why some objects are packed and others aren't. Not necessary in this particular case. I was debating whether to introduce it or not and decided to introduce it to save another 16 bytes of the class sizeof (the actual difference would be 8 bytes but the allocation granularity is 16 bytes). Bitfields can't be applied to the last two boolean fields because there is some code that takes address of those field. I am OK with reverting these back to regular boolean fields if you think this is sketchy.
https://codereview.chromium.org/2920663002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/platform/loader/fetch/Resource.h (right): https://codereview.chromium.org/2920663002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/loader/fetch/Resource.h:436: bool needs_synchronous_cache_hit_ : 1; On 2017/06/06 22:47:55, stanisc wrote: > On 2017/06/05 18:15:40, dcheng wrote: > > Is the bitfield packing necessary? We don't pack everything as bitfields, so > > it's not clear why some objects are packed and others aren't. > > Not necessary in this particular case. I was debating whether to introduce it or > not and decided to introduce it to save another 16 bytes of the class sizeof > (the actual difference would be 8 bytes but the allocation granularity is 16 > bytes). > Bitfields can't be applied to the last two boolean fields because there is some > code that takes address of those field. > > I am OK with reverting these back to regular boolean fields if you think this is > sketchy. If I had written the CL, I probably wouldn't have used bitfields for consistency, but I don't feel strongly about it. https://codereview.chromium.org/2920663002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/loader/fetch/Resource.h:444: ResourceIntegrityDisposition integrity_disposition_; This IMO is the big disadvantage of reordering fields to optimize class layout: this was originally next to IntegrityMetadataSet, which makes sense--but now it's pretty far away. Anything we can do to put it nearby without wasting too much padding? https://codereview.chromium.org/2920663002/diff/60001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h (right): https://codereview.chromium.org/2920663002/diff/60001/third_party/WebKit/Sour... third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h:67: enum ResourceLoadPriority : int8_t; Same comment about #including instead of forward declaring here.
kinuko@chromium.org changed reviewers: + kinuko@chromium.org
We've removed bitfield sometime ago as we didn't think it was beneficial, I'm not fully sure why we need to do this now? https://chromiumcodereview.appspot.com/2413983002
On 2017/06/08 05:26:45, kinuko wrote: > We've removed bitfield sometime ago as we didn't think it was beneficial, I'm > not fully sure why we need to do this now? > > https://chromiumcodereview.appspot.com/2413983002 OK, I'll remove bitfields from Resource.
I've moved some of the fields back and changed bitfields back to bool in Resource.h. This has increased the size by 8 bytes (16 considering the allocation granularity) but the number of changes in the class is now much smaller. Please take another look! https://codereview.chromium.org/2920663002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/platform/loader/fetch/Resource.h (right): https://codereview.chromium.org/2920663002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/loader/fetch/Resource.h:436: bool needs_synchronous_cache_hit_ : 1; On 2017/06/07 17:09:22, dcheng wrote: > On 2017/06/06 22:47:55, stanisc wrote: > > On 2017/06/05 18:15:40, dcheng wrote: > > > Is the bitfield packing necessary? We don't pack everything as bitfields, so > > > it's not clear why some objects are packed and others aren't. > > > > Not necessary in this particular case. I was debating whether to introduce it > or > > not and decided to introduce it to save another 16 bytes of the class sizeof > > (the actual difference would be 8 bytes but the allocation granularity is 16 > > bytes). > > Bitfields can't be applied to the last two boolean fields because there is > some > > code that takes address of those field. > > > > I am OK with reverting these back to regular boolean fields if you think this > is > > sketchy. > > If I had written the CL, I probably wouldn't have used bitfields for > consistency, but I don't feel strongly about it. OK, I've removed bitfields because that has been suggested by another reviewer too. https://codereview.chromium.org/2920663002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/loader/fetch/Resource.h:444: ResourceIntegrityDisposition integrity_disposition_; On 2017/06/07 17:09:22, dcheng wrote: > This IMO is the big disadvantage of reordering fields to optimize class layout: > this was originally next to IntegrityMetadataSet, which makes sense--but now > it's pretty far away. Anything we can do to put it nearby without wasting too > much padding? OK, moved it back. https://codereview.chromium.org/2920663002/diff/60001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h (right): https://codereview.chromium.org/2920663002/diff/60001/third_party/WebKit/Sour... third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h:67: enum ResourceLoadPriority : int8_t; On 2017/06/07 17:09:23, dcheng wrote: > Same comment about #including instead of forward declaring here. Done.
Description was changed from
==========
Class/struct layout optimization for blink Resource related classes
Reduces sizeof(Resource) by 168 bytes from 1632 bytes to 1464 bytes.
Also the following nested classes are optimized:
- ResourceRequest - 416 to 368 bytes
- ResourceResponse - 696 to 624 bytes
- ResourceLoaderOptions 112 to 88 bytes
The optimization is achieved by a combination of the following
methods:
1) Making enums based on uint8_t or int8_t which reduces their size
from 4 bytes to 1 byte.
2) Packing smaller sizing fields together forming 8 byte groups of
fields to avoid padding.
3) Grouping bitfields together - disperse bitfields waste a lot of
space due to padding
Here is an example of optimization.
Before:
class blink::ResourceResponse [sizeof = 696] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] int http_status_code_
<padding> (4 bytes)
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=1] bool was_cached_ : 1
<padding> (3 bytes)
data +0xb4 [sizeof=4] unsigned int connection_id_
data +0xb8 [sizeof=1] bool connection_reused_ : 1
<padding> (7 bytes)
data +0xc0 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0xc8 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0xd0 [sizeof=1] bool is_null_ : 1
<padding> (7 bytes)
data +0xd8 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0xe8 [sizeof=1] bool have_parsed_age_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_date_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_last_modified_header_ : 1
<padding> (7 bytes)
data +0xf0 [sizeof=8] double age_
data +0xf8 [sizeof=8] double date_
data +0x100 [sizeof=8] double expires_
data +0x108 [sizeof=8] double last_modified_
data +0x110 [sizeof=1] bool has_major_certificate_errors_
<padding> (3 bytes)
data +0x114 [sizeof=4] blink::ResourceResponse::SecurityStyle
security_style_
data +0x118 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x190 [sizeof=4] blink::ResourceResponse::HTTPVersion http_version_
<padding> (4 bytes)
data +0x198 [sizeof=8] __int64 app_cache_id_
data +0x1a0 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x210 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x220 [sizeof=1] bool was_fetched_via_spdy_
data +0x221 [sizeof=1] bool was_fetched_via_proxy_
data +0x222 [sizeof=1] bool was_fetched_via_service_worker_
data +0x223 [sizeof=1] bool was_fetched_via_foreign_fetch_
data +0x224 [sizeof=1] bool was_fallback_required_by_service_worker_
<padding> (3 bytes)
data +0x228 [sizeof=4] blink::WebServiceWorkerResponseType
service_worker_response_type_
<padding> (4 bytes)
data +0x230 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x240 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x248 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x258 [sizeof=1] bool did_service_worker_navigation_preload_
<padding> (7 bytes)
data +0x260 [sizeof=8] __int64 response_time_
data +0x268 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0x270 [sizeof=2] unsigned short remote_port_
<padding> (6 bytes)
data +0x278 [sizeof=8] __int64 encoded_data_length_
data +0x280 [sizeof=8] __int64 encoded_body_length_
data +0x288 [sizeof=8] __int64 decoded_body_length_
data +0x290 [sizeof=8] WTF::String downloaded_file_path_
data +0x298 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x2a0 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x2a8 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
After:
class blink::ResourceResponse [sizeof = 624] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] unsigned int connection_id_
data +0x8c [sizeof=4] int http_status_code_
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0xb8 [sizeof=2] unsigned short remote_port_
data +0xba [sizeof=1] bool was_cached_ : 1
data +0xba [sizeof=1] bool connection_reused_ : 1
data +0xba [sizeof=1] bool is_null_ : 1
data +0xba [sizeof=1] bool have_parsed_age_header_ : 1
data +0xba [sizeof=1] bool have_parsed_date_header_ : 1
data +0xba [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xba [sizeof=1] bool have_parsed_last_modified_header_ : 1
data +0xba [sizeof=1] bool has_major_certificate_errors_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_spdy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_proxy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_service_worker_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_foreign_fetch_ : 1
data +0xbb [sizeof=1] bool was_fallback_required_by_service_worker_ : 1
data +0xbb [sizeof=1] bool did_service_worker_navigation_preload_ : 1
data +0xbc [sizeof=1] blink::WebServiceWorkerResponseType
service_worker_response_type_
data +0xbd [sizeof=1] blink::ResourceResponse::HTTPVersion http_version_
data +0xbe [sizeof=1] blink::ResourceResponse::SecurityStyle
security_style_
<padding> (1 bytes)
data +0xc0 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x138 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0x140 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0x148 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0x158 [sizeof=8] double age_
data +0x160 [sizeof=8] double date_
data +0x168 [sizeof=8] double expires_
data +0x170 [sizeof=8] double last_modified_
data +0x178 [sizeof=8] __int64 app_cache_id_
data +0x180 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x1f0 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x200 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x210 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x218 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x228 [sizeof=8] __int64 response_time_
data +0x230 [sizeof=8] __int64 encoded_data_length_
data +0x238 [sizeof=8] __int64 encoded_body_length_
data +0x240 [sizeof=8] __int64 decoded_body_length_
data +0x248 [sizeof=8] WTF::String downloaded_file_path_
data +0x250 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x258 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x260 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
The total number of Resource instances is typically 200-500 depending on site so
the expected memory improvement is may be up to 100 KB per tab. But the change
is straightforward and low risk.
BUG=710933
==========
to
==========
Class/struct layout optimization for blink Resource related classes
Reduces sizeof(Resource) by 160 bytes from 1632 bytes to 1472 bytes.
Also the following nested classes are optimized:
- ResourceRequest - 416 to 368 bytes
- ResourceResponse - 696 to 624 bytes
- ResourceLoaderOptions 112 to 88 bytes
The optimization is achieved by a combination of the following
methods:
1) Making enums based on uint8_t or int8_t which reduces their size
from 4 bytes to 1 byte.
2) Packing smaller sizing fields together forming 8 byte groups of
fields to avoid padding.
3) Grouping bitfields together - disperse bitfields waste a lot of
space due to padding
Here is an example of optimization.
Before:
class blink::ResourceResponse [sizeof = 696] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] int http_status_code_
<padding> (4 bytes)
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=1] bool was_cached_ : 1
<padding> (3 bytes)
data +0xb4 [sizeof=4] unsigned int connection_id_
data +0xb8 [sizeof=1] bool connection_reused_ : 1
<padding> (7 bytes)
data +0xc0 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0xc8 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0xd0 [sizeof=1] bool is_null_ : 1
<padding> (7 bytes)
data +0xd8 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0xe8 [sizeof=1] bool have_parsed_age_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_date_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_last_modified_header_ : 1
<padding> (7 bytes)
data +0xf0 [sizeof=8] double age_
data +0xf8 [sizeof=8] double date_
data +0x100 [sizeof=8] double expires_
data +0x108 [sizeof=8] double last_modified_
data +0x110 [sizeof=1] bool has_major_certificate_errors_
<padding> (3 bytes)
data +0x114 [sizeof=4] blink::ResourceResponse::SecurityStyle
security_style_
data +0x118 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x190 [sizeof=4] blink::ResourceResponse::HTTPVersion http_version_
<padding> (4 bytes)
data +0x198 [sizeof=8] __int64 app_cache_id_
data +0x1a0 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x210 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x220 [sizeof=1] bool was_fetched_via_spdy_
data +0x221 [sizeof=1] bool was_fetched_via_proxy_
data +0x222 [sizeof=1] bool was_fetched_via_service_worker_
data +0x223 [sizeof=1] bool was_fetched_via_foreign_fetch_
data +0x224 [sizeof=1] bool was_fallback_required_by_service_worker_
<padding> (3 bytes)
data +0x228 [sizeof=4] blink::WebServiceWorkerResponseType
service_worker_response_type_
<padding> (4 bytes)
data +0x230 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x240 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x248 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x258 [sizeof=1] bool did_service_worker_navigation_preload_
<padding> (7 bytes)
data +0x260 [sizeof=8] __int64 response_time_
data +0x268 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0x270 [sizeof=2] unsigned short remote_port_
<padding> (6 bytes)
data +0x278 [sizeof=8] __int64 encoded_data_length_
data +0x280 [sizeof=8] __int64 encoded_body_length_
data +0x288 [sizeof=8] __int64 decoded_body_length_
data +0x290 [sizeof=8] WTF::String downloaded_file_path_
data +0x298 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x2a0 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x2a8 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
After:
class blink::ResourceResponse [sizeof = 624] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] unsigned int connection_id_
data +0x8c [sizeof=4] int http_status_code_
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0xb8 [sizeof=2] unsigned short remote_port_
data +0xba [sizeof=1] bool was_cached_ : 1
data +0xba [sizeof=1] bool connection_reused_ : 1
data +0xba [sizeof=1] bool is_null_ : 1
data +0xba [sizeof=1] bool have_parsed_age_header_ : 1
data +0xba [sizeof=1] bool have_parsed_date_header_ : 1
data +0xba [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xba [sizeof=1] bool have_parsed_last_modified_header_ : 1
data +0xba [sizeof=1] bool has_major_certificate_errors_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_spdy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_proxy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_service_worker_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_foreign_fetch_ : 1
data +0xbb [sizeof=1] bool was_fallback_required_by_service_worker_ : 1
data +0xbb [sizeof=1] bool did_service_worker_navigation_preload_ : 1
data +0xbc [sizeof=1] blink::WebServiceWorkerResponseType
service_worker_response_type_
data +0xbd [sizeof=1] blink::ResourceResponse::HTTPVersion http_version_
data +0xbe [sizeof=1] blink::ResourceResponse::SecurityStyle
security_style_
<padding> (1 bytes)
data +0xc0 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x138 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0x140 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0x148 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0x158 [sizeof=8] double age_
data +0x160 [sizeof=8] double date_
data +0x168 [sizeof=8] double expires_
data +0x170 [sizeof=8] double last_modified_
data +0x178 [sizeof=8] __int64 app_cache_id_
data +0x180 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x1f0 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x200 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x210 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x218 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x228 [sizeof=8] __int64 response_time_
data +0x230 [sizeof=8] __int64 encoded_data_length_
data +0x238 [sizeof=8] __int64 encoded_body_length_
data +0x240 [sizeof=8] __int64 decoded_body_length_
data +0x248 [sizeof=8] WTF::String downloaded_file_path_
data +0x250 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x258 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x260 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
The total number of Resource instances is typically 200-500 depending on site so
the expected memory improvement is may be up to 100 KB per tab. But the change
is straightforward and low risk.
BUG=710933
==========
Description was changed from
==========
Class/struct layout optimization for blink Resource related classes
Reduces sizeof(Resource) by 160 bytes from 1632 bytes to 1472 bytes.
Also the following nested classes are optimized:
- ResourceRequest - 416 to 368 bytes
- ResourceResponse - 696 to 624 bytes
- ResourceLoaderOptions 112 to 88 bytes
The optimization is achieved by a combination of the following
methods:
1) Making enums based on uint8_t or int8_t which reduces their size
from 4 bytes to 1 byte.
2) Packing smaller sizing fields together forming 8 byte groups of
fields to avoid padding.
3) Grouping bitfields together - disperse bitfields waste a lot of
space due to padding
Here is an example of optimization.
Before:
class blink::ResourceResponse [sizeof = 696] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] int http_status_code_
<padding> (4 bytes)
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=1] bool was_cached_ : 1
<padding> (3 bytes)
data +0xb4 [sizeof=4] unsigned int connection_id_
data +0xb8 [sizeof=1] bool connection_reused_ : 1
<padding> (7 bytes)
data +0xc0 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0xc8 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0xd0 [sizeof=1] bool is_null_ : 1
<padding> (7 bytes)
data +0xd8 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0xe8 [sizeof=1] bool have_parsed_age_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_date_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_last_modified_header_ : 1
<padding> (7 bytes)
data +0xf0 [sizeof=8] double age_
data +0xf8 [sizeof=8] double date_
data +0x100 [sizeof=8] double expires_
data +0x108 [sizeof=8] double last_modified_
data +0x110 [sizeof=1] bool has_major_certificate_errors_
<padding> (3 bytes)
data +0x114 [sizeof=4] blink::ResourceResponse::SecurityStyle
security_style_
data +0x118 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x190 [sizeof=4] blink::ResourceResponse::HTTPVersion http_version_
<padding> (4 bytes)
data +0x198 [sizeof=8] __int64 app_cache_id_
data +0x1a0 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x210 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x220 [sizeof=1] bool was_fetched_via_spdy_
data +0x221 [sizeof=1] bool was_fetched_via_proxy_
data +0x222 [sizeof=1] bool was_fetched_via_service_worker_
data +0x223 [sizeof=1] bool was_fetched_via_foreign_fetch_
data +0x224 [sizeof=1] bool was_fallback_required_by_service_worker_
<padding> (3 bytes)
data +0x228 [sizeof=4] blink::WebServiceWorkerResponseType
service_worker_response_type_
<padding> (4 bytes)
data +0x230 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x240 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x248 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x258 [sizeof=1] bool did_service_worker_navigation_preload_
<padding> (7 bytes)
data +0x260 [sizeof=8] __int64 response_time_
data +0x268 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0x270 [sizeof=2] unsigned short remote_port_
<padding> (6 bytes)
data +0x278 [sizeof=8] __int64 encoded_data_length_
data +0x280 [sizeof=8] __int64 encoded_body_length_
data +0x288 [sizeof=8] __int64 decoded_body_length_
data +0x290 [sizeof=8] WTF::String downloaded_file_path_
data +0x298 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x2a0 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x2a8 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
After:
class blink::ResourceResponse [sizeof = 624] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] unsigned int connection_id_
data +0x8c [sizeof=4] int http_status_code_
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0xb8 [sizeof=2] unsigned short remote_port_
data +0xba [sizeof=1] bool was_cached_ : 1
data +0xba [sizeof=1] bool connection_reused_ : 1
data +0xba [sizeof=1] bool is_null_ : 1
data +0xba [sizeof=1] bool have_parsed_age_header_ : 1
data +0xba [sizeof=1] bool have_parsed_date_header_ : 1
data +0xba [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xba [sizeof=1] bool have_parsed_last_modified_header_ : 1
data +0xba [sizeof=1] bool has_major_certificate_errors_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_spdy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_proxy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_service_worker_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_foreign_fetch_ : 1
data +0xbb [sizeof=1] bool was_fallback_required_by_service_worker_ : 1
data +0xbb [sizeof=1] bool did_service_worker_navigation_preload_ : 1
data +0xbc [sizeof=1] blink::WebServiceWorkerResponseType
service_worker_response_type_
data +0xbd [sizeof=1] blink::ResourceResponse::HTTPVersion http_version_
data +0xbe [sizeof=1] blink::ResourceResponse::SecurityStyle
security_style_
<padding> (1 bytes)
data +0xc0 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x138 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0x140 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0x148 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0x158 [sizeof=8] double age_
data +0x160 [sizeof=8] double date_
data +0x168 [sizeof=8] double expires_
data +0x170 [sizeof=8] double last_modified_
data +0x178 [sizeof=8] __int64 app_cache_id_
data +0x180 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x1f0 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x200 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x210 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x218 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x228 [sizeof=8] __int64 response_time_
data +0x230 [sizeof=8] __int64 encoded_data_length_
data +0x238 [sizeof=8] __int64 encoded_body_length_
data +0x240 [sizeof=8] __int64 decoded_body_length_
data +0x248 [sizeof=8] WTF::String downloaded_file_path_
data +0x250 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x258 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x260 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
The total number of Resource instances is typically 200-500 depending on site so
the expected memory improvement is may be up to 100 KB per tab. But the change
is straightforward and low risk.
BUG=710933
==========
to
==========
Class/struct layout optimization for blink Resource related classes
Reduces sizeof(Resource) by 160 bytes from 1632 bytes to 1472 bytes.
Also the following nested classes are optimized:
- ResourceRequest - 416 to 368 bytes
- ResourceResponse - 696 to 624 bytes
- ResourceLoaderOptions 112 to 88 bytes
The optimization is achieved by a combination of the following
methods:
1) Making enums based on uint8_t or int8_t which reduces their size
from 4 bytes to 1 byte.
2) Packing smaller sizing fields together forming 8 byte groups of
fields to avoid padding.
3) Grouping bitfields together - disperse bitfields waste a lot of
space due to padding
The total number of Resource instances is typically 200-500 depending on site so
the expected memory improvement is may be up to 100 KB per tab. But the change
is straightforward and low risk.
Here is an example of optimization.
Before:
class blink::ResourceResponse [sizeof = 696] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] int http_status_code_
<padding> (4 bytes)
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=1] bool was_cached_ : 1
<padding> (3 bytes)
data +0xb4 [sizeof=4] unsigned int connection_id_
data +0xb8 [sizeof=1] bool connection_reused_ : 1
<padding> (7 bytes)
data +0xc0 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0xc8 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0xd0 [sizeof=1] bool is_null_ : 1
<padding> (7 bytes)
data +0xd8 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0xe8 [sizeof=1] bool have_parsed_age_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_date_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_last_modified_header_ : 1
<padding> (7 bytes)
data +0xf0 [sizeof=8] double age_
data +0xf8 [sizeof=8] double date_
data +0x100 [sizeof=8] double expires_
data +0x108 [sizeof=8] double last_modified_
data +0x110 [sizeof=1] bool has_major_certificate_errors_
<padding> (3 bytes)
data +0x114 [sizeof=4] blink::ResourceResponse::SecurityStyle
security_style_
data +0x118 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x190 [sizeof=4] blink::ResourceResponse::HTTPVersion http_version_
<padding> (4 bytes)
data +0x198 [sizeof=8] __int64 app_cache_id_
data +0x1a0 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x210 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x220 [sizeof=1] bool was_fetched_via_spdy_
data +0x221 [sizeof=1] bool was_fetched_via_proxy_
data +0x222 [sizeof=1] bool was_fetched_via_service_worker_
data +0x223 [sizeof=1] bool was_fetched_via_foreign_fetch_
data +0x224 [sizeof=1] bool was_fallback_required_by_service_worker_
<padding> (3 bytes)
data +0x228 [sizeof=4] blink::WebServiceWorkerResponseType
service_worker_response_type_
<padding> (4 bytes)
data +0x230 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x240 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x248 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x258 [sizeof=1] bool did_service_worker_navigation_preload_
<padding> (7 bytes)
data +0x260 [sizeof=8] __int64 response_time_
data +0x268 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0x270 [sizeof=2] unsigned short remote_port_
<padding> (6 bytes)
data +0x278 [sizeof=8] __int64 encoded_data_length_
data +0x280 [sizeof=8] __int64 encoded_body_length_
data +0x288 [sizeof=8] __int64 decoded_body_length_
data +0x290 [sizeof=8] WTF::String downloaded_file_path_
data +0x298 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x2a0 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x2a8 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
After:
class blink::ResourceResponse [sizeof = 624] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] unsigned int connection_id_
data +0x8c [sizeof=4] int http_status_code_
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0xb8 [sizeof=2] unsigned short remote_port_
data +0xba [sizeof=1] bool was_cached_ : 1
data +0xba [sizeof=1] bool connection_reused_ : 1
data +0xba [sizeof=1] bool is_null_ : 1
data +0xba [sizeof=1] bool have_parsed_age_header_ : 1
data +0xba [sizeof=1] bool have_parsed_date_header_ : 1
data +0xba [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xba [sizeof=1] bool have_parsed_last_modified_header_ : 1
data +0xba [sizeof=1] bool has_major_certificate_errors_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_spdy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_proxy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_service_worker_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_foreign_fetch_ : 1
data +0xbb [sizeof=1] bool was_fallback_required_by_service_worker_ : 1
data +0xbb [sizeof=1] bool did_service_worker_navigation_preload_ : 1
data +0xbc [sizeof=1] blink::WebServiceWorkerResponseType
service_worker_response_type_
data +0xbd [sizeof=1] blink::ResourceResponse::HTTPVersion http_version_
data +0xbe [sizeof=1] blink::ResourceResponse::SecurityStyle
security_style_
<padding> (1 bytes)
data +0xc0 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x138 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0x140 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0x148 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0x158 [sizeof=8] double age_
data +0x160 [sizeof=8] double date_
data +0x168 [sizeof=8] double expires_
data +0x170 [sizeof=8] double last_modified_
data +0x178 [sizeof=8] __int64 app_cache_id_
data +0x180 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x1f0 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x200 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x210 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x218 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x228 [sizeof=8] __int64 response_time_
data +0x230 [sizeof=8] __int64 encoded_data_length_
data +0x238 [sizeof=8] __int64 encoded_body_length_
data +0x240 [sizeof=8] __int64 decoded_body_length_
data +0x248 [sizeof=8] WTF::String downloaded_file_path_
data +0x250 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x258 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x260 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
BUG=710933
==========
Description was changed from
==========
Class/struct layout optimization for blink Resource related classes
Reduces sizeof(Resource) by 160 bytes from 1632 bytes to 1472 bytes.
Also the following nested classes are optimized:
- ResourceRequest - 416 to 368 bytes
- ResourceResponse - 696 to 624 bytes
- ResourceLoaderOptions 112 to 88 bytes
The optimization is achieved by a combination of the following
methods:
1) Making enums based on uint8_t or int8_t which reduces their size
from 4 bytes to 1 byte.
2) Packing smaller sizing fields together forming 8 byte groups of
fields to avoid padding.
3) Grouping bitfields together - disperse bitfields waste a lot of
space due to padding
The total number of Resource instances is typically 200-500 depending on site so
the expected memory improvement is may be up to 100 KB per tab. But the change
is straightforward and low risk.
Here is an example of optimization.
Before:
class blink::ResourceResponse [sizeof = 696] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] int http_status_code_
<padding> (4 bytes)
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=1] bool was_cached_ : 1
<padding> (3 bytes)
data +0xb4 [sizeof=4] unsigned int connection_id_
data +0xb8 [sizeof=1] bool connection_reused_ : 1
<padding> (7 bytes)
data +0xc0 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0xc8 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0xd0 [sizeof=1] bool is_null_ : 1
<padding> (7 bytes)
data +0xd8 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0xe8 [sizeof=1] bool have_parsed_age_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_date_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_last_modified_header_ : 1
<padding> (7 bytes)
data +0xf0 [sizeof=8] double age_
data +0xf8 [sizeof=8] double date_
data +0x100 [sizeof=8] double expires_
data +0x108 [sizeof=8] double last_modified_
data +0x110 [sizeof=1] bool has_major_certificate_errors_
<padding> (3 bytes)
data +0x114 [sizeof=4] blink::ResourceResponse::SecurityStyle
security_style_
data +0x118 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x190 [sizeof=4] blink::ResourceResponse::HTTPVersion http_version_
<padding> (4 bytes)
data +0x198 [sizeof=8] __int64 app_cache_id_
data +0x1a0 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x210 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x220 [sizeof=1] bool was_fetched_via_spdy_
data +0x221 [sizeof=1] bool was_fetched_via_proxy_
data +0x222 [sizeof=1] bool was_fetched_via_service_worker_
data +0x223 [sizeof=1] bool was_fetched_via_foreign_fetch_
data +0x224 [sizeof=1] bool was_fallback_required_by_service_worker_
<padding> (3 bytes)
data +0x228 [sizeof=4] blink::WebServiceWorkerResponseType
service_worker_response_type_
<padding> (4 bytes)
data +0x230 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x240 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x248 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x258 [sizeof=1] bool did_service_worker_navigation_preload_
<padding> (7 bytes)
data +0x260 [sizeof=8] __int64 response_time_
data +0x268 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0x270 [sizeof=2] unsigned short remote_port_
<padding> (6 bytes)
data +0x278 [sizeof=8] __int64 encoded_data_length_
data +0x280 [sizeof=8] __int64 encoded_body_length_
data +0x288 [sizeof=8] __int64 decoded_body_length_
data +0x290 [sizeof=8] WTF::String downloaded_file_path_
data +0x298 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x2a0 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x2a8 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
After:
class blink::ResourceResponse [sizeof = 624] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] unsigned int connection_id_
data +0x8c [sizeof=4] int http_status_code_
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0xb8 [sizeof=2] unsigned short remote_port_
data +0xba [sizeof=1] bool was_cached_ : 1
data +0xba [sizeof=1] bool connection_reused_ : 1
data +0xba [sizeof=1] bool is_null_ : 1
data +0xba [sizeof=1] bool have_parsed_age_header_ : 1
data +0xba [sizeof=1] bool have_parsed_date_header_ : 1
data +0xba [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xba [sizeof=1] bool have_parsed_last_modified_header_ : 1
data +0xba [sizeof=1] bool has_major_certificate_errors_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_spdy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_proxy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_service_worker_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_foreign_fetch_ : 1
data +0xbb [sizeof=1] bool was_fallback_required_by_service_worker_ : 1
data +0xbb [sizeof=1] bool did_service_worker_navigation_preload_ : 1
data +0xbc [sizeof=1] blink::WebServiceWorkerResponseType
service_worker_response_type_
data +0xbd [sizeof=1] blink::ResourceResponse::HTTPVersion http_version_
data +0xbe [sizeof=1] blink::ResourceResponse::SecurityStyle
security_style_
<padding> (1 bytes)
data +0xc0 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x138 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0x140 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0x148 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0x158 [sizeof=8] double age_
data +0x160 [sizeof=8] double date_
data +0x168 [sizeof=8] double expires_
data +0x170 [sizeof=8] double last_modified_
data +0x178 [sizeof=8] __int64 app_cache_id_
data +0x180 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x1f0 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x200 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x210 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x218 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x228 [sizeof=8] __int64 response_time_
data +0x230 [sizeof=8] __int64 encoded_data_length_
data +0x238 [sizeof=8] __int64 encoded_body_length_
data +0x240 [sizeof=8] __int64 decoded_body_length_
data +0x248 [sizeof=8] WTF::String downloaded_file_path_
data +0x250 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x258 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x260 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
BUG=710933
==========
to
==========
Class/struct layout optimization for blink Resource related classes
Reduces sizeof(Resource) by 160 bytes from 1632 bytes to 1472 bytes.
Also the following nested classes are optimized:
- ResourceRequest - 416 to 368 bytes
- ResourceResponse - 696 to 624 bytes
- ResourceLoaderOptions 112 to 88 bytes
The optimization is achieved by a combination of the following
methods:
1) Making enums based on uint8_t or int8_t which reduces their size
from 4 bytes to 1 byte.
2) Packing smaller sizing fields together forming 8 byte groups of
fields to avoid padding.
3) Grouping bitfields together - disperse bitfields waste a lot of
space due to padding
The total number of Resource instances is typically 200-500
depending on site so the expected memory improvement is may be up to
100 KB per tab. But the change is straightforward and low risk.
Here is an example of optimization.
Before:
class blink::ResourceResponse [sizeof = 696] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] int http_status_code_
<padding> (4 bytes)
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=1] bool was_cached_ : 1
<padding> (3 bytes)
data +0xb4 [sizeof=4] unsigned int connection_id_
data +0xb8 [sizeof=1] bool connection_reused_ : 1
<padding> (7 bytes)
data +0xc0 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0xc8 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0xd0 [sizeof=1] bool is_null_ : 1
<padding> (7 bytes)
data +0xd8 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0xe8 [sizeof=1] bool have_parsed_age_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_date_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_last_modified_header_ : 1
<padding> (7 bytes)
data +0xf0 [sizeof=8] double age_
data +0xf8 [sizeof=8] double date_
data +0x100 [sizeof=8] double expires_
data +0x108 [sizeof=8] double last_modified_
data +0x110 [sizeof=1] bool has_major_certificate_errors_
<padding> (3 bytes)
data +0x114 [sizeof=4] blink::ResourceResponse::SecurityStyle
security_style_
data +0x118 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x190 [sizeof=4] blink::ResourceResponse::HTTPVersion http_version_
<padding> (4 bytes)
data +0x198 [sizeof=8] __int64 app_cache_id_
data +0x1a0 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x210 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x220 [sizeof=1] bool was_fetched_via_spdy_
data +0x221 [sizeof=1] bool was_fetched_via_proxy_
data +0x222 [sizeof=1] bool was_fetched_via_service_worker_
data +0x223 [sizeof=1] bool was_fetched_via_foreign_fetch_
data +0x224 [sizeof=1] bool was_fallback_required_by_service_worker_
<padding> (3 bytes)
data +0x228 [sizeof=4] blink::WebServiceWorkerResponseType
service_worker_response_type_
<padding> (4 bytes)
data +0x230 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x240 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x248 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x258 [sizeof=1] bool did_service_worker_navigation_preload_
<padding> (7 bytes)
data +0x260 [sizeof=8] __int64 response_time_
data +0x268 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0x270 [sizeof=2] unsigned short remote_port_
<padding> (6 bytes)
data +0x278 [sizeof=8] __int64 encoded_data_length_
data +0x280 [sizeof=8] __int64 encoded_body_length_
data +0x288 [sizeof=8] __int64 decoded_body_length_
data +0x290 [sizeof=8] WTF::String downloaded_file_path_
data +0x298 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x2a0 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x2a8 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
After:
class blink::ResourceResponse [sizeof = 624] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] unsigned int connection_id_
data +0x8c [sizeof=4] int http_status_code_
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0xb8 [sizeof=2] unsigned short remote_port_
data +0xba [sizeof=1] bool was_cached_ : 1
data +0xba [sizeof=1] bool connection_reused_ : 1
data +0xba [sizeof=1] bool is_null_ : 1
data +0xba [sizeof=1] bool have_parsed_age_header_ : 1
data +0xba [sizeof=1] bool have_parsed_date_header_ : 1
data +0xba [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xba [sizeof=1] bool have_parsed_last_modified_header_ : 1
data +0xba [sizeof=1] bool has_major_certificate_errors_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_spdy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_proxy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_service_worker_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_foreign_fetch_ : 1
data +0xbb [sizeof=1] bool was_fallback_required_by_service_worker_ : 1
data +0xbb [sizeof=1] bool did_service_worker_navigation_preload_ : 1
data +0xbc [sizeof=1] blink::WebServiceWorkerResponseType
service_worker_response_type_
data +0xbd [sizeof=1] blink::ResourceResponse::HTTPVersion http_version_
data +0xbe [sizeof=1] blink::ResourceResponse::SecurityStyle
security_style_
<padding> (1 bytes)
data +0xc0 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x138 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0x140 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0x148 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0x158 [sizeof=8] double age_
data +0x160 [sizeof=8] double date_
data +0x168 [sizeof=8] double expires_
data +0x170 [sizeof=8] double last_modified_
data +0x178 [sizeof=8] __int64 app_cache_id_
data +0x180 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x1f0 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x200 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x210 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x218 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x228 [sizeof=8] __int64 response_time_
data +0x230 [sizeof=8] __int64 encoded_data_length_
data +0x238 [sizeof=8] __int64 encoded_body_length_
data +0x240 [sizeof=8] __int64 decoded_body_length_
data +0x248 [sizeof=8] WTF::String downloaded_file_path_
data +0x250 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x258 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x260 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
BUG=710933
==========
One more question- I'm fine with this change ifself if this doesn't make readability worse, but we're likely break the ordering again and this optimization might just blow away pretty quickly. Are we going to have some mechanism to detect that or is this just one-off optimization? If latter is the case I might still wonder if it's really worth doing.
On 2017/06/06 22:47:55, stanisc wrote: > +noel@ for WebKit/Source/platform japhet@ would be the appropriate reviewer for platform/loader.
On 2017/06/09 04:12:32, kinuko wrote: > One more question- I'm fine with this change ifself if this doesn't make > readability worse, but we're likely break the ordering again and this > optimization might just blow away pretty quickly. Are we going to have some > mechanism to detect that or is this just one-off optimization? If latter is the > case I might still wonder if it's really worth doing. +brucedawson@chromium.org Some ideas have been discussed in the linked bug, but for now this is a one-off optimization. We have a tool that produces an output like the one included in the description and some scripts to narrow down on more interesting classes. So I've been going after a few selected classes with higher number of instances where the optimization would be worthwhile. See the bug for previous patches. This particular patch is borderline worthwhile (the memory improvement is modest) and I was going to stop after that and reassess later when we have better tools for heap profiling.
+brucedawson@
On 2017/06/09 18:48:07, stanisc wrote: > +brucedawson@ I definitely understand the concerns about this just regressing again and therefore having marginal benefit. Unfortunately it would be a lot of effort to ensure perfectly packed classes throughout Chromium. A warning that fired when there was more than sizeof(void*)-1 bytes of padding would be useful but I don't think it exists. Even then I think we'd just want to turn it on for some parts of the code. It seems like the biggest sources of inefficiency was bool and bool : 1 types (I'm looking at ResourceResponse.h) that ended up misplaced. While not a perfect solution perhaps a comment at the top of the bool and bool : 1 blocks would help to remind future maintainers not to toss them in randomly.
LGTM It will likely regress without monitoring (which I'm cautiously optimistic we can eventually warn about automatically), but doing something seems strictly better than doing nothing.
(I just want to make sure that we balance out logical grouping of fields with not wasting excessive padding. But I think this CL did a good job of that, with the caveat that I'm not the resource loading expert)
content/ LGTM
On 2017/06/09 18:45:29, stanisc wrote: > On 2017/06/09 04:12:32, kinuko wrote: > > One more question- I'm fine with this change ifself if this doesn't make > > readability worse, but we're likely break the ordering again and this > > optimization might just blow away pretty quickly. Are we going to have some > > mechanism to detect that or is this just one-off optimization? If latter is > the > > case I might still wonder if it's really worth doing. > > https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=+brucedawson@chromium.org > > Some ideas have been discussed in the linked bug, but for now this is a one-off > optimization. We have a tool that produces an output like the one included in > the description and some scripts to narrow down on more interesting classes. > So I've been going after a few selected classes with higher number of instances > where the optimization would be worthwhile. See the bug for previous patches. > This particular patch is borderline worthwhile (the memory improvement is > modest) > and I was going to stop after that and reassess later when we have better tools > for > heap profiling. ok, lgtm. Thanks!
The CQ bit was checked by stanisc@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from kinuko@chromium.org, alexmos@chromium.org, dcheng@chromium.org Link to the patchset: https://codereview.chromium.org/2920663002/#ps100001 (title: "Rebase")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 100001, "attempt_start_ts": 1497548600612730,
"parent_rev": "5c36dc747da0feb63a206edaf0dfc470471ade20", "commit_rev":
"a8599ca28499cb5770adc9219857b3a0dff4b90b"}
Message was sent while issue was closed.
Description was changed from
==========
Class/struct layout optimization for blink Resource related classes
Reduces sizeof(Resource) by 160 bytes from 1632 bytes to 1472 bytes.
Also the following nested classes are optimized:
- ResourceRequest - 416 to 368 bytes
- ResourceResponse - 696 to 624 bytes
- ResourceLoaderOptions 112 to 88 bytes
The optimization is achieved by a combination of the following
methods:
1) Making enums based on uint8_t or int8_t which reduces their size
from 4 bytes to 1 byte.
2) Packing smaller sizing fields together forming 8 byte groups of
fields to avoid padding.
3) Grouping bitfields together - disperse bitfields waste a lot of
space due to padding
The total number of Resource instances is typically 200-500
depending on site so the expected memory improvement is may be up to
100 KB per tab. But the change is straightforward and low risk.
Here is an example of optimization.
Before:
class blink::ResourceResponse [sizeof = 696] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] int http_status_code_
<padding> (4 bytes)
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=1] bool was_cached_ : 1
<padding> (3 bytes)
data +0xb4 [sizeof=4] unsigned int connection_id_
data +0xb8 [sizeof=1] bool connection_reused_ : 1
<padding> (7 bytes)
data +0xc0 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0xc8 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0xd0 [sizeof=1] bool is_null_ : 1
<padding> (7 bytes)
data +0xd8 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0xe8 [sizeof=1] bool have_parsed_age_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_date_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_last_modified_header_ : 1
<padding> (7 bytes)
data +0xf0 [sizeof=8] double age_
data +0xf8 [sizeof=8] double date_
data +0x100 [sizeof=8] double expires_
data +0x108 [sizeof=8] double last_modified_
data +0x110 [sizeof=1] bool has_major_certificate_errors_
<padding> (3 bytes)
data +0x114 [sizeof=4] blink::ResourceResponse::SecurityStyle
security_style_
data +0x118 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x190 [sizeof=4] blink::ResourceResponse::HTTPVersion http_version_
<padding> (4 bytes)
data +0x198 [sizeof=8] __int64 app_cache_id_
data +0x1a0 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x210 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x220 [sizeof=1] bool was_fetched_via_spdy_
data +0x221 [sizeof=1] bool was_fetched_via_proxy_
data +0x222 [sizeof=1] bool was_fetched_via_service_worker_
data +0x223 [sizeof=1] bool was_fetched_via_foreign_fetch_
data +0x224 [sizeof=1] bool was_fallback_required_by_service_worker_
<padding> (3 bytes)
data +0x228 [sizeof=4] blink::WebServiceWorkerResponseType
service_worker_response_type_
<padding> (4 bytes)
data +0x230 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x240 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x248 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x258 [sizeof=1] bool did_service_worker_navigation_preload_
<padding> (7 bytes)
data +0x260 [sizeof=8] __int64 response_time_
data +0x268 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0x270 [sizeof=2] unsigned short remote_port_
<padding> (6 bytes)
data +0x278 [sizeof=8] __int64 encoded_data_length_
data +0x280 [sizeof=8] __int64 encoded_body_length_
data +0x288 [sizeof=8] __int64 decoded_body_length_
data +0x290 [sizeof=8] WTF::String downloaded_file_path_
data +0x298 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x2a0 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x2a8 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
After:
class blink::ResourceResponse [sizeof = 624] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] unsigned int connection_id_
data +0x8c [sizeof=4] int http_status_code_
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0xb8 [sizeof=2] unsigned short remote_port_
data +0xba [sizeof=1] bool was_cached_ : 1
data +0xba [sizeof=1] bool connection_reused_ : 1
data +0xba [sizeof=1] bool is_null_ : 1
data +0xba [sizeof=1] bool have_parsed_age_header_ : 1
data +0xba [sizeof=1] bool have_parsed_date_header_ : 1
data +0xba [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xba [sizeof=1] bool have_parsed_last_modified_header_ : 1
data +0xba [sizeof=1] bool has_major_certificate_errors_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_spdy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_proxy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_service_worker_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_foreign_fetch_ : 1
data +0xbb [sizeof=1] bool was_fallback_required_by_service_worker_ : 1
data +0xbb [sizeof=1] bool did_service_worker_navigation_preload_ : 1
data +0xbc [sizeof=1] blink::WebServiceWorkerResponseType
service_worker_response_type_
data +0xbd [sizeof=1] blink::ResourceResponse::HTTPVersion http_version_
data +0xbe [sizeof=1] blink::ResourceResponse::SecurityStyle
security_style_
<padding> (1 bytes)
data +0xc0 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x138 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0x140 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0x148 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0x158 [sizeof=8] double age_
data +0x160 [sizeof=8] double date_
data +0x168 [sizeof=8] double expires_
data +0x170 [sizeof=8] double last_modified_
data +0x178 [sizeof=8] __int64 app_cache_id_
data +0x180 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x1f0 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x200 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x210 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x218 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x228 [sizeof=8] __int64 response_time_
data +0x230 [sizeof=8] __int64 encoded_data_length_
data +0x238 [sizeof=8] __int64 encoded_body_length_
data +0x240 [sizeof=8] __int64 decoded_body_length_
data +0x248 [sizeof=8] WTF::String downloaded_file_path_
data +0x250 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x258 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x260 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
BUG=710933
==========
to
==========
Class/struct layout optimization for blink Resource related classes
Reduces sizeof(Resource) by 160 bytes from 1632 bytes to 1472 bytes.
Also the following nested classes are optimized:
- ResourceRequest - 416 to 368 bytes
- ResourceResponse - 696 to 624 bytes
- ResourceLoaderOptions 112 to 88 bytes
The optimization is achieved by a combination of the following
methods:
1) Making enums based on uint8_t or int8_t which reduces their size
from 4 bytes to 1 byte.
2) Packing smaller sizing fields together forming 8 byte groups of
fields to avoid padding.
3) Grouping bitfields together - disperse bitfields waste a lot of
space due to padding
The total number of Resource instances is typically 200-500
depending on site so the expected memory improvement is may be up to
100 KB per tab. But the change is straightforward and low risk.
Here is an example of optimization.
Before:
class blink::ResourceResponse [sizeof = 696] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] int http_status_code_
<padding> (4 bytes)
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=1] bool was_cached_ : 1
<padding> (3 bytes)
data +0xb4 [sizeof=4] unsigned int connection_id_
data +0xb8 [sizeof=1] bool connection_reused_ : 1
<padding> (7 bytes)
data +0xc0 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0xc8 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0xd0 [sizeof=1] bool is_null_ : 1
<padding> (7 bytes)
data +0xd8 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0xe8 [sizeof=1] bool have_parsed_age_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_date_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xe8 [sizeof=1] bool have_parsed_last_modified_header_ : 1
<padding> (7 bytes)
data +0xf0 [sizeof=8] double age_
data +0xf8 [sizeof=8] double date_
data +0x100 [sizeof=8] double expires_
data +0x108 [sizeof=8] double last_modified_
data +0x110 [sizeof=1] bool has_major_certificate_errors_
<padding> (3 bytes)
data +0x114 [sizeof=4] blink::ResourceResponse::SecurityStyle
security_style_
data +0x118 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x190 [sizeof=4] blink::ResourceResponse::HTTPVersion http_version_
<padding> (4 bytes)
data +0x198 [sizeof=8] __int64 app_cache_id_
data +0x1a0 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x210 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x220 [sizeof=1] bool was_fetched_via_spdy_
data +0x221 [sizeof=1] bool was_fetched_via_proxy_
data +0x222 [sizeof=1] bool was_fetched_via_service_worker_
data +0x223 [sizeof=1] bool was_fetched_via_foreign_fetch_
data +0x224 [sizeof=1] bool was_fallback_required_by_service_worker_
<padding> (3 bytes)
data +0x228 [sizeof=4] blink::WebServiceWorkerResponseType
service_worker_response_type_
<padding> (4 bytes)
data +0x230 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x240 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x248 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x258 [sizeof=1] bool did_service_worker_navigation_preload_
<padding> (7 bytes)
data +0x260 [sizeof=8] __int64 response_time_
data +0x268 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0x270 [sizeof=2] unsigned short remote_port_
<padding> (6 bytes)
data +0x278 [sizeof=8] __int64 encoded_data_length_
data +0x280 [sizeof=8] __int64 encoded_body_length_
data +0x288 [sizeof=8] __int64 decoded_body_length_
data +0x290 [sizeof=8] WTF::String downloaded_file_path_
data +0x298 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x2a0 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x2a8 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
After:
class blink::ResourceResponse [sizeof = 624] {
data +0x00 [sizeof=112] blink::KURL url_
data +0x70 [sizeof=8] WTF::AtomicString mime_type_
data +0x78 [sizeof=8] __int64 expected_content_length_
data +0x80 [sizeof=8] WTF::AtomicString text_encoding_name_
data +0x88 [sizeof=4] unsigned int connection_id_
data +0x8c [sizeof=4] int http_status_code_
data +0x90 [sizeof=8] WTF::AtomicString http_status_text_
data +0x98 [sizeof=24] blink::HTTPHeaderMap http_header_fields_
data +0xb0 [sizeof=8] WTF::AtomicString remote_ip_address_
data +0xb8 [sizeof=2] unsigned short remote_port_
data +0xba [sizeof=1] bool was_cached_ : 1
data +0xba [sizeof=1] bool connection_reused_ : 1
data +0xba [sizeof=1] bool is_null_ : 1
data +0xba [sizeof=1] bool have_parsed_age_header_ : 1
data +0xba [sizeof=1] bool have_parsed_date_header_ : 1
data +0xba [sizeof=1] bool have_parsed_expires_header_ : 1
data +0xba [sizeof=1] bool have_parsed_last_modified_header_ : 1
data +0xba [sizeof=1] bool has_major_certificate_errors_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_spdy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_proxy_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_service_worker_ : 1
data +0xbb [sizeof=1] bool was_fetched_via_foreign_fetch_ : 1
data +0xbb [sizeof=1] bool was_fallback_required_by_service_worker_ : 1
data +0xbb [sizeof=1] bool did_service_worker_navigation_preload_ : 1
data +0xbc [sizeof=1] blink::WebServiceWorkerResponseType
service_worker_response_type_
data +0xbd [sizeof=1] blink::ResourceResponse::HTTPVersion http_version_
data +0xbe [sizeof=1] blink::ResourceResponse::SecurityStyle
security_style_
<padding> (1 bytes)
data +0xc0 [sizeof=120] blink::ResourceResponse::SecurityDetails
security_details_
data +0x138 [sizeof=8] WTF::RefPtr<blink::ResourceLoadTiming>
resource_load_timing_
data +0x140 [sizeof=8] WTF::RefPtr<blink::ResourceLoadInfo>
resource_load_info_
data +0x148 [sizeof=16] blink::CacheControlHeader cache_control_header_
data +0x158 [sizeof=8] double age_
data +0x160 [sizeof=8] double date_
data +0x168 [sizeof=8] double expires_
data +0x170 [sizeof=8] double last_modified_
data +0x178 [sizeof=8] __int64 app_cache_id_
data +0x180 [sizeof=112] blink::KURL app_cache_manifest_url_
data +0x1f0 [sizeof=16] WTF::Vector<char,0,WTF::PartitionAllocator>
multipart_boundary_
data +0x200 [sizeof=16] WTF::Vector<blink::KURL,0,WTF::PartitionAllocator>
url_list_via_service_worker_
data +0x210 [sizeof=8] WTF::String cache_storage_cache_name_
data +0x218 [sizeof=16] WTF::Vector<WTF::String,0,WTF::PartitionAllocator>
cors_exposed_header_names_
data +0x228 [sizeof=8] __int64 response_time_
data +0x230 [sizeof=8] __int64 encoded_data_length_
data +0x238 [sizeof=8] __int64 encoded_body_length_
data +0x240 [sizeof=8] __int64 decoded_body_length_
data +0x248 [sizeof=8] WTF::String downloaded_file_path_
data +0x250 [sizeof=8] WTF::RefPtr<blink::BlobDataHandle>
downloaded_file_handle_
data +0x258 [sizeof=8] WTF::RefPtr<blink::ResourceResponse::ExtraData>
extra_data_
data +0x260 [sizeof=16]
WTF::Vector<blink::ResourceResponse,0,WTF::PartitionAllocator>
redirect_responses_
}
BUG=710933
Review-Url: https://codereview.chromium.org/2920663002
Cr-Commit-Position: refs/heads/master@{#479798}
Committed:
https://chromium.googlesource.com/chromium/src/+/a8599ca28499cb5770adc9219857...
==========
Message was sent while issue was closed.
Committed patchset #4 (id:100001) as https://chromium.googlesource.com/chromium/src/+/a8599ca28499cb5770adc9219857... |
