Skip to content

Commit

Permalink
Add benchmarks directly in the docs (#26)
Browse files Browse the repository at this point in the history
* let's try

* better

* add a sample bench -- not sure if it is the right way to go.
  • Loading branch information
lrnv authored Apr 24, 2024
1 parent 333858f commit 856331c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
RateTables = "d40fb65e-c2ee-4113-9e14-cb96ca0acb32"
RCall = "6f49c342-dc21-5d91-9882-a32aef131414"
NetSurvival = "8f9d5d0e-dd2e-4568-92d4-f8c5d34f25cf"
RCall = "6f49c342-dc21-5d91-9882-a32aef131414"
RateTables = "d40fb65e-c2ee-4113-9e14-cb96ca0acb32"
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ makedocs(;
"Home" => "index.md",
"theory.md",
"getting_started.md",
"benches.md",
"references.md",
],
)
Expand Down
35 changes: 35 additions & 0 deletions docs/src/benches.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
```@meta
CurrentModule = NetSurvival
```

# Benchmarking results

The following benchmarks are run on github actions continuous integration platform, which is a very slow computing engine. Local experiments suggests performances that are twice as fast on correct hardware -- note that we do not use multithreading at all, but underlying BLAS calls might.

```@example 1
using RCall
using NetSurvival, RateTables, BenchmarkTools
R_bench = @benchmark R"""
relsurv::rs.surv(
survival::Surv(time, stat) ~1,
rmap=list(age = age, sex = sex, year = diag),
data = relsurv::colrec,
ratetable = relsurv::slopop,
method = "pohar-perme",
add.times=1:8149)
"""
jl_bench = @benchmark fit(PoharPerme, @formula(Surv(time,status)~1), colrec, slopop)
ratio = time(minimum(R_bench)) / time(minimum(jl_bench))
```


# Benchmarking across time

The folloiwng charts provide a glimpse of `NetSurvival.jl`'s performance along time:

```@raw html
<iframe src="/benchmarks/index.html" style="height:500px;width:100%;"></iframe>
```

0 comments on commit 856331c

Please sign in to comment.