perf: use absl::flat_hash_map
instead of std::unordered_map
(#46217)
* perf: make ElectronUsbDelegate::controller_map_ an absl::flat_hash_map Co-authored-by: Charles Kerr <charles@charleskerr.com> * perf: make ElectronSerialDelegate::controller_map_ an absl::flat_hash_map Co-authored-by: Charles Kerr <charles@charleskerr.com> * perf: make ElectronHidDelegate::controller_map_ an absl::flat_hash_map Co-authored-by: Charles Kerr <charles@charleskerr.com> * perf: make FrameTreeNodeIdMap an absl::flat_hash_map Co-authored-by: Charles Kerr <charles@charleskerr.com> * perf: make AutofillDriverFactory::driver_map_ an absl::flat_hash_map Co-authored-by: Charles Kerr <charles@charleskerr.com> * perf: make asar::Archive::external_files_ an absl::flat_hash_map Co-authored-by: Charles Kerr <charles@charleskerr.com> * perf: make VersionIdMap an absl::flat_hash_map Co-authored-by: Charles Kerr <charles@charleskerr.com> * perf: make ObjectCache::proxy_map_ an absl::flat_hash_map Co-authored-by: Charles Kerr <charles@charleskerr.com> * docs: add TODO to investigate absl map in KeyWeakMap Co-authored-by: Charles Kerr <charles@charleskerr.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
parent
e1b2b8ef0c
commit
76fa5b7af1
9 changed files with 24 additions and 24 deletions
|
@ -8,7 +8,6 @@
|
|||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include <uv.h>
|
||||
|
@ -17,6 +16,7 @@
|
|||
#include "base/files/file_path.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/values.h"
|
||||
#include "third_party/abseil-cpp/absl/container/flat_hash_map.h"
|
||||
|
||||
namespace asar {
|
||||
|
||||
|
@ -110,8 +110,8 @@ class Archive {
|
|||
|
||||
// Cached external temporary files.
|
||||
base::Lock external_files_lock_;
|
||||
std::unordered_map<base::FilePath::StringType,
|
||||
std::unique_ptr<ScopedTemporaryFile>>
|
||||
absl::flat_hash_map<base::FilePath::StringType,
|
||||
std::unique_ptr<ScopedTemporaryFile>>
|
||||
external_files_;
|
||||
};
|
||||
|
||||
|
|
|
@ -69,6 +69,7 @@ class KeyWeakMap {
|
|||
}
|
||||
|
||||
// Map of stored objects.
|
||||
// TODO(ckerr): can absl::flat_hash_map be used safely here?
|
||||
std::unordered_map<K, Mapped> map_;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue