Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issues with Svelte 4 / 5 interop and deep_read #10628

Closed
Prinzhorn opened this issue Feb 24, 2024 · 3 comments
Closed

Performance issues with Svelte 4 / 5 interop and deep_read #10628

Prinzhorn opened this issue Feb 24, 2024 · 3 comments

Comments

@Prinzhorn
Copy link
Contributor

Prinzhorn commented Feb 24, 2024

Describe the bug

I've ported over a demo of my virtual list from Svelte 4:

https://svelte.dev/repl/65779175ebc0493392bdf718f6eecb2a?version=4.2.12

to Svelte 5 (using runes and snippets):

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAA41YbY_bNhL-KxOnxcq7suXtIl-89vbaS4ML0CAHpHfBoS5aWhxZvKVIHknZVgz99wNJvVC7GyD5kiU1Mxw-88JnfJkVjKOZrX-_zASpcLae_aTULJ3ZRrmFOSK3OEtnRtY6dzsbk2um7MNOALBKSW3hAlJ8kLWwKUjxFo3VsoEWCi0ruAoWru4j-X8zbWvCf2XGdkLLLNpbjipOiaMFw6qaE4vvECls4TtjicXE6hrn973MXspHM34UeIKftCZNcrv6c7VazZcF4zwRNefzZUVUkvyZApvD9gEuO7GzO6vR1lq4Ffh_jK6Bpf3KMstxDZ-sZuKQfCC2XGoiqKyS-bwTap2ddj6PHM-lsIQJ1KNjo8cm15Lz36QaP67Gr4PqP5AdSgtbmAg5sSyDd-yMFJjFCsogxwQodkZulp3IbyUzkMuaU8hlhUCZxtzyJmBPwFipERJcHpbACqgNagM5Ec6Dgh1qjWBLjMy71b_ez3v7HzXsEShqdkQ6NWpLYqGUnBqvtCcGoZDCBfRLf6Q774XjRjEmoJG1BqJUfGZOeO6TgkJtmDjA248flvC5JBaPqIOKxv_VTGOFwhogGpc9uA6wAde7VRSxQpMKhyBYVqHuvha1yC2TApTkPJn3icIKSIZYLceYvtpuxwjPx7SKo_6C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R_RUAkfCRbsm5X8V2nNEGgifdi9BCjkJz3blfiwaSW3PKl4go8NxP6x-uJ2S5ZIo1bjO63-fGLlZRLhWL3Gz1bdwlD_a_wOmDr6kKxUAAA==

According to performance recordings it performs even better than Svelte 4. Amazing!

However, during porting I noticed the following: if I keep VirtualList.svelte in Svelte 4 code and only port App.svelte then performance tanks massively.

Svelte 4:

image

Svelte 5:

image

Mix:

image

image

Reproduction

Open the REPLs and scroll up/down, here's the mixed 4/5 one:

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAA41YbY_bNhL-KxMnxcq7tmV3kS9ea4v0csEFaJAD0jY41EVLiyOLtxSpIymvFcP__TCkXujNBki-xCKHw5ln3h7uaVIIiXay_uM0UazCyXrypq4ns4lra_qwB5QOJ7OJ1Y3JaWVjcyNqd79VAKKqtXFwAq0-6Ea5GWj1Fq0zuoUzFEZXcBU0XN1F8r8L4xomfxHWdUKLNFpbjEfokEQHVlSNZA7fIXLI4JV1zGHiTIPTu15mp_WDHTcVPsIbY1ibrJZ_LZfL6aIQUiaqkXK6qFidJH_NQEwhu4fTVm3d1hl0jVH0Bf6f4GsQs_7LCSdxDZ-cEWqffGCuXBimuK6S6bQTOpOe83QaGZ5r5ZhQaEbDRottbrSUv-p63FyOu8PRf6HYlw4yuBAisTSFd-KIHITDCsogJxTU4ojSLjqRX0thIdeN5JDrCoELg7mTbcCegXXaICS42C9AFNBYNBZypsiCQuwbg-BKjNTT12_vp73-jwZ2CByNOCC_VOpK5qDUklt_aMcsQqEVBfRLfyXd98x1o5hQ0OrGAKvr-M6cydwnBYfGCrWHtx8_LOBzyRwe0IQjBv_XCIMVKmeBGVz04BJgA663yyhihWEVDkFwokLT7RaNyp3QCmotZTLtE0UUkAyxWowxfZFlY4SnY1rFUX_m3N2YS_6Htwcy7wpa90aJipEV72g9IVNCynQHukpMkj6zv19HkE1T-NRVG1ANceYYMGPEQaj9Ish4VCADi-69cmgOTF5eGFB5EZdthABAKLW7fmFwFqDQBhIfIchge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3pm7TvKpPZpNJcFAL5ZE38_DwbHhZRS_3eB0aawmfKtBBpBn-PobRO5A_t31AiIw-0gUJrF4gfKGqHTkPNrI3Ja4kdB8Sjz1RP-PyxgQyGThTthwu-ve8L4unik5n33Jnnd2IeSFu5VtaFFPjUVjstIYPwI7nqEsNhdTV9ylGtFDmG9w8zZgbWMeNmgGokYswQh2PGLLxwEokM9UEm4bHG3CH_xXMKyEgC5kFjTBvfF_CIwLW6cqH3o9LNvuw7Bl5JCfQGo2xrangUruxyG5UzAu1iUOVHTsUe0AKR-daVIf5SO2rOAs3MIyOso55NzV2itYB8j3NqHu1i6MkSgSDoKBFsnvgTsUiS8gwygnv6lI93r0RmTFy4I-6lKFyEe05sfLgjTeEf_iFWG71jO9nSy0nXTlTiC_IZ7KhyHZhGWeqHvuC5_oL0WXRAWu3b2HHRd5yvCbO_9ClHJu8a5e3zeNS6TqaRe9927tUapLZuKIGLiri5KKC7Tr5rUMORp4_ZeaSxP-Mn51hono5X7Jhc6JoFFPpoXkelNO0VqaZ676HqlOQo5KUWSONzcAOrwQjK6veK47E_XUitTTK-2tLnrkTF-0ORhpvBlMi0jwc0ktWXkj98Jek5wgDG4NL1097xag17qXdMfiwKiyQbn7z-lg-R0OCEbwNk15jDURvxuM8io2eD19NZ5NjXj5OYw4cgbycDc--H6CkOfyDy4BjxXzxm28l81RH700tkednZyqyHYwZerKfxVmo3vEMdVpnn-5Bl2UUj_QkaFSghh7UXPPenvNjzxwaZNjtdAH8DibcCNnGUf7oIxxqW005BGrxJyZvzxQsjYugBk76GLwndMO7_bfCAfszjSIZ41y38n2N2EpEHMmaoJc8gZ2GkVvRXmpFw9hP_GaI4XPfj8sfVJZEtWV231AL9HwZG3hSRoeVzvGn5Pfzhz_P_AaOyYL6kFAAA

Logs

No response

System Info

Likely irrelevant

Severity

blocking an upgrade

@Prinzhorn
Copy link
Contributor Author

Prinzhorn commented Feb 24, 2024

FWIW running the Svelte 4 version ($: + <slot>) in Svelte 5 performs minimally worse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QhyszsG6inTURZDkeUWjjhSSDS14c1CY8VZgbpJ8cpILUSMPcaQ9r4kMMBgUpxZXzvRyHrXdF1DLziHHLGuc22uvJPOO8CCqMY6kWvyo2ckjyhBkvmG_uSs_Hn0rh3IKqZQ4ZpY3u2be7uaYd0h3PbPJpF35M5goWgpUSwvvAnYJFWyjHIAO7pJR_31NXKhoU74F6w3AS4Z5aN93fEMfzNPcQqJbdkyxv7cpKVYSV7RjpzL1hmQNVC237oCp7KZ7SfeQuklq6NHRddx3lJmN2llxzZelcLZ5_Do5LVZBq4923nfkiAS236EhhVxM2ogO5a-bZB9Ucu37DzQGN3xk3OodAcHS_JcTLSNfModNG8Dkpp2ikSdfngoGqVZMj4WAvE4Tm4gVVvhM3qB0Hx2J3OuZRqMrza4teuREG7Q4GGm96UwLTHPSpOqrHkjy8kHUfowehdur7sHT8ksONyS_hjnmu0suHJ62_5EAj1Trg2YO0acjhoIw73WWD0rPd6Ogsce_k4CTm8D_Im6pl7N0RPYfg9kQdDLP_FY7qJ5quW2J_eIsmK1laiHRwzcGIdjddcmv4darBMHd-HNE1HjfRnqIWnhBQSJ3juTjmx14_1Mk16GgF_AxNnBazDKP88CkcCy2mrIPbexNab8-iFETB0j0lXw2NC14_73xTu0Y15HMgQbbuF-3fMliNST8aUbckzyIgfqaX9L81AOLuJ_wpR7K_7afnTakxkC1JVjW2B7h8DA28KyNDyNd60_B7-8Of5_1NdKVgjFQAA

@Antonio-Bennett
Copy link

I know #10624 was done today did you try with latest?

@Prinzhorn
Copy link
Contributor Author

If I understand correctly, this was deployed to the REPL before I opened this issue.

Anyway, I'll close this and open a new issue simply because I think I can provide a much more simplified REPL. It was 1:30 last night 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants