You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently em.populate leverages the dataloader-driven batching of relations, and basically walks the tree of entities/relations calling .load.
This works, but it means every loaded relation creates a promise, which in a tree of ~10k-50k entities, can start to show up, in terms of runtime overhead.
We should be able to use the same approach as join/JSON preloading, which:
Doesn't actually flip relations to immediately loaded
Instead caches the relation key -> data in an internal cache
When relation.get is called, besides just isLoaded, we check isLoaded || data-in-cache
If done well, ideally this approach would mean we'd only have 1 promise per level/per wire call.
This can also explore removing the dependency on dataloader all together, because the biggest rationale for dataloader's "lots of promises" creation is to ensure each call site gets the information returned from the prior. Joist's em.populate doesn't actually need this, and we just need to know "okay loading is done", and then return the entities as-is.
The text was updated successfully, but these errors were encountered:
Currently
em.populate
leverages the dataloader-driven batching of relations, and basically walks the tree of entities/relations calling.load
.This works, but it means every loaded relation creates a promise, which in a tree of ~10k-50k entities, can start to show up, in terms of runtime overhead.
We should be able to use the same approach as join/JSON preloading, which:
relation key
->data
in an internal cacherelation.get
is called, besides justisLoaded
, we checkisLoaded || data-in-cache
If done well, ideally this approach would mean we'd only have 1 promise per level/per wire call.
This can also explore removing the dependency on
dataloader
all together, because the biggest rationale for dataloader's "lots of promises" creation is to ensure each call site gets the information returned from the prior. Joist'sem.populate
doesn't actually need this, and we just need to know "okay loading is done", and then return the entities as-is.The text was updated successfully, but these errors were encountered: