summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/app.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-08-18 09:58:19 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-18 09:58:19 -0700
commit2eb7c7dd6392488d858989da8d57d618f58f04ca (patch)
treec1c1bee66b9faac09c4a9c2f28d708c064396f6b /fpdfsdk/javascript/app.h
parent9282819ce86f93ca46a73adb43b5c50289f4c99e (diff)
downloadpdfium-2eb7c7dd6392488d858989da8d57d618f58f04ca.tar.xz
Use a map for app::m_Timers
Currently the timers is a vector. When we cancel a timer we have an O(n) operation to remove the timer. If there are a lot of timers (which this test has > 16k) this can take a long time. The impact is a lot lower in Release, but the test is very slow in Debug. From Linux on waterfall: [ RUN ] FPDFFormFillEmbeddertest.BUG_634716 [ OK ] FPDFFormFillEmbeddertest.BUG_634716 (7855 ms) From Linux try bot: [ RUN ] FPDFFormFillEmbeddertest.BUG_634716 [ OK ] FPDFFormFillEmbeddertest.BUG_634716 (431 ms) From Linux XFA Rel GYP on waterfall: [ RUN ] FPDFFormFillEmbeddertest.BUG_634716 [ OK ] FPDFFormFillEmbeddertest.BUG_634716 (185 ms) From Linux XFA Rel GYP try bot: [ RUN ] FPDFFormFillEmbeddertest.BUG_634716 [ OK ] FPDFFormFillEmbeddertest.BUG_634716 (72 ms) Review-Url: https://codereview.chromium.org/2251333002
Diffstat (limited to 'fpdfsdk/javascript/app.h')
-rw-r--r--fpdfsdk/javascript/app.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/fpdfsdk/javascript/app.h b/fpdfsdk/javascript/app.h
index 97db59e437..911d86586a 100644
--- a/fpdfsdk/javascript/app.h
+++ b/fpdfsdk/javascript/app.h
@@ -7,6 +7,7 @@
#ifndef FPDFSDK_JAVASCRIPT_APP_H_
#define FPDFSDK_JAVASCRIPT_APP_H_
+#include <map>
#include <memory>
#include <vector>
@@ -165,7 +166,7 @@ class app : public CJS_EmbedObj {
bool m_bCalculate;
bool m_bRuntimeHighLight;
- std::vector<std::unique_ptr<GlobalTimer>> m_Timers;
+ std::map<GlobalTimer*, std::unique_ptr<GlobalTimer>> m_Timers;
};
class CJS_App : public CJS_Object {