ocaml - 为什么 int32s/int64s 比 int 慢?

标签 ocaml

我刚刚在 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/

相关文章:

module - 如何从接口(interface)获取模块类型?

F# 更改为 OCaml

f# - F# 和 OCaml 等函数式语言中的 "let"关键字有什么用?

functional-programming - 为什么 OCaml List.fold_right 没有实现为尾递归?

ocaml - camlzip : "This package relies on external (system) dependencies that may be missing."

ocaml - oCaml 中::and ' 是什么意思?

ocamlmktop 与 oasis

ocaml - 我如何使用 Pgocaml 编译一些东西

recursion - OCaml 评估期间的堆栈溢出

functional-programming - 已安装 ocamlfind (findlib),但在 Mac 中始终找不到任何额外的包