Add TODO comment

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2022-03-24 15:46:19 +03:00
1 parent 28619e5690
commit 5b7d77568e
1 file changed
+3
+3
View File
@@ -457,6 +457,9 @@ export abstract class KubeObjectStore<T extends KubeObject> extends ItemStore<T>
const items = this.getItems(); const items = this.getItems();
for (const { type, object } of this.eventsBuffer.clear()) { for (const { type, object } of this.eventsBuffer.clear()) {
// TODO: Convert items from Array to Map to avoid doing findIndex many times per second (events delay)
// Also, its worth to use Web Worker for such operations to prevent blocking UI
// https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers
const index = items.findIndex(item => item.getId() === object.metadata?.uid); const index = items.findIndex(item => item.getId() === object.metadata?.uid);
const item = items[index]; const item = items[index];