Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize mono_gc_bzero and mono_gc_memmove to closely match native pe…
…rformance. * gc.c (mono_gc_memmove): Doing naive word copy turned out to be several times slower than optimized memmove.Doing optimized memmove is a hellbent problem because each target (x86, amd64, arm, etc) have multiple implementations based on which CPU you're currently running on. Given we're not ready to suck in ten thousand lines of assembly for the benefit of a few targets a better solution is needed. The problem we face is due to implementations that don't perform word stores on the word aligned parts of the destination. This does break things for us as the CLI environment disallows word tearing for normal operations. The solution is then to work around the silliness of the known implementations that basically handle any sorts of misalignment badly. To do so we ensure that we only call memmove with a word aligned destination and a word multiple size. This should be enough for OSX, Android, linux and iOS on x86, amd64 and ARM.
- Loading branch information
Showing
2 changed files
with
102 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters