+
diff --git a/tools/benchmarks/owl-0.13.0/app.js b/tools/benchmarks/owl-0.13.0/app.js
index 6a9693b0..9734c34c 100644
--- a/tools/benchmarks/owl-0.13.0/app.js
+++ b/tools/benchmarks/owl-0.13.0/app.js
@@ -1,10 +1,14 @@
-import { buildData, startMeasure, stopMeasure } from "../shared/utils.js";
+import {
+ buildData,
+ startMeasure,
+ stopMeasure,
+ formatNumber
+} from "../shared/utils.js";
//------------------------------------------------------------------------------
// Likes Counter Widget
//------------------------------------------------------------------------------
class Counter extends owl.Component {
- template = "counter";
state = { counter: 0 };
increment() {
@@ -16,15 +20,14 @@ class Counter extends owl.Component {
// Message Widget
//------------------------------------------------------------------------------
class Message extends owl.Component {
- template = "message";
widgets = { Counter };
shouldUpdate(nextProps) {
return nextProps.message !== this.props.message;
}
removeMessage() {
- this.trigger("remove_message", {
- id: this.props.id
+ this.trigger("remove-message", {
+ id: this.props.message.id
});
}
}
@@ -33,39 +36,122 @@ class Message extends owl.Component {
// Root Widget
//------------------------------------------------------------------------------
class App extends owl.Component {
- template = "root";
widgets = { Message };
- state = { messages: [] };
+ state = { messages: [], multipleFlag: false, clearAfterFlag: false };
+
+ mounted() {
+ this.log(
+ `Benchmarking Owl v${owl.__info__.version} (build date: ${
+ owl.__info__.date
+ })`
+ );
+ }
+
+ benchmark(message, fn, callback) {
+ if (this.state.multipleFlag) {
+ const N = 20;
+ let n = N;
+ let total = 0;
+ let cb = info => {
+ let finalize = () => {
+ n--;
+ total += info.delta;
+ if (n === 0) {
+ const avg = total / N;
+ this.log(`Average: ${formatNumber(avg)}ms`, true);
+ if (callback) {
+ callback();
+ }
+ } else {
+ this._benchmark(message, fn, cb);
+ }
+ };
+
+ if (this.state.clearAfterFlag) {
+ this._benchmark(
+ "clear",
+ () => {
+ this.state.messages = [];
+ },
+ finalize,
+ false
+ );
+ } else {
+ finalize();
+ }
+ };
+ this._benchmark(message, fn, cb);
+ } else {
+ this._benchmark(message, fn, callback);
+ }
+ }
+
+ _benchmark(message, fn, cb, log = true) {
+ setTimeout(() => {
+ startMeasure(message);
+ fn();
+ stopMeasure(info => {
+ if (log) {
+ this.log(info.msg);
+ }
+ if (cb) {
+ cb(info);
+ }
+ });
+ }, 10);
+ }
addMessages(n) {
- startMeasure("add " + n);
- const newMessages = buildData(n);
- this.state.messages.push.apply(this.state.messages, newMessages);
- stopMeasure();
+ this.benchmark("add " + n, () => {
+ const newMessages = buildData(n);
+ this.state.messages.push.apply(this.state.messages, newMessages);
+ });
}
clear() {
- startMeasure("clear");
- this.state.messages = [];
- stopMeasure();
+ this._benchmark("clear", () => {
+ this.state.messages = [];
+ });
}
updateSomeMessages() {
- startMeasure("update every 10th");
- const messages = this.state.messages;
- for (let i = 0; i < this.state.messages.length; i += 10) {
- const msg = Object.assign({}, messages[i]);
- msg.author += "!!!";
- this.set(messages, i, msg);
- }
- stopMeasure();
+ this.benchmark("update every 10th", () => {
+ const messages = this.state.messages;
+ for (let i = 0; i < this.state.messages.length; i += 10) {
+ const msg = Object.assign({}, messages[i]);
+ msg.author += "!!!";
+ this.set(messages, i, msg);
+ }
+ });
}
- removeMessage(data) {
- startMeasure("remove message");
- const index = this.state.messages.findIndex(m => m.id === data.id);
- this.state.messages.splice(index, 1);
- stopMeasure();
+ removeMessage(event) {
+ this.benchmark("remove message", () => {
+ const index = this.state.messages.findIndex(m => m.id === event.detail.id);
+ this.state.messages.splice(index, 1);
+ });
+ }
+
+ log(str, isBold) {
+ const div = document.createElement("div");
+ if (isBold) {
+ div.classList.add("bold");
+ }
+ div.textContent = `> ${str}`;
+ this.refs.log.appendChild(div);
+ this.refs.log.scrollTop = this.refs.log.scrollHeight;
+ }
+
+ clearLog() {
+ this.refs.log.innerHTML = "";
+ }
+
+ toggleMultiple() {
+ this.state.multipleFlag = !this.state.multipleFlag;
+ }
+
+ toggleClear() {
+ this.state.clearAfterFlag = !this.state.clearAfterFlag;
}
}
diff --git a/tools/benchmarks/owl-0.13.0/templates.xml b/tools/benchmarks/owl-0.13.0/templates.xml
index a1bff7de..b53a3dac 100644
--- a/tools/benchmarks/owl-0.13.0/templates.xml
+++ b/tools/benchmarks/owl-0.13.0/templates.xml
@@ -1,33 +1,49 @@
-
+
-
Number of msg:
+
Actions
+
-
-
-
-
+
+
+
+
+
+
+
Number of messages:
+
+
Log (clear)
+
-
+
-
+
diff --git a/tools/benchmarks/owl-0.7.0/app.js b/tools/benchmarks/owl-0.7.0/app.js
index 6eddb25d..f89a020a 100644
--- a/tools/benchmarks/owl-0.7.0/app.js
+++ b/tools/benchmarks/owl-0.7.0/app.js
@@ -1,11 +1,16 @@
-import { buildData, startMeasure, stopMeasure } from "../shared/utils.js";
+import {
+ buildData,
+ startMeasure,
+ stopMeasure,
+ formatNumber
+} from "../shared/utils.js";
//------------------------------------------------------------------------------
// Likes Counter Widget
//------------------------------------------------------------------------------
class Counter extends owl.Component {
- template = "counter";
state = { counter: 0 };
+ template = "Counter";
increment() {
this.state.counter++;
@@ -16,13 +21,12 @@ class Counter extends owl.Component {
// Message Widget
//------------------------------------------------------------------------------
class Message extends owl.Component {
- template = "message";
widgets = { Counter };
+ template = "Message";
shouldUpdate(nextProps) {
return nextProps !== this.props;
}
-
removeMessage() {
this.trigger("remove_message", {
id: this.props.id
@@ -34,39 +38,123 @@ class Message extends owl.Component {
// Root Widget
//------------------------------------------------------------------------------
class App extends owl.Component {
- template = "root";
widgets = { Message };
- state = { messages: [] };
+ state = { messages: [], multipleFlag: false, clearAfterFlag: false };
+ template = "App";
+
+ mounted() {
+ this.log(
+ `Benchmarking Owl v${owl._version} (build date: ${
+ owl._date
+ })`
+ );
+ }
+
+ benchmark(message, fn, callback) {
+ if (this.state.multipleFlag) {
+ const N = 20;
+ let n = N;
+ let total = 0;
+ let cb = info => {
+ let finalize = () => {
+ n--;
+ total += info.delta;
+ if (n === 0) {
+ const avg = total / N;
+ this.log(`Average: ${formatNumber(avg)}ms`, true);
+ if (callback) {
+ callback();
+ }
+ } else {
+ this._benchmark(message, fn, cb);
+ }
+ };
+
+ if (this.state.clearAfterFlag) {
+ this._benchmark(
+ "clear",
+ () => {
+ this.state.messages = [];
+ },
+ finalize,
+ false
+ );
+ } else {
+ finalize();
+ }
+ };
+ this._benchmark(message, fn, cb);
+ } else {
+ this._benchmark(message, fn, callback);
+ }
+ }
+
+ _benchmark(message, fn, cb, log = true) {
+ setTimeout(() => {
+ startMeasure(message);
+ fn();
+ stopMeasure(info => {
+ if (log) {
+ this.log(info.msg);
+ }
+ if (cb) {
+ cb(info);
+ }
+ });
+ }, 10);
+ }
addMessages(n) {
- startMeasure("add " + n);
- const newMessages = buildData(n);
- this.state.messages.push.apply(this.state.messages, newMessages);
- stopMeasure();
+ this.benchmark("add " + n, () => {
+ const newMessages = buildData(n);
+ this.state.messages.push.apply(this.state.messages, newMessages);
+ });
}
clear() {
- startMeasure("clear");
- this.state.messages = [];
- stopMeasure();
+ this._benchmark("clear", () => {
+ this.state.messages = [];
+ });
}
updateSomeMessages() {
- startMeasure("update every 10th");
- const messages = this.state.messages;
- for (let i = 0; i < this.state.messages.length; i += 10) {
- const msg = Object.assign({}, messages[i]);
- msg.author += '!!!';
- this.set(messages, i, msg);
- }
- stopMeasure();
+ this.benchmark("update every 10th", () => {
+ const messages = this.state.messages;
+ for (let i = 0; i < this.state.messages.length; i += 10) {
+ const msg = Object.assign({}, messages[i]);
+ msg.author += "!!!";
+ this.set(messages, i, msg);
+ }
+ });
}
removeMessage(data) {
- startMeasure('remove message');
- const index = this.state.messages.findIndex(m => m.id === data.id);
- this.state.messages.splice(index, 1);
- stopMeasure();
+ this.benchmark("remove message", () => {
+ const index = this.state.messages.findIndex(m => m.id === data.id);
+ this.state.messages.splice(index, 1);
+ });
+ }
+
+ log(str, isBold) {
+ const div = document.createElement("div");
+ if (isBold) {
+ div.classList.add("bold");
+ }
+ div.textContent = `> ${str}`;
+ this.refs.log.appendChild(div);
+ this.refs.log.scrollTop = this.refs.log.scrollHeight;
+ }
+
+ clearLog() {
+ this.refs.log.innerHTML = "";
+ }
+
+ toggleMultiple() {
+ this.state.multipleFlag = !this.state.multipleFlag;
+ }
+
+ toggleClear() {
+ this.state.clearAfterFlag = !this.state.clearAfterFlag;
}
}
diff --git a/tools/benchmarks/owl-0.7.0/templates.xml b/tools/benchmarks/owl-0.7.0/templates.xml
index 351fd84f..699ebea3 100644
--- a/tools/benchmarks/owl-0.7.0/templates.xml
+++ b/tools/benchmarks/owl-0.7.0/templates.xml
@@ -1,16 +1,34 @@
-
+
-
Number of msg:
+
Actions
+
-
-
-
-
+
+
+
+
+
+
+
Number of messages:
+
+
Log (clear)
+
-
-
+
-
+
diff --git a/tools/benchmarks/owl-0.8.0/app.js b/tools/benchmarks/owl-0.8.0/app.js
index e589b499..f89a020a 100644
--- a/tools/benchmarks/owl-0.8.0/app.js
+++ b/tools/benchmarks/owl-0.8.0/app.js
@@ -1,11 +1,16 @@
-import { buildData, startMeasure, stopMeasure } from "../shared/utils.js";
+import {
+ buildData,
+ startMeasure,
+ stopMeasure,
+ formatNumber
+} from "../shared/utils.js";
//------------------------------------------------------------------------------
// Likes Counter Widget
//------------------------------------------------------------------------------
class Counter extends owl.Component {
- template = "counter";
state = { counter: 0 };
+ template = "Counter";
increment() {
this.state.counter++;
@@ -16,8 +21,8 @@ class Counter extends owl.Component {
// Message Widget
//------------------------------------------------------------------------------
class Message extends owl.Component {
- template = "message";
widgets = { Counter };
+ template = "Message";
shouldUpdate(nextProps) {
return nextProps !== this.props;
@@ -33,39 +38,123 @@ class Message extends owl.Component {
// Root Widget
//------------------------------------------------------------------------------
class App extends owl.Component {
- template = "root";
widgets = { Message };
- state = { messages: [] };
+ state = { messages: [], multipleFlag: false, clearAfterFlag: false };
+ template = "App";
+
+ mounted() {
+ this.log(
+ `Benchmarking Owl v${owl._version} (build date: ${
+ owl._date
+ })`
+ );
+ }
+
+ benchmark(message, fn, callback) {
+ if (this.state.multipleFlag) {
+ const N = 20;
+ let n = N;
+ let total = 0;
+ let cb = info => {
+ let finalize = () => {
+ n--;
+ total += info.delta;
+ if (n === 0) {
+ const avg = total / N;
+ this.log(`Average: ${formatNumber(avg)}ms`, true);
+ if (callback) {
+ callback();
+ }
+ } else {
+ this._benchmark(message, fn, cb);
+ }
+ };
+
+ if (this.state.clearAfterFlag) {
+ this._benchmark(
+ "clear",
+ () => {
+ this.state.messages = [];
+ },
+ finalize,
+ false
+ );
+ } else {
+ finalize();
+ }
+ };
+ this._benchmark(message, fn, cb);
+ } else {
+ this._benchmark(message, fn, callback);
+ }
+ }
+
+ _benchmark(message, fn, cb, log = true) {
+ setTimeout(() => {
+ startMeasure(message);
+ fn();
+ stopMeasure(info => {
+ if (log) {
+ this.log(info.msg);
+ }
+ if (cb) {
+ cb(info);
+ }
+ });
+ }, 10);
+ }
addMessages(n) {
- startMeasure("add " + n);
- const newMessages = buildData(n);
- this.state.messages.push.apply(this.state.messages, newMessages);
- stopMeasure();
+ this.benchmark("add " + n, () => {
+ const newMessages = buildData(n);
+ this.state.messages.push.apply(this.state.messages, newMessages);
+ });
}
clear() {
- startMeasure("clear");
- this.state.messages = [];
- stopMeasure();
+ this._benchmark("clear", () => {
+ this.state.messages = [];
+ });
}
updateSomeMessages() {
- startMeasure("update every 10th");
- const messages = this.state.messages;
- for (let i = 0; i < this.state.messages.length; i += 10) {
- const msg = Object.assign({}, messages[i]);
- msg.author += '!!!';
- this.set(messages, i, msg);
- }
- stopMeasure();
+ this.benchmark("update every 10th", () => {
+ const messages = this.state.messages;
+ for (let i = 0; i < this.state.messages.length; i += 10) {
+ const msg = Object.assign({}, messages[i]);
+ msg.author += "!!!";
+ this.set(messages, i, msg);
+ }
+ });
}
removeMessage(data) {
- startMeasure("remove message");
- const index = this.state.messages.findIndex(m => m.id === data.id);
- this.state.messages.splice(index, 1);
- stopMeasure();
+ this.benchmark("remove message", () => {
+ const index = this.state.messages.findIndex(m => m.id === data.id);
+ this.state.messages.splice(index, 1);
+ });
+ }
+
+ log(str, isBold) {
+ const div = document.createElement("div");
+ if (isBold) {
+ div.classList.add("bold");
+ }
+ div.textContent = `> ${str}`;
+ this.refs.log.appendChild(div);
+ this.refs.log.scrollTop = this.refs.log.scrollHeight;
+ }
+
+ clearLog() {
+ this.refs.log.innerHTML = "";
+ }
+
+ toggleMultiple() {
+ this.state.multipleFlag = !this.state.multipleFlag;
+ }
+
+ toggleClear() {
+ this.state.clearAfterFlag = !this.state.clearAfterFlag;
}
}
diff --git a/tools/benchmarks/owl-0.8.0/templates.xml b/tools/benchmarks/owl-0.8.0/templates.xml
index 351fd84f..699ebea3 100644
--- a/tools/benchmarks/owl-0.8.0/templates.xml
+++ b/tools/benchmarks/owl-0.8.0/templates.xml
@@ -1,16 +1,34 @@
-
+
-
Number of msg:
+
Actions
+
-
-
-
-
+
+
+
+
+
+
+
Number of messages:
+
+
Log (clear)
+
-
-
+
-
+
diff --git a/tools/benchmarks/owl-0.9.0/app.js b/tools/benchmarks/owl-0.9.0/app.js
index e589b499..f89a020a 100644
--- a/tools/benchmarks/owl-0.9.0/app.js
+++ b/tools/benchmarks/owl-0.9.0/app.js
@@ -1,11 +1,16 @@
-import { buildData, startMeasure, stopMeasure } from "../shared/utils.js";
+import {
+ buildData,
+ startMeasure,
+ stopMeasure,
+ formatNumber
+} from "../shared/utils.js";
//------------------------------------------------------------------------------
// Likes Counter Widget
//------------------------------------------------------------------------------
class Counter extends owl.Component {
- template = "counter";
state = { counter: 0 };
+ template = "Counter";
increment() {
this.state.counter++;
@@ -16,8 +21,8 @@ class Counter extends owl.Component {
// Message Widget
//------------------------------------------------------------------------------
class Message extends owl.Component {
- template = "message";
widgets = { Counter };
+ template = "Message";
shouldUpdate(nextProps) {
return nextProps !== this.props;
@@ -33,39 +38,123 @@ class Message extends owl.Component {
// Root Widget
//------------------------------------------------------------------------------
class App extends owl.Component {
- template = "root";
widgets = { Message };
- state = { messages: [] };
+ state = { messages: [], multipleFlag: false, clearAfterFlag: false };
+ template = "App";
+
+ mounted() {
+ this.log(
+ `Benchmarking Owl v${owl._version} (build date: ${
+ owl._date
+ })`
+ );
+ }
+
+ benchmark(message, fn, callback) {
+ if (this.state.multipleFlag) {
+ const N = 20;
+ let n = N;
+ let total = 0;
+ let cb = info => {
+ let finalize = () => {
+ n--;
+ total += info.delta;
+ if (n === 0) {
+ const avg = total / N;
+ this.log(`Average: ${formatNumber(avg)}ms`, true);
+ if (callback) {
+ callback();
+ }
+ } else {
+ this._benchmark(message, fn, cb);
+ }
+ };
+
+ if (this.state.clearAfterFlag) {
+ this._benchmark(
+ "clear",
+ () => {
+ this.state.messages = [];
+ },
+ finalize,
+ false
+ );
+ } else {
+ finalize();
+ }
+ };
+ this._benchmark(message, fn, cb);
+ } else {
+ this._benchmark(message, fn, callback);
+ }
+ }
+
+ _benchmark(message, fn, cb, log = true) {
+ setTimeout(() => {
+ startMeasure(message);
+ fn();
+ stopMeasure(info => {
+ if (log) {
+ this.log(info.msg);
+ }
+ if (cb) {
+ cb(info);
+ }
+ });
+ }, 10);
+ }
addMessages(n) {
- startMeasure("add " + n);
- const newMessages = buildData(n);
- this.state.messages.push.apply(this.state.messages, newMessages);
- stopMeasure();
+ this.benchmark("add " + n, () => {
+ const newMessages = buildData(n);
+ this.state.messages.push.apply(this.state.messages, newMessages);
+ });
}
clear() {
- startMeasure("clear");
- this.state.messages = [];
- stopMeasure();
+ this._benchmark("clear", () => {
+ this.state.messages = [];
+ });
}
updateSomeMessages() {
- startMeasure("update every 10th");
- const messages = this.state.messages;
- for (let i = 0; i < this.state.messages.length; i += 10) {
- const msg = Object.assign({}, messages[i]);
- msg.author += '!!!';
- this.set(messages, i, msg);
- }
- stopMeasure();
+ this.benchmark("update every 10th", () => {
+ const messages = this.state.messages;
+ for (let i = 0; i < this.state.messages.length; i += 10) {
+ const msg = Object.assign({}, messages[i]);
+ msg.author += "!!!";
+ this.set(messages, i, msg);
+ }
+ });
}
removeMessage(data) {
- startMeasure("remove message");
- const index = this.state.messages.findIndex(m => m.id === data.id);
- this.state.messages.splice(index, 1);
- stopMeasure();
+ this.benchmark("remove message", () => {
+ const index = this.state.messages.findIndex(m => m.id === data.id);
+ this.state.messages.splice(index, 1);
+ });
+ }
+
+ log(str, isBold) {
+ const div = document.createElement("div");
+ if (isBold) {
+ div.classList.add("bold");
+ }
+ div.textContent = `> ${str}`;
+ this.refs.log.appendChild(div);
+ this.refs.log.scrollTop = this.refs.log.scrollHeight;
+ }
+
+ clearLog() {
+ this.refs.log.innerHTML = "";
+ }
+
+ toggleMultiple() {
+ this.state.multipleFlag = !this.state.multipleFlag;
+ }
+
+ toggleClear() {
+ this.state.clearAfterFlag = !this.state.clearAfterFlag;
}
}
diff --git a/tools/benchmarks/owl-0.9.0/templates.xml b/tools/benchmarks/owl-0.9.0/templates.xml
index 351fd84f..699ebea3 100644
--- a/tools/benchmarks/owl-0.9.0/templates.xml
+++ b/tools/benchmarks/owl-0.9.0/templates.xml
@@ -1,16 +1,34 @@
-
+
-
Number of msg:
+
Actions
+
-
-
-
-
+
+
+
+
+
+
+
Number of messages:
+
+
Log (clear)
+
-
-
+
-
+
diff --git a/tools/benchmarks/owl-master/app.js b/tools/benchmarks/owl-master/app.js
index 4ea419b6..34093066 100644
--- a/tools/benchmarks/owl-master/app.js
+++ b/tools/benchmarks/owl-master/app.js
@@ -1,4 +1,9 @@
-import { buildData, startMeasure, stopMeasure } from "../shared/utils.js";
+import {
+ buildData,
+ startMeasure,
+ stopMeasure,
+ formatNumber
+} from "../shared/utils.js";
//------------------------------------------------------------------------------
// Likes Counter Widget
@@ -18,11 +23,11 @@ class Message extends owl.Component {
widgets = { Counter };
shouldUpdate(nextProps) {
- return nextProps !== this.props;
+ return nextProps.message !== this.props.message;
}
removeMessage() {
- this.trigger("remove_message", {
- id: this.props.id
+ this.trigger("remove-message", {
+ id: this.props.message.id
});
}
}
@@ -32,38 +37,122 @@ class Message extends owl.Component {
//------------------------------------------------------------------------------
class App extends owl.Component {
widgets = { Message };
- state = { messages: [] };
+ state = { messages: [], multipleFlag: false, clearAfterFlag: false };
+
+ mounted() {
+ this.log(
+ `Benchmarking Owl v${owl.__info__.version} (build date: ${
+ owl.__info__.date
+ })`
+ );
+ }
+
+ benchmark(message, fn, callback) {
+ if (this.state.multipleFlag) {
+ const N = 20;
+ let n = N;
+ let total = 0;
+ let cb = info => {
+ let finalize = () => {
+ n--;
+ total += info.delta;
+ if (n === 0) {
+ const avg = total / N;
+ this.log(`Average: ${formatNumber(avg)}ms`, true);
+ if (callback) {
+ callback();
+ }
+ } else {
+ this._benchmark(message, fn, cb);
+ }
+ };
+
+ if (this.state.clearAfterFlag) {
+ this._benchmark(
+ "clear",
+ () => {
+ this.state.messages = [];
+ },
+ finalize,
+ false
+ );
+ } else {
+ finalize();
+ }
+ };
+ this._benchmark(message, fn, cb);
+ } else {
+ this._benchmark(message, fn, callback);
+ }
+ }
+
+ _benchmark(message, fn, cb, log = true) {
+ setTimeout(() => {
+ startMeasure(message);
+ fn();
+ stopMeasure(info => {
+ if (log) {
+ this.log(info.msg);
+ }
+ if (cb) {
+ cb(info);
+ }
+ });
+ }, 10);
+ }
addMessages(n) {
- startMeasure("add " + n);
- const newMessages = buildData(n);
- this.state.messages.push.apply(this.state.messages, newMessages);
- stopMeasure();
+ this.benchmark("add " + n, () => {
+ const newMessages = buildData(n);
+ this.state.messages.push.apply(this.state.messages, newMessages);
+ });
}
clear() {
- startMeasure("clear");
- this.state.messages = [];
- stopMeasure();
+ this._benchmark("clear", () => {
+ this.state.messages = [];
+ });
}
updateSomeMessages() {
- startMeasure("update every 10th");
- const setState = owl.Observer.set;
- const messages = this.state.messages;
- for (let i = 0; i < this.state.messages.length; i += 10) {
- const msg = Object.assign({}, messages[i]);
- msg.author += '!!!';
- setState(messages, i, msg);
- }
- stopMeasure();
+ this.benchmark("update every 10th", () => {
+ const setState = owl.Observer.set;
+ const messages = this.state.messages;
+ for (let i = 0; i < this.state.messages.length; i += 10) {
+ const msg = Object.assign({}, messages[i]);
+ msg.author += "!!!";
+ setState(messages, i, msg);
+ }
+ });
}
- removeMessage(data) {
- startMeasure("remove message");
- const index = this.state.messages.findIndex(m => m.id === data.id);
- this.state.messages.splice(index, 1);
- stopMeasure();
+ removeMessage(event) {
+ this.benchmark("remove message", () => {
+ const index = this.state.messages.findIndex(m => m.id === event.detail.id);
+ this.state.messages.splice(index, 1);
+ });
+ }
+
+ log(str, isBold) {
+ const div = document.createElement("div");
+ if (isBold) {
+ div.classList.add("bold");
+ }
+ div.textContent = `> ${str}`;
+ this.refs.log.appendChild(div);
+ this.refs.log.scrollTop = this.refs.log.scrollHeight;
+ }
+
+ clearLog() {
+ this.refs.log.innerHTML = "";
+ }
+
+ toggleMultiple() {
+ this.state.multipleFlag = !this.state.multipleFlag;
+ }
+
+ toggleClear() {
+ this.state.clearAfterFlag = !this.state.clearAfterFlag;
}
}
diff --git a/tools/benchmarks/owl-master/index.html b/tools/benchmarks/owl-master/index.html
index 332e949e..1bb955f1 100644
--- a/tools/benchmarks/owl-master/index.html
+++ b/tools/benchmarks/owl-master/index.html
@@ -7,7 +7,6 @@
-