New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 614457 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: May 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

InspectorInstrumentation::NativeBreakpoint causes string allocations everywhere

Project Member Reported by esprehn@chromium.org, May 24 2016

Issue description

Google Chrome	52.0.2743.0 (Official Build) canary (64-bit)
Revision	2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}

NativeBreakpoint takes a const String&, but everywhere its used callers pass a literal string, ex.

InspectorInstrumentation::NativeBreakpoint nativeBreakpoint(m_context, "requestAnimationFrame", true);

this means we end up mallocing a temporary string just to pass into the NativeBreakpoint only to discard it whenever the inspector is not open. Near as I can tell this string is only used to concat with another string when the inspector is open too?

This shows up in lots of profiles as string mallocs all over various things. NativeBreakpoint should take a const char* instead. :)
 
Owner: kozyatinskiy@chromium.org
Status: Assigned (was: Untriaged)
Yeah, thanks for the heads up.
Project Member

Comment 2 by bugdroid1@chromium.org, May 25 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/87a0cc1f353d4607abd5e7c948c2d05f2243a4a8

commit 87a0cc1f353d4607abd5e7c948c2d05f2243a4a8
Author: kozyatinskiy <kozyatinskiy@chromium.org>
Date: Wed May 25 20:39:13 2016

[DevTools] Change name type in NativeBreakpoint to raw string

All callers pass raw pointer as argument. We can avoid String allocation for each call when inspector is closed.

BUG= 614457 
R=dgozman@chromium.org

Review-Url: https://codereview.chromium.org/2008153003
Cr-Commit-Position: refs/heads/master@{#395983}

[modify] https://crrev.com/87a0cc1f353d4607abd5e7c948c2d05f2243a4a8/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
[modify] https://crrev.com/87a0cc1f353d4607abd5e7c948c2d05f2243a4a8/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.h

Status: Fixed (was: Assigned)

Sign in to add a comment