Skip to content

Commit

Permalink
Add benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
Quafadas committed Sep 24, 2024
1 parent 71e6787 commit ff3686f
Show file tree
Hide file tree
Showing 13 changed files with 607 additions and 11 deletions.
6 changes: 3 additions & 3 deletions benchmark/src/matmul.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import org.openjdk.jmh.infra.Blackhole
import vecxt.Matrix.*
import vecxt.BoundsCheck
import scala.compiletime.uninitialized

import BoundsCheck.DoBoundsCheck.no
@State(Scope.Thread)
class DgemmBenchmark extends BLASBenchmark:

Expand Down Expand Up @@ -92,8 +92,8 @@ class DgemmBenchmark extends BLASBenchmark:


@Benchmark
def vecxt_mmult(bh: Blackhole) =
val cclone = (matA @@ matB)(using BoundsCheck.DoBoundsCheck.no)
def vecxt_mmult(bh: Blackhole)=
val cclone = matA @@ matB
bh.consume(cclone);
end vecxt_mmult

Expand Down
141 changes: 141 additions & 0 deletions site/docs/_assets/plots/addScalar.vg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"url": "../../benchmarks/benchmark_history.json",
"format": {
"type": "json"
}
},
"transform": [
{
"calculate": "replace(datum.benchmark, 'vecxt.benchmark.', '')",
"as": "benchmark"
},
{
"calculate": "datetime(substring(datum.date,0, 4)+ '-' + substring(datum.date,4, 6) + '-' + substring(datum.date,6, 8))",
"as": "date"
},
{
"joinaggregate": [
{
"op": "max",
"field": "date",
"as": "maxDate"
}
]
},
{
"filter": {
"field": "benchmark",
"oneOf": [
"AddScalarBenchmark.vecxt_add",
"AddScalarBenchmark.vecxt_add_vec"
]
}
},
{
"window": [{ "op": "dense_rank", "as": "rank" }],
"sort": [{ "field": "date", "order": "descending" }]
},
{ "filter": "datum.rank <= 1" }
],
"vconcat": [
{
"layer": [
{
"mark": "errorbar",
"encoding": {
"x": {
"field": "scoreLowerConfidence",
"type": "quantitative",
"scale": { "zero": false },
"title": "ops / s"
},
"x2": { "field": "scoreUpperConfidence" },
"y": { "field": "benchmark", "type": "ordinal" }
}
},
{
"mark": {
"type": "point",
"filled": true,
"color": "black"
},
"encoding": {
"x": {
"field": "score",
"type": "quantitative"
},
"y": { "field": "benchmark", "type": "ordinal" }
}
}
],
"transform": [{ "filter": "(datum.params.n == '10')" }]
},
{
"layer": [
{
"mark": "errorbar",
"encoding": {
"x": {
"field": "scoreLowerConfidence",
"type": "quantitative",
"scale": { "zero": false },
"title": "ops / s"
},
"x2": { "field": "scoreUpperConfidence" },
"y": { "field": "benchmark", "type": "ordinal" }
}
},
{
"mark": {
"type": "point",
"filled": true,
"color": "black"
},
"encoding": {
"x": {
"field": "score",
"type": "quantitative"
},
"y": { "field": "benchmark", "type": "ordinal" }
}
}
],
"transform": [{ "filter": "(datum.params.n == '1000')" }]
},

{
"layer": [
{
"mark": "errorbar",
"encoding": {
"x": {
"field": "scoreLowerConfidence",
"type": "quantitative",
"scale": { "zero": false },
"title": "ops / s"
},
"x2": { "field": "scoreUpperConfidence" },
"y": { "field": "benchmark", "type": "ordinal" }
}
},
{
"mark": {
"type": "point",
"filled": true,
"color": "black"
},
"encoding": {
"x": {
"field": "score",
"type": "quantitative"
},
"y": { "field": "benchmark", "type": "ordinal" }
}
}
],
"transform": [{ "filter": "(datum.params.n == '100000')" }]
}
]
}
141 changes: 141 additions & 0 deletions site/docs/_assets/plots/increments.vg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"url": "../../benchmarks/benchmark_history.json",
"format": {
"type": "json"
}
},
"transform": [
{
"calculate": "replace(datum.benchmark, 'vecxt.benchmark.', '')",
"as": "benchmark"
},
{
"calculate": "datetime(substring(datum.date,0, 4)+ '-' + substring(datum.date,4, 6) + '-' + substring(datum.date,6, 8))",
"as": "date"
},
{
"joinaggregate": [
{
"op": "max",
"field": "date",
"as": "maxDate"
}
]
},
{
"filter": {
"field": "benchmark",
"oneOf": [
"IncrementBenchmark.increment_normal",
"IncrementBenchmark.increment_vec"
]
}
},
{
"window": [{ "op": "dense_rank", "as": "rank" }],
"sort": [{ "field": "date", "order": "descending" }]
},
{ "filter": "datum.rank <= 1" }
],
"vconcat": [
{
"layer": [
{
"mark": "errorbar",
"encoding": {
"x": {
"field": "scoreLowerConfidence",
"type": "quantitative",
"scale": { "zero": false },
"title": "ops / s"
},
"x2": { "field": "scoreUpperConfidence" },
"y": { "field": "benchmark", "type": "ordinal" }
}
},
{
"mark": {
"type": "point",
"filled": true,
"color": "black"
},
"encoding": {
"x": {
"field": "score",
"type": "quantitative"
},
"y": { "field": "benchmark", "type": "ordinal" }
}
}
],
"transform": [{ "filter": "(datum.params.len == '3')" }]
},
{
"layer": [
{
"mark": "errorbar",
"encoding": {
"x": {
"field": "scoreLowerConfidence",
"type": "quantitative",
"scale": { "zero": false },
"title": "ops / s"
},
"x2": { "field": "scoreUpperConfidence" },
"y": { "field": "benchmark", "type": "ordinal" }
}
},
{
"mark": {
"type": "point",
"filled": true,
"color": "black"
},
"encoding": {
"x": {
"field": "score",
"type": "quantitative"
},
"y": { "field": "benchmark", "type": "ordinal" }
}
}
],
"transform": [{ "filter": "(datum.params.len == '100')" }]
},

{
"layer": [
{
"mark": "errorbar",
"encoding": {
"x": {
"field": "scoreLowerConfidence",
"type": "quantitative",
"scale": { "zero": false },
"title": "ops / s"
},
"x2": { "field": "scoreUpperConfidence" },
"y": { "field": "benchmark", "type": "ordinal" }
}
},
{
"mark": {
"type": "point",
"filled": true,
"color": "black"
},
"encoding": {
"x": {
"field": "score",
"type": "quantitative"
},
"y": { "field": "benchmark", "type": "ordinal" }
}
}
],
"transform": [{ "filter": "(datum.params.len == '100000')" }]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"width": "container",
"data": {
"url": "../benchmarks/benchmark_history.json",
"url": "../../benchmarks/benchmark_history.json",
"format": {
"type": "json"
}
Expand Down
Loading

0 comments on commit ff3686f

Please sign in to comment.