Introduce new more efficient LittleEndianConvert trait #290
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This version is more efficient, smaller and more elegant than the old version.
Unfortunately this is a breaking change for implementers of the old
LittleEndianConvert
trait, however, sincewasmi
provided implementations for all necessary types this breakage will possibly be alright.The new trait definition was a result of the work from #287.
Merging this PR will make the common base of both
v0
andv1
implementations ofwasmi
slightly bigger.Benchmarks
There was no noticeable difference between the two versions, however, I think that's partially due to the fact that our benchmarks do not really test out the memory accesses in depth.
Before
After