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
# Recursively build binary search tree w/ known lookup values | |
# A is sorted array of lookup values | |
# R is return values for each index of A | |
# i.e. R[1] is returned for values < A[1], R[2] for < A[2], etc. | |
function searchsortedlasttree(A,R,var_name) | |
l = length(A) | |
mid = iseven(l) ? l>>>1 : (l>>>1)+1 | |
# Handle base case | |
if mid == 1 | |
if l == 1 |
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
In [7]: for (i,b) in enumerate(ubt) # unique, nonzero backtrace points | |
@show i, b # this way you'll know which one crashed, and can exclude it on the next run | |
println(Profile.lookup(b)) | |
end | |
(i,b) => (1,0x0000000065a0af1b) | |
LineInfo("jl_subtype_invariant","???",1705029403,true,1705029403) | |
(i,b) => (2,0x0000000065a0cd65) | |
LineInfo("jl_type_intersection","???",1705037157,true,1705037157) | |
(i,b) => (3,0x0000000065a0b5fb) | |
LineInfo("jl_subtype_invariant","???",1705031163,true,1705031163) |
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
macro NO_GC(ex) | |
quote | |
gc_disable() | |
ret = $ex; | |
gc_enable() | |
gc() | |
end | |
end | |
# func1: vcat(range) |
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_typed parse_value(ps,true) | |
1-element Array{Any,1}: | |
:($(Expr(:lambda, Any[:ps,:ordered], Any[Any[:ch,symbol("#s19"),symbol("#s18"),symbol("#s14"),symbol("#s13"),symbol("#s12"),symbol("#s11"),:ret],Any[Any[:ps,JSON.Parser.ParserState{ASCIIString},0],Any[:ordered,Bool,0],Any[:ch,Char,18],Any[symbol("#s19"),Bool,2],Any[symbol("#s18"),Bool,18],Any[symbol("#s14"),Bool,2],Any[symbol("#s13"),Bool,18],Any[symbol("#s12"),Bool,18],Any[symbol("#s11"),Bool,2],Any[:ret,Any,34]],Any[],Any[Bool,Bool,Char,Char,Char,Char,Char,Char,Char,Char,Char,Char]], :(begin # none, line 2: | |
((top(getfield))((top(getfield))(JSON,:Parser),:chomp_space)::Any)(ps::JSON.Parser.ParserState{ASCIIString})::Void # line 3: | |
unless (top(slt_int))((top(getfield))(ps::JSON.Parser.ParserState{ASCIIString},:e)::Int64,(top(getfield))(ps::JSON.Parser.ParserState{ASCIIString},:s)::Int64)::Bool goto 0 | |
return nothing | |
0: # line 5: | |
ch = ((top(getfield))((top(getfield))(JSON,:Parser),:charat)::Any)(ps::JSON.P |
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
# Validation Rules | |
# Each row must contain the same number of columns | |
# Each field must be formatted correctly and be of the right type and format, must be one of: | |
# Empty, missing value | |
# DATE | |
# DATETIME | |
# INTEGER | |
# DOUBLE | |
# STRING | |
# quoted by f.quotechar, with f.escapechar allowed within f.quotechar to specify literal f.quotechar, f.delim, or f.newline |
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
Warning: replacing module Mmap2 | |
Warning: replacing module Mmap2 | |
Warning: replacing module Mmap2 | |
Warning: replacing module Mmap2 | |
Warning: replacing module Mmap2 | |
signal (11): Segmentation fault: 11 | |
Program received signal SIGSEGV, Segmentation fault. | |
[Switching to Thread 0x121b of process 33745] |
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
# This file is a part of Julia. License is MIT: http://julialang.org/license | |
module Mmap2 | |
# platform-specific mmap utilities | |
pagesize() = Int(@unix ? ccall(:jl_getpagesize, Clong, ()) : ccall(:jl_getallocationgranularity, Clong, ())) | |
@unix_only begin | |
const SEEK_SET = Cint(0) | |
const SEEK_CUR = Cint(1) |
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
reload("/Users/jacobquinn/julia/base/mmap2.jl") | |
function seg(n) | |
file = tempname() | |
s = open(file, "w") do f | |
write(f, "Hello World\n") | |
end | |
for i = 1:n | |
m = Mmap2.Array(file) | |
m[1] |
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
Pkg.clone("https://github.com/quinnj/Mmap.jl") | |
Pkg.clone("https://github.com/quinnj/CSV.jl") | |
Pkg.add("ODBC") | |
Pkg.checkout("SQLite","jq/remodel") | |
Pkg.add("SQLite") | |
Pkg.checkout("SQLite","jq/updates") | |
reload("Mmap") | |
reload("CSV") |
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
### Micro performance benchmarks | |
# Results Data | |
## String Type | Benchmark | DateTime Run | | |
## Julia Version | Strings.jl Version | | |
## Time Elapsed | Bytes Allocated | GC Time | |
# reload("Strings") | |
results = Dict("String Type"=>ASCIIString[], | |
"String Length"=>Int[], |
OlderNewer