Commit 63fbef4e authored by Alexey Kozyatinskiy's avatar Alexey Kozyatinskiy Committed by Commit Bot

[inspector] use unordered_map for frames cache

Otherwise we can end up with performance regression with a lot of
frames in cache. Map requires log(N) for lookup, unordered map for
frames ids requires - ~O(1).

R=dgozman@chromium.org

Bug: v8:7078
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Iac1ff7e35daede8c5ebd424f686a8ef8dbae9061
Reviewed-on: https://chromium-review.googlesource.com/767035
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: 's avatarAlexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49369}
parent 082009fc
......@@ -6,6 +6,7 @@
#define V8_INSPECTOR_V8DEBUGGER_H_
#include <list>
#include <unordered_map>
#include <vector>
#include "src/base/macros.h"
......@@ -196,7 +197,7 @@ class V8Debugger : public v8::debug::DebugDelegate {
// V8Debugger owns all the async stacks, while most of the other references
// are weak, which allows to collect some stacks when there are too many.
std::list<std::shared_ptr<AsyncStackTrace>> m_allAsyncStacks;
std::map<int, std::weak_ptr<StackFrame>> m_framesCache;
std::unordered_map<int, std::weak_ptr<StackFrame>> m_framesCache;
protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap;
void* m_taskWithScheduledBreak = nullptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment