Skip to content

Instantly share code, notes, and snippets.

Avatar

Nathan Daly NHDaly

View GitHub Profile
View plot_snoopl.jl
using CSV
#using UnicodePlots
"""
plot_snoopl(func_csv_file, llvm_csv_file; out_csv_path="")
Print a barplot to stdout, optionally output a CSV file with the results, and return a
table with the results.
# Example
View cloudSettings
{"lastUpload":"2021-08-25T20:15:13.422Z","extensionVersion":"v3.4.3"}
@NHDaly
NHDaly / jupyter_notebook_config.py
Created Nov 28, 2019
Jupyter configuration to auto-export scripts with markdown->comments, even for non-python languages (Julia)
View jupyter_notebook_config.py
import io
import os
from notebook.utils import to_api_path
_script_exporter = None
_html_exporter = None
def script_post_save(model, os_path, contents_manager, **kwargs):
if model['type'] != 'notebook':
return
@NHDaly
NHDaly / MultithreadingBenchmarks.jl-7ff486-ec2-r5d.24xlarge.output
Created Aug 27, 2019
Output from running MultithreadingBenchmarks.jl/test/runbench.jl at 7ff486 on EC2 `r5d.24xlarge`
View MultithreadingBenchmarks.jl-7ff486-ec2-r5d.24xlarge.output
unpacking sources
unpacking source archive /nix/store/zwgb1rq126al7lbkxlbnwlfwqkn9h2h2-multithreading
source root is multithreading
patching sources
configuring
no configure script, doing nothing
building
processor : 0
vendor_id : GenuineIntel
cpu family : 6
View changes-to-julia-stdlib-inlining-v1.0.3-cleaned.txt
promote_type(Type{T}, Type{UInt64}) where {T}
promote_type(Type{Bool}, Type{S}) where {S}
promote_type(Type{Bool}, Type{#s55} where #s55<:Integer)
promote_type(Type{T}, Type{UInt32}) where {T}
promote_type(Type{UInt64}, Type{S}) where {S}
_is_convertible_Int(Integer)
_promote(Real, Integer)
_promote(Real, Real)
iterate(Core.Compiler.Iterators.Zip2{_, _} where _ where _)
iterate(Core.Compiler.Iterators.Zip2{_, _} where _ where _, Tuple{Any, Any})
View changes-to-julia-stdlib-inlining-v1.0.3.txt
13:10:10  ~/src/julia   v1.0.3-inline-investigation ✘ ✹ ✭  make -j 6
JULIA usr/lib/julia/corecompiler.ji
essentials.jl
some.jl
ctypes.jl
generator.jl
reflection.jl
options.jl
promotion.jl
tuple.jl
@NHDaly
NHDaly / git-julia-format
Last active Jan 2, 2019
Git configuration to run DocumentFormat.jl on only the lines modified in the last git commit
View git-julia-format
#!/usr/bin/env julia
#
#===- git-juliafmt - DocumentFormat.jl Git Integration ---------*- julia -*--===#
#
#===------------------------------------------------------------------------===#
module GitJuliaFormat
println("Running DocumentFormat on modified lines!")
@NHDaly
NHDaly / decimal-representation-comparisons.jl
Created Dec 6, 2018
Benchmark for the performance of FixedPointDecimals relative to other types
View decimal-representation-comparisons.jl
# Decimal Representation Comparisons
#
# This benchmark compares the performance of several numeric representations, over various
# numeric operations (+,-,*,/,÷...) on large arrays of numbers, in order to guide
# decision-making about how to represent fixed-decimal numbers.
#
# It compares fixed-decimal types against the builtin Int and Float types of various sizes.
# The output is written to a .csv file in the same directory as this file.
module DecimalRepresentationComparisons
@NHDaly
NHDaly / decimal-representation-comparisons.jl
Created Nov 5, 2018
Benchmark Comparisons of representing numbers as Ints, Floats, and FixedDecimals of various bit sizes.
View decimal-representation-comparisons.jl
# Representation Comparisons
#
# This benchmark compares the performance of several numeric representations, over various
# numeric operations (+,-,*,/,÷...) on large arrays of numbers, in order to guide
# decision-making about how to represent fixed-decimal numbers.
#
# It compares fixed-decimal types against the builtin Int and Float types of various sizes.
# The output is written to a .csv file in the same directory as this file.
module DecimalBenchmarkComparisons
@NHDaly
NHDaly / julia-regex-replace-function-call-with-macro.jl
Created Oct 24, 2018
Regex: remove parens to turn a julia function call into a macro call
View julia-regex-replace-function-call-with-macro.jl
julia> m = "call( a( x()-1 ), 2+2 )"
>> "call( a( x()-1 ), 2+2 )"
julia> replace(m, r"a(\(((?>[^()]|(?1))*)\))" => s"@b \2")
>> "call( @b x()-1 , 2+2 )"
julia> # You can see the two capture groups here: the first around the parens (used for recursion), and the second inside the parens (for substitution).
julia> match(r"a(\(((?>[^()]|(?1))*)\))", m)
>> RegexMatch("a( x()-1 )", 1="( x()-1 )", 2=" x()-1 ")