2014-05-09から1日間の記事一覧

RustにおけるOptionの最適化

ネタ元: performance - What is the overhead of Rust's Option type? - Stack OverflowRustにはnull値がなく、代わりにOptionを使う。このOptionは、ポインタ型に対しては最適化されるそうだ。確認してみる。(rustc 0.10を使った。) use std::mem::size_of;…