The overhead of DevTools protocol and network interception when using interception to replace the network layer is damn too high!
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/0fc99ad6b4abe0d8b564fc65bb284d741a19fb5a commit 0fc99ad6b4abe0d8b564fc65bb284d741a19fb5a Author: Andrey Kosyakov <caseq@chromium.org> Date: Tue Nov 06 19:51:39 2018 Reduce number of copies when handling continueInterceptedRequest Expose RefCountedMemory from protocol::Binary and pass it all the way down to interceptor. Bug: 901395 Change-Id: Ic684d5b35742922e5893b17b72763157df3f4dca Reviewed-on: https://chromium-review.googlesource.com/c/1315937 Commit-Queue: Andrey Kosyakov <caseq@chromium.org> Reviewed-by: Dmitry Gozman <dgozman@chromium.org> Cr-Commit-Position: refs/heads/master@{#605791} [modify] https://crrev.com/0fc99ad6b4abe0d8b564fc65bb284d741a19fb5a/content/browser/devtools/devtools_network_interceptor.cc [modify] https://crrev.com/0fc99ad6b4abe0d8b564fc65bb284d741a19fb5a/content/browser/devtools/devtools_network_interceptor.h [modify] https://crrev.com/0fc99ad6b4abe0d8b564fc65bb284d741a19fb5a/content/browser/devtools/devtools_url_interceptor_request_job.cc [modify] https://crrev.com/0fc99ad6b4abe0d8b564fc65bb284d741a19fb5a/content/browser/devtools/devtools_url_loader_interceptor.cc [modify] https://crrev.com/0fc99ad6b4abe0d8b564fc65bb284d741a19fb5a/content/browser/devtools/protocol/fetch_handler.cc [modify] https://crrev.com/0fc99ad6b4abe0d8b564fc65bb284d741a19fb5a/content/browser/devtools/protocol/network_handler.cc [modify] https://crrev.com/0fc99ad6b4abe0d8b564fc65bb284d741a19fb5a/content/browser/devtools/protocol_string.h
The following revision refers to this bug: https://chromium.googlesource.com/deps/inspector_protocol/+/8bdfb3cb7cd2bedc6ebbb385386fe0f3d0f7ce9b commit 8bdfb3cb7cd2bedc6ebbb385386fe0f3d0f7ce9b Author: Andrey Kosyakov <caseq@chromium.org> Date: Tue Nov 13 19:16:53 2018 Remove copying in protocol type conversion Remove all the cloning we used to do, make all conversions move-only and introduce methods to take value from Value. Bug: 901395 Change-Id: Ib9ac9782d5c1441e5e31df250bf4b23f20075f4b [modify] https://crrev.com/8bdfb3cb7cd2bedc6ebbb385386fe0f3d0f7ce9b/lib/Object_h.template [modify] https://crrev.com/8bdfb3cb7cd2bedc6ebbb385386fe0f3d0f7ce9b/lib/Array_h.template [modify] https://crrev.com/8bdfb3cb7cd2bedc6ebbb385386fe0f3d0f7ce9b/lib/Object_cpp.template [modify] https://crrev.com/8bdfb3cb7cd2bedc6ebbb385386fe0f3d0f7ce9b/templates/TypeBuilder_h.template [modify] https://crrev.com/8bdfb3cb7cd2bedc6ebbb385386fe0f3d0f7ce9b/templates/Imported_h.template [modify] https://crrev.com/8bdfb3cb7cd2bedc6ebbb385386fe0f3d0f7ce9b/templates/Exported_h.template [modify] https://crrev.com/8bdfb3cb7cd2bedc6ebbb385386fe0f3d0f7ce9b/lib/ValueConversions_h.template [modify] https://crrev.com/8bdfb3cb7cd2bedc6ebbb385386fe0f3d0f7ce9b/templates/TypeBuilder_cpp.template [modify] https://crrev.com/8bdfb3cb7cd2bedc6ebbb385386fe0f3d0f7ce9b/lib/Values_cpp.template [modify] https://crrev.com/8bdfb3cb7cd2bedc6ebbb385386fe0f3d0f7ce9b/lib/Values_h.template
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/eec9f90359dfd9baede51aa2adfe63ae0772d7d2 commit eec9f90359dfd9baede51aa2adfe63ae0772d7d2 Author: Andrey Kosyakov <caseq@chromium.org> Date: Fri Dec 28 19:28:12 2018 DevTools: avoid cloning interface pointers to factory and cookie mgr Bug: 901395 Change-Id: I8a4827e80e69fdfcf3b779998e4268ee45882cb5 Reviewed-on: https://chromium-review.googlesource.com/c/1391734 Reviewed-by: Dmitry Gozman <dgozman@chromium.org> Commit-Queue: Andrey Kosyakov <caseq@chromium.org> Cr-Commit-Position: refs/heads/master@{#619178} [modify] https://crrev.com/eec9f90359dfd9baede51aa2adfe63ae0772d7d2/content/browser/devtools/devtools_url_loader_interceptor.cc
The following revision refers to this bug: https://chromium.googlesource.com/deps/inspector_protocol/+/fdbdb154336fc1f15a0a6775349dd90243b8d3fc commit fdbdb154336fc1f15a0a6775349dd90243b8d3fc Author: Johannes Henkel <johannes@chromium.org> Date: Wed Jan 16 00:13:12 2019 Revert "Remove copying in protocol type conversion" This reverts commit 8bdfb3cb7cd2bedc6ebbb385386fe0f3d0f7ce9b. Unfortunately landing this ran into problems with increased binary sizes (on Android?); we should revisit this or something similar later. Bug: 901395 Change-Id: I2fe022d925b5f500cc20a067f33688a2a98de6ac [modify] https://crrev.com/fdbdb154336fc1f15a0a6775349dd90243b8d3fc/lib/Object_h.template [modify] https://crrev.com/fdbdb154336fc1f15a0a6775349dd90243b8d3fc/lib/Array_h.template [modify] https://crrev.com/fdbdb154336fc1f15a0a6775349dd90243b8d3fc/lib/Object_cpp.template [modify] https://crrev.com/fdbdb154336fc1f15a0a6775349dd90243b8d3fc/templates/TypeBuilder_h.template [modify] https://crrev.com/fdbdb154336fc1f15a0a6775349dd90243b8d3fc/templates/Imported_h.template [modify] https://crrev.com/fdbdb154336fc1f15a0a6775349dd90243b8d3fc/templates/Exported_h.template [modify] https://crrev.com/fdbdb154336fc1f15a0a6775349dd90243b8d3fc/lib/ValueConversions_h.template [modify] https://crrev.com/fdbdb154336fc1f15a0a6775349dd90243b8d3fc/templates/TypeBuilder_cpp.template [modify] https://crrev.com/fdbdb154336fc1f15a0a6775349dd90243b8d3fc/lib/Values_cpp.template [modify] https://crrev.com/fdbdb154336fc1f15a0a6775349dd90243b8d3fc/lib/Values_h.template
Comment 1 by bugdroid1@chromium.org
, Nov 6