Last active
August 11, 2017 18:08
-
-
Save oyvindln/3d9c074f22e249f15d7e3f89267e0310 to your computer and use it in GitHub Desktop.
rust vs cpp diff
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
// clang++ -S -std=c++11 -emit-llvm -vec.cpp -o vec_cpp.ll | |
// lines: 891 | |
// ( wc -l vec_cpp.ll ) | |
// with stripped blank lines and comments: | |
// ( sed '/^\s*;/d;/^\s*$/d' vec_cpp.ll | wc -l ) | |
// 698 | |
#include <cinttypes> | |
#include <vector> | |
int main(int, char* []) { | |
auto v = std::vector<int32_t>(0, 100); | |
for (auto n : v) { | |
} | |
} |
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
// rustc +nightly --emit llvm-ir vec.rs -o vec_rust.ll | |
// lines: 4634 | |
// ( wc -l vec_rust.ll ) | |
// with stripped blank lines and comments: | |
// ( sed '/^\s*;/d;/^\s*$/d' vec_rust.ll | wc -l ) | |
// 3523 | |
fn main() { | |
let v = vec![0i32;100]; | |
for n in v { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment