Open
Description
Description
I'm working on creating a LWC with our 3D building viewer.
The 3D engine uses Float32Array
to build GPU buffers.
When using Lightning Web Security, it is very slow. Operations usually done in ~0.5 second can take up to 50 seconds.
Digging in the debugger, I found assignation is very slow.
Steps to Reproduce
Go to https://developer.salesforce.com/docs/component-library/tools/lws-console
Copy-paste following code:
const size = 10_000_000;
const array = new Float32Array(size);
console.time("OperationTime");
for (let i = 0; i < size; i++) {
array[i]++; // Any assignation is slow
}
console.timeEnd("OperationTime");
Open the console, toggle LWS: Enabled
/LWS: Disabled
and click on Evaluate
If needed, I can provide a more complex example.
Expected Results
Execution time similar with LWS (or at least not 50x slower)
Actual Results
Firefox: 7320 ms with LWS, 170 ms without
Chrome : 2902 ms with LWS, 50 ms without
Browsers Affected
All
Version
Tested with LWC 5.0.2
I don't know which version lws-console
uses.
Activity