Skip to content

Instantly share code, notes, and snippets.

View mdmaas's full-sized avatar
🙂

Martín D. Maas mdmaas

🙂
View GitHub Profile
@mdmaas
mdmaas / jarrays.jl
Last active September 29, 2023 14:00
Simple performance benchmark of Julia custom array types
using LoopVectorization
using Bumper
using StrideArraysCore
using StaticTools
set_default_buffer_size!(1000)
@inline function sumArray_alloc(N)
smallarray = Array{Float64}(undef,N)
@turbo for i ∈ 1:N
@mdmaas
mdmaas / vector_vs_stack_array.cpp
Created April 5, 2023 06:44
Simple performance benchmark of stack, heap, and pre-allocated arrays and std::vector
// g++ vector_vs_stack_array.cpp -O3 -o vector
#include <numeric>
#include <vector>
#include <chrono>
#include <iostream>
#include <cmath>
using namespace std::chrono;
double sumNewArray( int N ) {