Performance impact of "$if" ?
According to the documentation, $if "has an impact on typescript performance and it should only be used when necessary". I would like to use it for conditional selects. How bad is the performance impact? Thanks in advance!
Solution:Jump to solution
It's impossible to predict. But if you start seeing long pauses before you get intellisense, try to reduce the
$if
calls to see if it helps. The impact is much smaller now than it was when I wrote that doc.4 Replies
Solution
It's impossible to predict. But if you start seeing long pauses before you get intellisense, try to reduce the
$if
calls to see if it helps. The impact is much smaller now than it was when I wrote that doc.So is the performance more on the development? like TypeScript trying to consolidate the types? Or is it runtime performance impact?
Of course only on development. Only on IDE intellisense. How could that function affect runtime performance? Kysely only builds SQL strings. Nothing you do to build a SQL string can ever take a meaningful time.
I see, that's great news! Thanks for quickly answering my question!