How to check if createMemo should be used?
I'm trying to figure out if using createMemo is or isn't worth it.
I know that for super basic equality checks, there is probably no point.
But what about something slow, like code highlighting?
What I don't understand is that what happens when my content changes. I think the whole function needs to be re-run, so the memo doesn't help.
Or does it, still?
Also, what about the case, when this whole component is just item in a <For> loop. I mean I'm parsing the markdown like this:
So I have lot of small tokens which is processed in a <For> component, like this:
So what is happening here exactly with Solid? I mean I have a changing Markdown input -> changing array of parsed tokens -> a potentially lot of possible code-reuse for syntax highlighting. Is createMemo helping here or not?
How can I check if it helps? Putting a console.log inside createMemo which should not trigger?
I know that for super basic equality checks, there is probably no point.
But what about something slow, like code highlighting?
What I don't understand is that what happens when my content changes. I think the whole function needs to be re-run, so the memo doesn't help.
Or does it, still?
Also, what about the case, when this whole component is just item in a <For> loop. I mean I'm parsing the markdown like this:
So I have lot of small tokens which is processed in a <For> component, like this:
So what is happening here exactly with Solid? I mean I have a changing Markdown input -> changing array of parsed tokens -> a potentially lot of possible code-reuse for syntax highlighting. Is createMemo helping here or not?
How can I check if it helps? Putting a console.log inside createMemo which should not trigger?
