From 130943d2005f57ec8caf283ee78a5d1e2b08e015 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 27 Nov 2024 14:11:53 +0000 Subject: [PATCH] Add benchmarks results for b5801d33772cad05d0cc2d708f0ca41fea168aa5 --- analyze.json | 68 +++++++++++- bench-codegen.json | 264 ++++++++++++++++++++++++++++++++++++++++++++- bench-gcc.json | 264 ++++++++++++++++++++++++++++++++++++++++++++- bench.json | 264 ++++++++++++++++++++++++++++++++++++++++++++- compile.json | 96 ++++++++++++++++- 5 files changed, 951 insertions(+), 5 deletions(-) diff --git a/analyze.json b/analyze.json index 5fe56b3..f6aabd7 100644 --- a/analyze.json +++ b/analyze.json @@ -1,5 +1,5 @@ { - "lastUpdate": 1732314451838, + "lastUpdate": 1732716713135, "repoUrl": "https://github.com/luau-lang/luau", "entries": { "luau-analyze": [ @@ -16696,6 +16696,72 @@ "extra": "luau-analyze" } ] + }, + { + "commit": { + "author": { + "email": "arseny.kapoulkine@gmail.com", + "name": "Arseny Kapoulkine", + "username": "zeux" + }, + "committer": { + "email": "noreply@github.com", + "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" + } + ] } ] } diff --git a/bench-codegen.json b/bench-codegen.json index 88841d7..822650e 100644 --- a/bench-codegen.json +++ b/bench-codegen.json @@ -1,5 +1,5 @@ { - "lastUpdate": 1732314451531, + "lastUpdate": 1732716712813, "repoUrl": "https://github.com/luau-lang/luau", "entries": { "callgrind codegen": [ @@ -49690,6 +49690,268 @@ "extra": "luau-codegen" } ] + }, + { + "commit": { + "author": { + "email": "arseny.kapoulkine@gmail.com", + "name": "Arseny Kapoulkine", + "username": "zeux" + }, + "committer": { + "email": "noreply@github.com", + "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" + } + ] } ] } diff --git a/bench-gcc.json b/bench-gcc.json index 3b3ea5b..b4ea174 100644 --- a/bench-gcc.json +++ b/bench-gcc.json @@ -1,5 +1,5 @@ { - "lastUpdate": 1732314451686, + "lastUpdate": 1732716712983, "repoUrl": "https://github.com/luau-lang/luau", "entries": { "callgrind gcc": [ @@ -65059,6 +65059,268 @@ "extra": "luau-gcc" } ] + }, + { + "commit": { + "author": { + "email": "arseny.kapoulkine@gmail.com", + "name": "Arseny Kapoulkine", + "username": "zeux" + }, + "committer": { + "email": "noreply@github.com", + "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": 1732716712961, + "tool": "benchmarkluau", + "benches": [ + { + "name": "base64", + "value": 23.055, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "chess", + "value": 82.262, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "life", + "value": 89.766, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "matrixmult", + "value": 24.642, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "mesh-normal-scalar", + "value": 32.38, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "mesh-normal-vector", + "value": 16.447, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "pcmmix", + "value": 10.26, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "qsort", + "value": 77.291, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "sha256", + "value": 26.226, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "ack", + "value": 65.367, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "binary-trees", + "value": 29.874, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "fannkuchen-redux", + "value": 12.877, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "fixpoint-fact", + "value": 60.29, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "heapsort", + "value": 22.22, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "mandel", + "value": 63.738, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "n-body", + "value": 37.779, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "qt", + "value": 60.789, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "queen", + "value": 1.968, + "unit": "1ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "scimark", + "value": 89.666, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "spectral-norm", + "value": 12.429, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "sieve", + "value": 105.843, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "3d-cube", + "value": 8.652, + "unit": "8ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "3d-morph", + "value": 10.316, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "3d-raytrace", + "value": 10.316, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "controlflow-recursive", + "value": 5.542, + "unit": "5ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "crypto-aes", + "value": 14.715, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "fannkuch", + "value": 26.461, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "math-cordic", + "value": 16.68, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "math-partial-sums", + "value": 5.04, + "unit": "5ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "n-body-oop", + "value": 56.263, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "tictactoe", + "value": 133.872, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "trig", + "value": 24.864, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "vector-math", + "value": 10.85, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + }, + { + "name": "voxelgen", + "value": 54.095, + "unit": "ms", + "range": "±0.000%", + "extra": "luau-gcc" + } + ] } ] } diff --git a/bench.json b/bench.json index c2878af..4a53048 100644 --- a/bench.json +++ b/bench.json @@ -1,5 +1,5 @@ { - "lastUpdate": 1732314451354, + "lastUpdate": 1732716712651, "repoUrl": "https://github.com/luau-lang/luau", "entries": { "callgrind clang": [ @@ -65059,6 +65059,268 @@ "extra": "luau" } ] + }, + { + "commit": { + "author": { + "email": "arseny.kapoulkine@gmail.com", + "name": "Arseny Kapoulkine", + "username": "zeux" + }, + "committer": { + "email": "noreply@github.com", + "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": 1732716712637, + "tool": "benchmarkluau", + "benches": [ + { + "name": "base64", + "value": 21.435, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "chess", + "value": 80.412, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "life", + "value": 83.424, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "matrixmult", + "value": 23.432, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "mesh-normal-scalar", + "value": 30.586, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "mesh-normal-vector", + "value": 15.61, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "pcmmix", + "value": 9.22, + "unit": "9ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "qsort", + "value": 75.293, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "sha256", + "value": 24.255, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "ack", + "value": 65.921, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "binary-trees", + "value": 28.849, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "fannkuchen-redux", + "value": 11.807, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "fixpoint-fact", + "value": 61.863, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "heapsort", + "value": 20.66, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "mandel", + "value": 61.424, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "n-body", + "value": 36.475, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "qt", + "value": 56.406, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "queen", + "value": 1.887, + "unit": "1ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "scimark", + "value": 84.584, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "spectral-norm", + "value": 11.345, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "sieve", + "value": 102.115, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "3d-cube", + "value": 7.984, + "unit": "7ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "3d-morph", + "value": 9.626, + "unit": "9ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "3d-raytrace", + "value": 9.726, + "unit": "9ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "controlflow-recursive", + "value": 5.623, + "unit": "5ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "crypto-aes", + "value": 13.476, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "fannkuch", + "value": 24.127, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "math-cordic", + "value": 15.263, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "math-partial-sums", + "value": 4.698, + "unit": "4ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "n-body-oop", + "value": 54.688, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "tictactoe", + "value": 122.891, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "trig", + "value": 22.879, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "vector-math", + "value": 10.36, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + }, + { + "name": "voxelgen", + "value": 49.597, + "unit": "ms", + "range": "±0.000%", + "extra": "luau" + } + ] } ] } diff --git a/compile.json b/compile.json index 485b6c4..eba5b8f 100644 --- a/compile.json +++ b/compile.json @@ -1,5 +1,5 @@ { - "lastUpdate": 1732314451978, + "lastUpdate": 1732716713268, "repoUrl": "https://github.com/luau-lang/luau", "entries": { "luau-compile": [ @@ -21942,6 +21942,100 @@ "extra": "luau-compile" } ] + }, + { + "commit": { + "author": { + "email": "arseny.kapoulkine@gmail.com", + "name": "Arseny Kapoulkine", + "username": "zeux" + }, + "committer": { + "email": "noreply@github.com", + "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": 1732716713262, + "tool": "benchmarkluau", + "benches": [ + { + "name": "map-O0", + "value": 0.660971, + "unit": "0ms", + "range": "±0%", + "extra": "luau-compile" + }, + { + "name": "map-O1", + "value": 0.727011, + "unit": "0ms", + "range": "±0%", + "extra": "luau-compile" + }, + { + "name": "map-O2", + "value": 0.798897, + "unit": "0ms", + "range": "±0%", + "extra": "luau-compile" + }, + { + "name": "map-O2-codegen", + "value": 3.33821, + "unit": "3ms", + "range": "±0%", + "extra": "luau-compile" + }, + { + "name": "map-O2-t1-codegen", + "value": 3.4356, + "unit": "3ms", + "range": "±0%", + "extra": "luau-compile" + }, + { + "name": "regex-O0", + "value": 1.60344, + "unit": "1ms", + "range": "±0%", + "extra": "luau-compile" + }, + { + "name": "regex-O1", + "value": 1.77932, + "unit": "1ms", + "range": "±0%", + "extra": "luau-compile" + }, + { + "name": "regex-O2", + "value": 2.02818, + "unit": "2ms", + "range": "±0%", + "extra": "luau-compile" + }, + { + "name": "regex-O2-codegen", + "value": 10.3217, + "unit": "ms", + "range": "±0%", + "extra": "luau-compile" + }, + { + "name": "regex-O2-t1-codegen", + "value": 10.5911, + "unit": "ms", + "range": "±0%", + "extra": "luau-compile" + } + ] } ] }