Commit 7ebf08ef authored by Denys Mishunov's avatar Denys Mishunov

Got rid of unnecessary ticks

Also removed unnecessary requestAnimationFrame in performance
utils as it does nothing really
parent b237af27
...@@ -45,9 +45,7 @@ export default { ...@@ -45,9 +45,7 @@ export default {
this.editor.onDidChangeModelContent(debounce(this.onFileChange.bind(this), 250)); this.editor.onDidChangeModelContent(debounce(this.onFileChange.bind(this), 250));
this.$nextTick(() => { eventHub.$emit(SNIPPET_MEASURE_BLOBS_CONTENT);
eventHub.$emit(SNIPPET_MEASURE_BLOBS_CONTENT);
});
}, },
beforeDestroy() { beforeDestroy() {
this.editor.dispose(); this.editor.dispose();
......
...@@ -37,9 +37,7 @@ export default { ...@@ -37,9 +37,7 @@ export default {
}, },
updated() { updated() {
if (this.currentTree?.tree?.length) { if (this.currentTree?.tree?.length) {
this.$nextTick(() => { eventHub.$emit(WEBIDE_MEASURE_TREE_FROM_REQUEST);
eventHub.$emit(WEBIDE_MEASURE_TREE_FROM_REQUEST);
});
} }
}, },
methods: { methods: {
......
...@@ -300,13 +300,11 @@ export default { ...@@ -300,13 +300,11 @@ export default {
}); });
this.$emit('editorSetup'); this.$emit('editorSetup');
this.$nextTick(() => { if (performance.getEntriesByName(WEBIDE_MARK_FILE_CLICKED).length) {
if (performance.getEntriesByName(WEBIDE_MARK_FILE_CLICKED).length) { eventHub.$emit(WEBIDE_MEASURE_FILE_AFTER_INTERACTION);
eventHub.$emit(WEBIDE_MEASURE_FILE_AFTER_INTERACTION); } else {
} else { eventHub.$emit(WEBIDE_MEASURE_FILE_FROM_REQUEST);
eventHub.$emit(WEBIDE_MEASURE_FILE_FROM_REQUEST); }
}
});
}, },
refreshEditorDimensions() { refreshEditorDimensions() {
if (this.showEditor) { if (this.showEditor) {
......
...@@ -4,9 +4,7 @@ export const performanceMarkAndMeasure = ({ mark, measures = [] } = {}) => { ...@@ -4,9 +4,7 @@ export const performanceMarkAndMeasure = ({ mark, measures = [] } = {}) => {
performance.mark(mark); performance.mark(mark);
} }
measures.forEach(measure => { measures.forEach(measure => {
window.requestAnimationFrame(() => performance.measure(measure.name, measure.start, measure.end);
performance.measure(measure.name, measure.start, measure.end),
);
}); });
}); });
}; };
...@@ -13,8 +13,6 @@ export default { ...@@ -13,8 +13,6 @@ export default {
}, },
}, },
mounted() { mounted() {
this.$nextTick(() => { eventHub.$emit(SNIPPET_MEASURE_BLOBS_CONTENT);
eventHub.$emit(SNIPPET_MEASURE_BLOBS_CONTENT);
});
}, },
}; };
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