Skip to content

Instantly share code, notes, and snippets.

View juliohm's full-sized avatar
🌎
Working from home

Júlio Hoffimann juliohm

🌎
Working from home
View GitHub Profile
@juliohm
juliohm / main.jl
Created April 23, 2020 12:48
Benchmark Julia, Python, R, C
# Example adapted from https://github.com/JuliaComputing/JuliaBoxTutorials
# Assumes that Python and R are also installed in the system
# let's compare various implementations of the sum(x) function
x = rand(10^7)
sum(x) # expected result 5×10⁶
#------------------------
# Python implementation
using PyCall
x1 x2 x3 y
-0.16485239157797732 -0.2218786857477146 0.025657251025896506 1
-0.14138283354447023 -0.18115496792737906 -0.08881228951195215 2
-0.19156671553489246 -0.21063046433580623 -0.2917535547111554 3
-0.279588288598788 -0.27721378406398256 0.015351159741035935 4
-0.3226797091143479 -0.3261822936012488 0.10225411867529889 2
0.36719732717363746 0.4162419801073728 0.15575307734063756 2
-0.2758953203829891 -0.2474704632695943 -0.14546736263944215 2
-0.271400774910694 -0.26209306422374024 -0.005437600507968055 4
-0.4938512097624689 -0.3518243528882096 -0.07185283149402386 3
@juliohm
juliohm / values.dat
Created December 21, 2023 20:44
Empirical distribution
0.009
0.0043
0.0037
0.004
0.0007
0.0017
0.0067
0.0036
0.0
0.0