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
Currently super.rangeCheck is used a lot in the code to throw RangeError before writing into a buffer whenever a bound will be crossed (in comparison without this check we may have partial writes meaning that the buffer may contain invalid data).
This "correctness" comes with a small performance penalty for each class that inherits SizedType.
For single types the penalty is not much but for compound types like arrays, tuples and struct it can become quite a hassle.
With rangecheck
Without rangecheck
I think it may be a good idea to either remove the rangecheck entirely and just declare the written buffer as not good to read from.
Alternatively we can remove a bit of the penalty in compound types and only let the top level type do the range check (all types under the top level will do a bound check that is less than the total size of it's parent)
Some data: Time penalty is anywhere from 37% (cold start) to 12% (avg)
The text was updated successfully, but these errors were encountered:
Currently
super.rangeCheck
is used a lot in the code to throwRangeError
before writing into a buffer whenever a bound will be crossed (in comparison without this check we may have partial writes meaning that the buffer may contain invalid data).This "correctness" comes with a small performance penalty for each class that inherits
SizedType
.For single types the penalty is not much but for compound types like arrays, tuples and struct it can become quite a hassle.
With rangecheck
Without rangecheck
I think it may be a good idea to either remove the rangecheck entirely and just declare the written buffer as not good to read from.
Alternatively we can remove a bit of the penalty in compound types and only let the top level type do the range check (all types under the top level will do a bound check that is less than the total size of it's parent)
Some data: Time penalty is anywhere from 37% (cold start) to 12% (avg)
The text was updated successfully, but these errors were encountered: