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 {
this.editor.onDidChangeModelContent(debounce(this.onFileChange.bind(this), 250));
this.$nextTick(() => {
eventHub.$emit(SNIPPET_MEASURE_BLOBS_CONTENT);
});
eventHub.$emit(SNIPPET_MEASURE_BLOBS_CONTENT);
},
beforeDestroy() {
this.editor.dispose();
......
......@@ -37,9 +37,7 @@ export default {
},
updated() {
if (this.currentTree?.tree?.length) {
this.$nextTick(() => {
eventHub.$emit(WEBIDE_MEASURE_TREE_FROM_REQUEST);
});
eventHub.$emit(WEBIDE_MEASURE_TREE_FROM_REQUEST);
}
},
methods: {
......
......@@ -300,13 +300,11 @@ export default {
});
this.$emit('editorSetup');
this.$nextTick(() => {
if (performance.getEntriesByName(WEBIDE_MARK_FILE_CLICKED).length) {
eventHub.$emit(WEBIDE_MEASURE_FILE_AFTER_INTERACTION);
} else {
eventHub.$emit(WEBIDE_MEASURE_FILE_FROM_REQUEST);
}
});
if (performance.getEntriesByName(WEBIDE_MARK_FILE_CLICKED).length) {
eventHub.$emit(WEBIDE_MEASURE_FILE_AFTER_INTERACTION);
} else {
eventHub.$emit(WEBIDE_MEASURE_FILE_FROM_REQUEST);
}
},
refreshEditorDimensions() {
if (this.showEditor) {
......
......@@ -4,9 +4,7 @@ export const performanceMarkAndMeasure = ({ mark, measures = [] } = {}) => {
performance.mark(mark);
}
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 {
},
},
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