perf(ivy): do not use spread operations in styling (#29795)
While investigating styling performance regressions, it was discovered that a single `fn(...args)` operation was causing a performance hit because the generated es5 `__spread` operation uses `[].concat` and reads from the `arguments` values (which are not very efficient). This patch changes that around to use `fn.apply` instead. PR Close #29795
This commit is contained in:
parent
3e4698564a
commit
675f3909d7
|
@ -65,7 +65,7 @@ export function flushQueue(context: StylingContext): void {
|
|||
i += HostInstructionsQueueIndex.Size) {
|
||||
const fn = buffer[i + HostInstructionsQueueIndex.InstructionFnOffset] as Function;
|
||||
const args = buffer[i + HostInstructionsQueueIndex.ParamsOffset] as any[];
|
||||
fn(...args);
|
||||
fn.apply(this, args);
|
||||
}
|
||||
buffer.length = HostInstructionsQueueIndex.ValuesStartPosition;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue