Skip to content

Commit

Permalink
Add benchmarks results for b5801d33772cad05d0cc2d708f0ca41fea168aa5
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Nov 27, 2024
1 parent 9803629 commit 130943d
Show file tree
Hide file tree
Showing 5 changed files with 951 additions and 5 deletions.
68 changes: 67 additions & 1 deletion analyze.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lastUpdate": 1732314451838,
"lastUpdate": 1732716713135,
"repoUrl": "https://github.com/luau-lang/luau",
"entries": {
"luau-analyze": [
Expand Down Expand Up @@ -16696,6 +16696,72 @@
"extra": "luau-analyze"
}
]
},
{
"commit": {
"author": {
"email": "[email protected]",
"name": "Arseny Kapoulkine",
"username": "zeux"
},
"committer": {
"email": "[email protected]",
"name": "GitHub",
"username": "web-flow"
},
"distinct": true,
"id": "b5801d33772cad05d0cc2d708f0ca41fea168aa5",
"message": "CodeGen: Optimize arithmetics for basic identities (#1545)\n\nThis change folds:\r\n\r\n\ta * 1 => a\r\n\ta / 1 => a\r\n\ta * -1 => -a\r\n\ta / -1 => -a\r\n\ta * 2 => a + a\r\n\ta / 2^k => a * 2^-k\r\n\ta - 0 => a\r\n\ta + (-0) => a\r\n\r\nNote that the following folds are all invalid:\r\n\r\n\ta + 0 => a (breaks for negative zero)\r\n\ta - (-0) => a (breaks for negative zero)\r\n\ta - a => 0 (breaks for Inf/NaN)\r\n\t0 - a => -a (breaks for negative zero)\r\n\r\nVarious cases of UNM_NUM could be optimized (eg (-a) * (-b) = a * b),\r\nbut that doesn't happen in benchmarks.\r\n\r\nWhile it would be possible to also fold inverse multiplications (k * v),\r\nthese do not happen in benchmarks and rarely happen in bytecode due\r\nto type based optimizations. Maybe this can be improved with some sort\r\nof\r\nIR canonicalization in the future if necessary.\r\n\r\nI've considered moving some of these, like division strength reduction,\r\nto IR translation (as this is where POW is lowered presently) but it\r\ndidn't\r\nseem better one way or the other.\r\n\r\nThis change improves performance on some benchmarks, e.g. trig and\r\nvoxelgen,\r\nand should be a strict uplift as it never generates more instructions or\r\nlonger\r\nlatency chains. On Apple M2, without division->multiplication\r\noptimization, both\r\nbenchmarks see 0.1-0.2% uplift. Division optimization makes trig 3%\r\nfaster; I expect\r\nthe gains on X64 will be more muted, but on Apple this seems to allow\r\nloop iterations\r\nto overlap better by removing the division bottleneck.",
"timestamp": "2024-11-27T04:44:39-08:00",
"tree_id": "d29de234207fe58437a7fc287b1b2df715b953c1",
"url": "https://github.com/luau-lang/luau/commit/b5801d33772cad05d0cc2d708f0ca41fea168aa5"
},
"date": 1732716713130,
"tool": "benchmarkluau",
"benches": [
{
"name": "map-nonstrict",
"value": 4.85883,
"unit": "4ms",
"range": "±0%",
"extra": "luau-analyze"
},
{
"name": "map-strict",
"value": 5.92624,
"unit": "5ms",
"range": "±0%",
"extra": "luau-analyze"
},
{
"name": "map-dcr",
"value": 28.5673,
"unit": "ms",
"range": "±0%",
"extra": "luau-analyze"
},
{
"name": "regex-nonstrict",
"value": 8.16238,
"unit": "8ms",
"range": "±0%",
"extra": "luau-analyze"
},
{
"name": "regex-strict",
"value": 10.6212,
"unit": "ms",
"range": "±0%",
"extra": "luau-analyze"
},
{
"name": "regex-dcr",
"value": 69370.1,
"unit": "ms",
"range": "±0%",
"extra": "luau-analyze"
}
]
}
]
}
Expand Down
264 changes: 263 additions & 1 deletion bench-codegen.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lastUpdate": 1732314451531,
"lastUpdate": 1732716712813,
"repoUrl": "https://github.com/luau-lang/luau",
"entries": {
"callgrind codegen": [
Expand Down Expand Up @@ -49690,6 +49690,268 @@
"extra": "luau-codegen"
}
]
},
{
"commit": {
"author": {
"email": "[email protected]",
"name": "Arseny Kapoulkine",
"username": "zeux"
},
"committer": {
"email": "[email protected]",
"name": "GitHub",
"username": "web-flow"
},
"distinct": true,
"id": "b5801d33772cad05d0cc2d708f0ca41fea168aa5",
"message": "CodeGen: Optimize arithmetics for basic identities (#1545)\n\nThis change folds:\r\n\r\n\ta * 1 => a\r\n\ta / 1 => a\r\n\ta * -1 => -a\r\n\ta / -1 => -a\r\n\ta * 2 => a + a\r\n\ta / 2^k => a * 2^-k\r\n\ta - 0 => a\r\n\ta + (-0) => a\r\n\r\nNote that the following folds are all invalid:\r\n\r\n\ta + 0 => a (breaks for negative zero)\r\n\ta - (-0) => a (breaks for negative zero)\r\n\ta - a => 0 (breaks for Inf/NaN)\r\n\t0 - a => -a (breaks for negative zero)\r\n\r\nVarious cases of UNM_NUM could be optimized (eg (-a) * (-b) = a * b),\r\nbut that doesn't happen in benchmarks.\r\n\r\nWhile it would be possible to also fold inverse multiplications (k * v),\r\nthese do not happen in benchmarks and rarely happen in bytecode due\r\nto type based optimizations. Maybe this can be improved with some sort\r\nof\r\nIR canonicalization in the future if necessary.\r\n\r\nI've considered moving some of these, like division strength reduction,\r\nto IR translation (as this is where POW is lowered presently) but it\r\ndidn't\r\nseem better one way or the other.\r\n\r\nThis change improves performance on some benchmarks, e.g. trig and\r\nvoxelgen,\r\nand should be a strict uplift as it never generates more instructions or\r\nlonger\r\nlatency chains. On Apple M2, without division->multiplication\r\noptimization, both\r\nbenchmarks see 0.1-0.2% uplift. Division optimization makes trig 3%\r\nfaster; I expect\r\nthe gains on X64 will be more muted, but on Apple this seems to allow\r\nloop iterations\r\nto overlap better by removing the division bottleneck.",
"timestamp": "2024-11-27T04:44:39-08:00",
"tree_id": "d29de234207fe58437a7fc287b1b2df715b953c1",
"url": "https://github.com/luau-lang/luau/commit/b5801d33772cad05d0cc2d708f0ca41fea168aa5"
},
"date": 1732716712802,
"tool": "benchmarkluau",
"benches": [
{
"name": "base64",
"value": 11.54,
"unit": "ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "chess",
"value": 52.012,
"unit": "ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "life",
"value": 23.356,
"unit": "ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "matrixmult",
"value": 9.335,
"unit": "9ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "mesh-normal-scalar",
"value": 13.056,
"unit": "ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "mesh-normal-vector",
"value": 6.122,
"unit": "6ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "pcmmix",
"value": 1.36,
"unit": "1ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "qsort",
"value": 41.462,
"unit": "ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "sha256",
"value": 4.57,
"unit": "4ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "ack",
"value": 40.015,
"unit": "ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "binary-trees",
"value": 20.901,
"unit": "ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "fannkuchen-redux",
"value": 3.892,
"unit": "3ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "fixpoint-fact",
"value": 48.883,
"unit": "ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "heapsort",
"value": 7.717,
"unit": "7ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "mandel",
"value": 40.433,
"unit": "ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "n-body",
"value": 9.707,
"unit": "9ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "qt",
"value": 24.975,
"unit": "ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "queen",
"value": 0.805,
"unit": "0ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "scimark",
"value": 24.619,
"unit": "ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "spectral-norm",
"value": 2.444,
"unit": "2ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "sieve",
"value": 84.569,
"unit": "ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "3d-cube",
"value": 3.735,
"unit": "3ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "3d-morph",
"value": 3.75,
"unit": "3ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "3d-raytrace",
"value": 3.283,
"unit": "3ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "controlflow-recursive",
"value": 3.464,
"unit": "3ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "crypto-aes",
"value": 7.18,
"unit": "7ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "fannkuch",
"value": 6.167,
"unit": "6ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "math-cordic",
"value": 3.768,
"unit": "3ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "math-partial-sums",
"value": 1.917,
"unit": "1ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "n-body-oop",
"value": 13.739,
"unit": "ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "tictactoe",
"value": 62.956,
"unit": "ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "trig",
"value": 6.548,
"unit": "6ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "vector-math",
"value": 3.05,
"unit": "3ms",
"range": "±0.000%",
"extra": "luau-codegen"
},
{
"name": "voxelgen",
"value": 27.657,
"unit": "ms",
"range": "±0.000%",
"extra": "luau-codegen"
}
]
}
]
}
Expand Down
Loading

0 comments on commit 130943d

Please sign in to comment.