#47171: refactor: prefer base::circular_deque
over std::deque
Merged
Description of Change
A companion PR to #47157 to follow Chromium's usage advice.
That PR migrated std::queue
use; this one migrates std::deque
:
Chromium code should always use
base::circular_deque
orbase::queue
in preference tostd::deque
orstd::queue
due to memory usage and platform variation.The
base::circular_deque
implementation (and thebase::queue
which uses it) provide performance consistent across platforms that better matches most programmer‘s expectations on performance (it doesn’t waste as much space as libc++ and doesn't do as many heap allocations as MSVC). It also generates less code than std::queue: using it across the code base saves several hundred kilobytes.
Checklist
- PR description included and stakeholders cc'd
-
npm test
passes - PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, and past tense.
Release Notes
Notes: none.
Backports
36-x-y
MergedPR Number
#47193Merged At
May 21, 2025, 3:49:07 PM
Released In
v36.3.0Release Date
May 22, 2025, 8:18:58 AM
37-x-y
MergedPR Number
#47192Merged At
May 21, 2025, 3:49:18 PM
Released In
v37.0.0-alpha.6Release Date
May 22, 2025, 10:18:26 AM
Semver Impact
Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron