我刚刚在 Int32 模块的引用文档中读到了这个:
Performance notice: values of type int32 occupy more memory space than values of type int, and arithmetic operations on int32 are generally slower than those on int. Use int32 only when the application requires exact 32-bit arithmetic.
为什么 int32s 通常比 int 慢?是因为它们是盒装的还是什么?
最佳答案
Is it because they are boxed or something?
是的。
关于ocaml - 为什么 int32s/int64s 比 int 慢?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31718381/