mirror of
https://github.com/45Drives/cockpit-navigator.git
synced 2025-07-30 00:55:30 +02:00
add console timers for debugging/optimizing (commented)
This commit is contained in:
parent
f2782ae92b
commit
5fe2575c0d
@ -26,7 +26,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref, reactive, computed, inject, watch, onBeforeUnmount, onMounted, nextTick } from 'vue';
|
import { ref, reactive, computed, inject, watch, onBeforeUnmount, onMounted, nextTick, onUnmounted } from 'vue';
|
||||||
import { errorStringHTML } from '@45drives/cockpit-helpers';
|
import { errorStringHTML } from '@45drives/cockpit-helpers';
|
||||||
import { notificationsInjectionKey, settingsInjectionKey, clipboardInjectionKey } from '../keys';
|
import { notificationsInjectionKey, settingsInjectionKey, clipboardInjectionKey } from '../keys';
|
||||||
import DirectoryEntry from './DirectoryEntry.vue';
|
import DirectoryEntry from './DirectoryEntry.vue';
|
||||||
@ -104,6 +104,7 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
processingHandler.start();
|
processingHandler.start();
|
||||||
|
// console.time('getEntries-' + props.path);
|
||||||
try {
|
try {
|
||||||
const cwd = props.path;
|
const cwd = props.path;
|
||||||
const tmpEntries = (
|
const tmpEntries = (
|
||||||
@ -111,7 +112,7 @@ export default {
|
|||||||
cwd,
|
cwd,
|
||||||
props.host,
|
props.host,
|
||||||
[],
|
[],
|
||||||
(message) => notifications.value.constructNotification("Failed to parse file name", message, 'error')
|
(message) => notifications.value.constructNotification("Error getting files", message, 'error')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if (props.path !== cwd) {
|
if (props.path !== cwd) {
|
||||||
@ -129,6 +130,7 @@ export default {
|
|||||||
notifications.value.constructNotification("Error getting directory entries", errorStringHTML(error), 'error');
|
notifications.value.constructNotification("Error getting directory entries", errorStringHTML(error), 'error');
|
||||||
emit('cancelShowEntries');
|
emit('cancelShowEntries');
|
||||||
} finally {
|
} finally {
|
||||||
|
// console.timeEnd('getEntries-' + props.path);
|
||||||
processingHandler.stop();
|
processingHandler.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -216,13 +218,18 @@ export default {
|
|||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
processingHandler.resolveDangling();
|
processingHandler.resolveDangling();
|
||||||
fileSystemWatcher.stop();
|
fileSystemWatcher.stop();
|
||||||
|
// console.time('unmount-' + props.path);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// onUnmounted(() => console.timeEnd('unmount-' + props.path));
|
||||||
|
|
||||||
watch(() => props.sortCallback, sortEntries);
|
watch(() => props.sortCallback, sortEntries);
|
||||||
watch(() => settings.directoryView?.separateDirs, sortEntries);
|
watch(() => settings.directoryView?.separateDirs, sortEntries);
|
||||||
|
|
||||||
watch([entries, () => settings?.directoryView?.showHidden, () => props.searchFilterRegExp], () => {
|
watch([entries, () => settings?.directoryView?.showHidden, () => props.searchFilterRegExp], () => {
|
||||||
|
// console.time('updateVisibleEntries-' + props.path);
|
||||||
visibleEntries.value = entries.value.filter(entryFilterCallback);
|
visibleEntries.value = entries.value.filter(entryFilterCallback);
|
||||||
|
// nextTick(() => console.timeEnd('updateVisibleEntries-' + props.path));
|
||||||
const _stats = visibleEntries.value.reduce((_stats, entry) => {
|
const _stats = visibleEntries.value.reduce((_stats, entry) => {
|
||||||
if (entry.type === 'd' || (entry.type === 'l' && entry.target?.type === 'd'))
|
if (entry.type === 'd' || (entry.type === 'l' && entry.target?.type === 'd'))
|
||||||
_stats.dirs++;
|
_stats.dirs++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user