Skip to content

Commit

Permalink
perf: large props could cause lower performance
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobrosenberg committed Sep 12, 2024
1 parent 82ccc9b commit 06a2b76
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/runtime/renderer/ComposeFragments.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
/** @type {RenderContextOptions} */
export let options
let oldOptions = null
let optionsChangeCounter = 1
$: {
const jsonOptions = JSON.stringify(options)
const { props: _props, ...optionsWithoutProps } = options
const jsonOptions = JSON.stringify(optionsWithoutProps)
optionsChangeCounter =
jsonOptions !== oldOptions ? optionsChangeCounter + 1 : optionsChangeCounter
oldOptions = jsonOptions
Expand Down

0 comments on commit 06a2b76

Please sign in to comment.