-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Closed
Labels
Feature:Saved ObjectsTeam:CorePlatform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//enhancementNew value added to drive a business resultNew value added to drive a business resultperformance
Description
The client-side savedObject client is using a pooling mechanism for get operations
kibana/src/core/public/saved_objects/saved_objects_client.ts
Lines 362 to 371 in d4b2a51
| public get = <T = unknown>(type: string, id: string): Promise<SimpleSavedObject<T>> => { | |
| if (!type || !id) { | |
| return Promise.reject(new Error('requires type and id')); | |
| } | |
| return new Promise((resolve, reject) => { | |
| this.batchQueue.push({ type, id, resolve, reject } as BatchQueueEntry); | |
| this.processBatchQueue(); | |
| }); | |
| }; |
kibana/src/core/public/saved_objects/saved_objects_client.ts
Lines 162 to 167 in d4b2a51
| private processBatchQueue = throttle( | |
| () => { | |
| const queue = cloneDeep(this.batchQueue); | |
| this.batchQueue = []; | |
| this.bulkGet(queue) |
When calling client.get multiple times with the same type/id tuple, the resulting bulkGet that fires contains these duplicates.
We should remove the dupes when calling the backend, and then optimize the logic to dispatch (copies of) the object to the get calls that requested the same object.
Metadata
Metadata
Assignees
Labels
Feature:Saved ObjectsTeam:CorePlatform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//enhancementNew value added to drive a business resultNew value added to drive a business resultperformance