sdk
sdk copied to clipboard
performance: extracting lane from Int32x4 is very slow
This issue was originally filed by @tatumizer
Good news: operations over Int32x4 are lightning-fast. Bad news: there's nothing one can do with results of these operations, at least in 32-bit mode (which dart uses on Windows no matter what processor). var foo=new Int32x4(0,1,2,3); var bar=foo.x; Assignment to bar takes 40+ nanoseconds. I understand that it's 32-bit number in the SIMD register, which generally doesn't fit in smi, but here we don't have a general case anyway, it's all small numbers.
I thought the following trick could help: var int32=new Int32List(1); and then var foo=new Int32x4(0,1,2,3); int32[0]=foo.x;
Normally, this solves all issues with full 32-bit numbers. But not in this case. Probably a known issue, I'm reporting just for the record.