New issue
Advanced search Search tips

Issue 862725 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 12
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Don't stringify buffer twice in PA_LOG

Project Member Reported by dcheng@chromium.org, Jul 11

Issue description

stringstream::str() generates a new string each time it's called. It's called twice in ~ScopedLogMessage, but we could just save a reference to stringified stream and reuse it.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 12

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

commit f39a6efa39053b51201f6c601a43955a5dd58a5f
Author: Kyle Horimoto <khorimoto@google.com>
Date: Thu Jul 12 17:40:34 2018

[CrOS MultiDevice] Improve logging performance.

Previously std::stringstream::str() was called twice, which generates
two distinct (but identical) strings. This CL caches the result of the
call and uses it twice.

Bug:  862725 
Change-Id: I0384981a259b12d6c3ecf1420436f71e1e002fe6
Reviewed-on: https://chromium-review.googlesource.com/1134218
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574625}
[modify] https://crrev.com/f39a6efa39053b51201f6c601a43955a5dd58a5f/chromeos/components/proximity_auth/logging/logging.cc

Status: Fixed (was: Assigned)

Sign in to add a comment