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
Destructuring $derived with N values results in code size that is quadratic in N. The expected outcome is that it would be linear by destructuring only the value that is actually used.
For example, destructuring 26 values results in code that destructures 26 values being repeated 26 times, resulting in 676 destructurings. See the JS output in the REPL example below.
This issue doesn't occur when destructuring $props.
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Destructuring
$derived
with N values results in code size that is quadratic in N. The expected outcome is that it would be linear by destructuring only the value that is actually used.For example, destructuring 26 values results in code that destructures 26 values being repeated 26 times, resulting in 676 destructurings. See the JS output in the REPL example below.
This issue doesn't occur when destructuring
$props
.Reproduction
https://svelte.dev/playground/hello-world?version=5.33.1#H4sIAAAAAAAACrWQzU7DQAyEX2VkcWilUXoPBYkbXBA3DoRD2rh0YbsJWbdpG-Xd0fJXKrVHLpY1tjXjr5dQrlRyuVXva3R16yuMtHKm1VgoC-c1Sv7Ui-2atJcE4c_VTdNkcaPekjYro57S53UwDRYll2mct66x6yIUNpnAxbhWdM6WuKi0dRut0sSroUfT1g0GXOEidXE0vjzMSmJGzImKUGJBvBBLwhGvxBvhiRURiJpoiHeiJSJhxJrYEB2xJXbE_svj236UvJLTdPIbVSimW5Pc2rUOPIPivr5L3zw6Wz6kvCe5nF86DynUR5w-YfwniQPtPwz6cihCP0tlPhQhy7Ii9PvhGM0zxUrnOxcqyReljzp8AC9EOYRgAgAA
System Info
Svelte REPL with version 5.33.1
Severity
annoyance
The text was updated successfully, but these errors were encountered: