This file contains hidden or 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
// https://godbolt.org/z/-Zq5A9 | |
#include <array> | |
#include <tuple> | |
#include <utility> | |
namespace detail { | |
class LoopFunc { | |
public: | |
LoopFunc(std::ptrdiff_t loop_max) : _loop_max{loop_max} {} |
This file contains hidden or 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
Linux 5.3.13-arch1-1 | |
Benchmark code https://github.com/Voultapher/hashmap-compare 197ef4d9b2b27741a67eb96ff1828e7a83529594 | |
clang version 9.0.0 | |
Run on (4 X 3000 MHz CPU s) | |
CPU Caches: | |
L1 Data 32K (x2) | |
L1 Instruction 32K (x2) |
This file contains hidden or 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
No particular order: | |
rg | ripgrep | |
fd | |
tokei | |
dua | dua-cli | |
tldr | tealdeer | |
tig | |
hexyl | |
exa |
This file contains hidden or 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
----- Running rust benchmarks ----- | |
Sat Dec 8 10:06:51 UTC 2018 | |
CONFIGURATION: fx_hash | |
running 50 tests | |
test tests::big::clone ... bench: 6,507,451 ns/iter (+/- 2,369,267) | |
test tests::big::copy_element_wise ... bench: 9,405,607 ns/iter (+/- 1,097,552) | |
test tests::big::fill_only ... bench: 5,362,458 ns/iter (+/- 27,196) | |
test tests::big::insert_random ... bench: 7,773,228 ns/iter (+/- 77,974) | |
test tests::big::lookup_all ... bench: 5,816,665 ns/iter (+/- 86,600) |
Hello, I'm interested in rustc' compile time. Some preliminary test left me with some questions.
I measured building a minimal application. https://gist.github.com/Voultapher/ebc3abb55994ea90f3ac604c5ffccc19
Things I noticed:
- nightly is significantly faster than stable, yay!
- clang's full run is less than emit llvm ir + compile llvm ir
- rustc's full run is much slower than emit llvm ir + compile llvm ir
This file contains hidden or 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
pub fn foo(a: i64, b: i64) -> i64 { | |
(a % 239082) % b | |
} | |
pub fn bar(a: i64) -> i64 { | |
foo(a, 77) | |
} |
This file contains hidden or 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
#include <cstdint> | |
auto foo(int64_t a, int64_t b) -> int64_t | |
{ | |
return (a % 239082) % b; | |
} | |
auto bar(int64_t a) -> int64_t | |
{ | |
return foo(a, 77); |
This file contains hidden or 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
; ModuleID = 'main0-8787f43e282added376259c1adb08b80.rs' | |
source_filename = "main0-8787f43e282added376259c1adb08b80.rs" | |
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | |
target triple = "x86_64-unknown-linux-gnu" | |
%"unwind::libunwind::_Unwind_Exception" = type { [0 x i64], i64, [0 x i64], void (i32, %"unwind::libunwind::_Unwind_Exception"*)*, [0 x i64], [6 x i64], [0 x i64] } | |
%"unwind::libunwind::_Unwind_Context" = type { [0 x i8] } | |
; main::return_option | |
; Function Attrs: norecurse nounwind readnone uwtable |
This file contains hidden or 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
; ModuleID = 'main.cpp' | |
source_filename = "main.cpp" | |
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | |
target triple = "x86_64-pc-linux-gnu" | |
; Function Attrs: readnone sspstrong uwtable | |
define { i64, i8 } @_Z15return_optionall(i64) local_unnamed_addr #0 { | |
%2 = icmp slt i64 %0, 32 | |
%3 = srem i64 %0, 752 | |
%4 = zext i1 %2 to i8 |
NewerOlder