Skip to content

Instantly share code, notes, and snippets.

View rr-codes's full-sized avatar

Richard Robinson rr-codes

View GitHub Profile
#!/usr/bin/env python3
import os
import re
import shutil
import subprocess
import sys
import pandas
from matplotlib import pyplot
#!/bin/bash
# Given a folder of source *.cpp files, compiles each file and profiles heap and stack usage with massif.
# Results are added to a "massif" directory in the pwd
# a) create two subdirectories titled 'generated' and 'massif' in the cwd
# b) iterate over each file inside the directory specified by the first argument
# c) for each file, run `g++` on it and store the executable in /generated
# d) for each file in /generated, run `massif` on it and store the output in \massif
# e) for each file in /massif, extract the relevant info via regex and store everything in $2
#!/bin/bash
# Given a folder of source *.cpp files, compiles each file and profiles heap and stack usage with massif.
# Results are added to a "massif" directory in the pwd
# a) create two subdirectories titled 'generated' and 'massif' in the cwd
# b) iterate over each file inside the directory specified by the first argument
# c) for each file, run `g++` on it and store the executable in /generated
# d) for each file in /generated, run `massif` on it and store the output in \massif
# e) done
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include "C:\\Users\\rir\\etl-18.1.3\\include\\etl\\vector.h"
#include "C:\\Users\\rir\\etl-18.1.3\\include\\etl\\array.h"
#include "C:\\Users\\rir\\etl-18.1.3\\include\\etl\\list.h"
#include <benchmark/benchmark.h>
constexpr size_t CONTAINER_SIZE = 10'000;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
namespace ConsoleApplication1
{
public struct Benchmark
#include <iostream>
#include <etl/algorithm.h>
#include <chrono>
#include <random>
#include <algorithm>
template<typename Clock, size_t Iterations, typename R, typename ...Args,
typename = std::enable_if_t<std::is_same_v<typename Clock::time_point, decltype(Clock::now())>>
>
constexpr auto measure(R (&fn)(Args...), Args &&... args) {
//
// Created by Richard Robinson on 5/22/2020.
//
#ifndef BENCHMARK_H
#define BENCHMARK_H
#include <chrono>
#include <ostream>
.file "main.cpp"
.text
.section .rodata
.type _ZStL19piecewise_construct, @object
.size _ZStL19piecewise_construct, 1
_ZStL19piecewise_construct:
.zero 1
.align 8
.type _ZL4SIZE, @object
.size _ZL4SIZE, 8
{
"context": {
"date": "2020-05-18 00:33:37",
"host_name": "richards-pc-elementary",
"executable": "/home/rir/CLionProjects/untitled/cmake-build-debug/untitled",
"num_cpus": 8,
"mhz_per_cpu": 4900,
"cpu_scaling_enabled": false,
"caches": [
{
#include <iostream>
#include <benchmark/benchmark.h>
#include <random>
#include <etl/algorithm.h>
static constexpr size_t SIZE = 10000;
static constexpr size_t REPETITIONS = 10000;
static constexpr size_t RANGE_MAX = 1000;
template<size_t Size>