New issue
Advanced search Search tips

Issue 674582 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Fix AtomicString construction from string literals

Project Member Reported by csharrison@chromium.org, Dec 15 2016

Issue description

There are some places in Blink code that explicitly or implicitly construct an AtomicString from a literal, in some hot path. This is slow because we have to re-hash the string and check the atomic string table for it.

One notable place I found was in ResourceRequest::{set,add}HttpHeaderField. These inputs get converted to AtomicStrings, so we should ensure literals are already global and atomic (most users are OK but there are a few that need updating).

One problem here is for the public API. If an embedder wants to add header "Foo" for every request, should it be converted to an AtomicString (and hashed, etc) per request internally? That seems wrong, but I think a good solution would involve expanding WebString.

I would also like to brainstorm about a solution that would not degrade over time (i.e. make this impossible to do in the future with better APIs).

Adding Blink>Loader because I've noticed this in loading code.
 
Status: Available (was: Untriaged)
Components: -Blink>Loader Blink>Internals>WTF
I'd like to avoid making the code ugly where you need to explicitly write AtomicString() all over in the C++ doing getAttribute(AtomicString("foo")) etc.

Ideally we should be moving almost all of the loading code touching headers into blink and stop using WebString instead of adding more features to it.

Comment 3 by yutak@chromium.org, Feb 15 2017

I would be against implicit conversions since they tend to hide potentially-
costly operations under the code (just like AtomicString in this case).
Project Member

Comment 4 by sheriffbot@chromium.org, Feb 16 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment