You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In several places, for example in partial, we currently still use .reduce. For performance reasons, it may make sense to change this to a for...of loop. Since we use for...of in several other places in the library, this change should not affect the bundle size due to compression and should make the code more consistent.
Is the usage of .reduce really a bottleneck in applications that use valibot? I usually recommend to avoid micro-optimizations, especially when it is about language features, because the performance could change with every new release of the engine (e.g. v8).
So I think a data-driven approach would be better. E.g. having a benchmark suite, which tests the real-world usage of valibot. This could then be used to identify the performance bottlenecks. Optimizing something that is not the bottleneck is usually waste or in the worst case it increases the complexity or maintainability of the codebase without any benefits.
In several places, for example in
partial
, we currently still use.reduce
. For performance reasons, it may make sense to change this to a for...of loop. Since we use for...of in several other places in the library, this change should not affect the bundle size due to compression and should make the code more consistent.Idea for this change comes from @kurtextrem in #202
The text was updated successfully, but these errors were encountered: