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
import Base.Threads | |
import Random | |
using Logging | |
function main(n=1000; exec=:base) | |
for seed in 1:n | |
executor = if exec == :base | |
BaseExecutor() | |
elseif exec == :par | |
ConcurrentExecutor(seed) |
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
julia> @code_llvm length_separate_loop(Vector{Int}(undef, 1000)) | |
; Function Signature: length_separate_loop(Array{Int64, 1}) | |
; @ REPL[19]:1 within `length_separate_loop` | |
define void @julia_length_separate_loop_7603(ptr noundef nonnull align 8 dereferenceable(24) %"a::Array") #0 { | |
top: | |
%"new::Tuple" = alloca [1 x i64], align 8 | |
%0 = getelementptr inbounds { ptr, ptr }, ptr %"a::Array", i64 0, i32 1 | |
%1 = load ptr, ptr %0, align 8 | |
%.unbox = load i64, ptr %1, align 8 | |
%2 = getelementptr inbounds i8, ptr %"a::Array", i64 16 |
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
module MyPackage | |
include("utils.jl") | |
include("foobar.jl") | |
end |
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
using InteractiveUtils | |
struct Foo | |
a::UInt | |
b::NTuple{32, UInt8} | |
c::NTuple{4096, UInt8} | |
d::NTuple{4096, UInt8} | |
end | |
ident(_) = 0x0 |
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
using BenchmarkTools | |
using StarWarsArrays | |
only_bench(x) = only(x) | |
one_idx_bench(x) = x[1] | |
deref_bench(x) = x[] | |
first_bench(x) = first(x) | |
twod_one_idx_bench(x) = x[1,1] | |
splat_bench(x) = x[ones(Int, 100)...] | |
end_bench(x) = x[end] |