dev-docs/RFCs/proposals/off-thread-attribute-generation-rfc.md
Notes:
dataUrl RFC has been approved and implemented. Parts of that RFC were originally part of this RFC, but broken out as that proposal has a much wider applicability independently of the features described here.As I was working on performance-sensitive applications, I observed that loading very large data objects into a layer causes the main thread to freeze.
There are several areas that may become computationally intensive as the size of the data grow:
PolygonLayer (triangulation) and GridLayer (aggregation). Moreover, users may provide complex accessors that further impact the performance.The proposed solution is to offer an option to move the above processes off the main thread. By doing so we improve the UI responsiveness and potentially the performance by processing data in parallel.
I have successfully moved the data processing for PointCloudLayer into a worker in a reference application. The key in doing so is utilizing transferList in passing messages among threads. Serialization typically defeats the advantages of off-thread processing when exchanging large data objects. The transferList interface avoids serialization by passing typed arrays by reference.