Are you telling me a readonly property is wrecking my performance?
1–10 of 40 posts
Re: Are you telling me a readonly property is wrecking my performance?
#2Re: Are you telling me a readonly property is wrecking my performance?
#3Re: Are you telling me a readonly property is wrecking my performance?
#4Afaik let in JavaScript also has a sizable penalty too, if not quite as bad as const . Var on and on.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Runtime TDZ checks can be performance issues:
Re: Are you telling me a readonly property is wrecking my performance?
#5 for (...) {
el.style.height = `${something}px`;
whatever.value = el.style.offsetHeight;
}
This forces the browser to recalculate layout multiple times in a single frame. Separating layout changing code from measurement code will help a lot here (most frameworks out there have solved this so we don't have to be too concerned about it though).Re: Are you telling me a readonly property is wrecking my performance?
#6Re: Are you telling me a readonly property is wrecking my performance?
#7Speed and user UX are important, but if it's a screen the user is constantly watching, you might remove the abstraction. However, if it's something like a waiting screen after payment, you'd probably keep it. In the end, what matters is the user flow
Re: Are you telling me a readonly property is wrecking my performance?
#8The biggest performance bomb you can have in your code is a loop that does something like for (...) { el.style.height = `${something}px`; whatever.value = el.style.offsetHeight; } This forces the browser to recalculate layout multiple times in a single frame. Separating layout changing code from measurement code will help a lot here (most frameworks out there have solved this so we don't have to be too concerned abou…