From 1cf5b2a87f066d8ba6915fee9f98b86027125fbe Mon Sep 17 00:00:00 2001 From: simov Date: Thu, 25 Aug 2016 09:30:13 +0300 Subject: [PATCH] Batch redraws for mithril timers bench --- client/apps/mithril/timers-test/index.js | 2 ++ client/apps/mithril/timers-test/timer-item.js | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/client/apps/mithril/timers-test/index.js b/client/apps/mithril/timers-test/index.js index 4afe130..582d670 100644 --- a/client/apps/mithril/timers-test/index.js +++ b/client/apps/mithril/timers-test/index.js @@ -16,6 +16,8 @@ module.exports = { }) } + setInterval(() => m.redraw(), 10) + ctrl.captureUpdateStats = () => timerStats.capture() timerStats.init(10) diff --git a/client/apps/mithril/timers-test/timer-item.js b/client/apps/mithril/timers-test/timer-item.js index 7fac44a..c7210a1 100644 --- a/client/apps/mithril/timers-test/timer-item.js +++ b/client/apps/mithril/timers-test/timer-item.js @@ -7,12 +7,9 @@ module.exports = { args.item.intervalID = setInterval(() => { args.item.value = Math.random() * 100 - m.redraw() }, Math.random() * 10) - ctrl.config = (el, init, ctx) => { - args.capture() - } + ctrl.config = () => args.capture() return ctrl },