Message201561
| Author |
neologix |
| Recipients |
christian.heimes, ncoghlan, neologix, pitrou, python-dev, serhiy.storchaka |
| Date |
2013年10月28日.17:52:52 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<CAH_1eM31k8CSijkKEvPwoL_T3k7zfO+3HJQXjE13c9bygdrh3Q@mail.gmail.com> |
| In-reply-to |
<526E8EB7.70101@cheimes.de> |
| Content |
>> Well, unaligned memory access is usually slower on all architectures :-)
>> Also, I think some ARM architectures don't support unaligned access, so
>> it's not really a thing of the past...
>
> On modern computers it's either not slower or just a tiny bit slower.
> http://lemire.me/blog/archives/2012/05/31/data-alignment-for-speed-myth-or-reality/
I have other benchmarks that show slowdowns of more than 40%:
http://www.alexonlinux.com/aligned-vs-unaligned-memory-access
Also, x86 has optimized unaligned memory accesses, but the world isn't
x86-only (once again, there's ARM, and AFAICT the performance hit can
be quite high).
Now, I perfectly understand that you don't want to mess with the
implementation, but just don't say that "unaligned access doesn't
matter, and is just a tiny bit slower".
IMO the compile-time check is enough. |
|