Skip to content

Instantly share code, notes, and snippets.

View KristofferC's full-sized avatar
🇸🇪

Kristoffer Carlsson KristofferC

🇸🇪
View GitHub Profile
function feval_asy1(n::Integer, a::Float64, b::Float64, t, idx)
# Evaluate the interior asymptotic formula at x = cos(t).
# Number of terms in the expansion:
M = 20
# Some often used vectors/matrices:
onesT = fill(1.0,length(t))'; onesM = fill(1.0,M); MM = collect(0:M-1);
# The sine and cosine terms:
foo(N) = ntuple(d->3, N)
julia> @code_warntype foo(5)
Variables:
N::Int64
t::Tuple{Vararg{Int64,N} where N}
#temp#@_5::Tuple{Vararg{Int64,N} where N}
#temp#@_6::Tuple{Vararg{Int64,N} where N}
#temp#@_7::Tuple{Vararg{Int64,N} where N}
#temp#@_8::Tuple{Vararg{Int64,N} where N}
import HTTP
function create_event()
data_base64 = "eyJhY3Rpb24iOiJjcmVhdGVkIiwiY29tbWVudCI6eyJ1cmwiOiJodHRwczovL2FwaS5naXRodWIuY29tL3JlcG9zL0p1bGlhQ0kvQmVuY2htYXJrVHJhY2tlcnMuamwvY29tbWVudHMvMTQwNDcwNTgiLCJodG1sX3VybCI6Imh0dHBzOi8vZ2l0aHViLmNvbS9KdWxpYUNJL0JlbmNobWFya1RyYWNrZXJzLmpsL2NvbW1pdC8zMmQzNWYyODU3NzdiMDc3ZDhiNmEyNTIxMzA5ZDFhYjY0NmQyMzc5I2NvbW1pdGNvbW1lbnQtMTQwNDcwNTgiLCJpZCI6MTQwNDcwNTgsInVzZXIiOnsibG9naW4iOiJqcmV2ZWxzIiwiaWQiOjMyNzc0NDMsImF2YXRhcl91cmwiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvMzI3NzQ0Mz92PTMiLCJncmF2YXRhcl9pZCI6IiIsInVybCI6Imh0dHBzOi8vYXBpLmdpdGh1Yi5jb20vdXNlcnMvanJldmVscyIsImh0bWxfdXJsIjoiaHR0cHM6Ly9naXRodWIuY29tL2pyZXZlbHMiLCJmb2xsb3dlcnNfdXJsIjoiaHR0cHM6Ly9hcGkuZ2l0aHViLmNvbS91c2Vycy9qcmV2ZWxzL2ZvbGxvd2VycyIsImZvbGxvd2luZ191cmwiOiJodHRwczovL2FwaS5naXRodWIuY29tL3VzZXJzL2pyZXZlbHMvZm9sbG93aW5ney9vdGhlcl91c2VyfSIsImdpc3RzX3VybCI6Imh0dHBzOi8vYXBpLmdpdGh1Yi5jb20vdXNlcnMvanJldmVscy9naXN0c3svZ2lzdF9pZH0iLCJzdGFycmVkX3VybCI6Imh0dHBzOi8vYXBpLmdpdGh1Yi5jb20vdXNlcnMvanJl
#Function for numerical integration
function Kernel_Weight_Function(r::Float64)
if r < 1/2
return 8/π * (1 - 6r^2 + 6r^3)
elseif r < 1
return 8/π * 2 * (1-r)^3
else
return zero(r)
end
end

A ratio greater than 1.0 denotes a possible regression (marked with ❌), while a ratio less than 1.0 denotes a possible improvement (marked with ✅). Only significant results - results that indicate possible regressions or improvements - are shown below (thus, an empty table means that all benchmark results remained invariant between builds).

ID time ratio memory ratio
["array", "cat", "(\"hvcat\", 500)"] 0.67 (15%) ✅ 1.00 (1%)
["array", "cat", "(\"hvcat_setind\", 500)"] 1.30 (15%) ❌ 1.00 (1%)
["array", "equality", "(\"isequal\", \"UnitRange{Int64}\")"] 0.76 (15%) ✅ 1.00 (1%)
const data_path = "ratings.csv"
const K = 100
const num_iterations = 2
const step_size = 0.01
function parse_line(line::AbstractString)
tokens = split(line, ',')
@assert length(tokens) == 3
token_tuple = (parse(Int64, String(tokens[1])),
parse(Int64, String(tokens[2])),
julia> @code_llvm m4x4 *m4x4
define void @"julia_*_62858"(%FixedMatrix* noalias nocapture sret, %FixedMatrix* nocapture readonly dereferenceable(128), %FixedMatrix* nocapture readonly dereferenceable(128)) #0 !dbg !5 {
top:
%3 = getelementptr inbounds %FixedMatrix, %FixedMatrix* %2, i64 0, i32 0, i64 0
%4 = load double, double* %3, align 8
%5 = getelementptr inbounds %FixedMatrix, %FixedMatrix* %1, i64 0, i32 0, i64 4
%6 = getelementptr inbounds %FixedMatrix, %FixedMatrix* %2, i64 0, i32 0, i64 1
%7 = load double, double* %6, align 8
abstract type FixedArray{T, N} <: AbstractArray{T, N} end
Base.IndexStyle(::Type{<: FixedArray}) = IndexLinear()
Base.getindex(fsa::FixedArray, i::Int) = fsa.data[i]
struct FixedVector{L, T} <: FixedArray{T, 1}
data::NTuple{L, T}
end
diff --git a/stdlib/Pkg/src/resolve/fieldvalue.jl b/stdlib/Pkg/src/resolve/fieldvalue.jl
index adaf53e91d..d3d8783ef5 100644
--- a/stdlib/Pkg/src/resolve/fieldvalue.jl
+++ b/stdlib/Pkg/src/resolve/fieldvalue.jl
@@ -2,7 +2,7 @@
module FieldValues
-using ...VersionWeights
+using Pkg.Resolve.VersionWeights
const Byte=UInt8
const ByteArray=Array{Byte, 1}
const ByteMatrix=Array{Byte, 2}
const NB_MILESTONES = 9
const NB_SLOT_IN_MILESTONE = 7
const NB_CARDS_IN_HAND = 6
const NB_CARDS_ON_BOARD = NB_MILESTONES*NB_SLOT_IN_MILESTONE