Fixed the backwards compatible benchmark support library require (#1125)

Previous benchmark require fix wasn't actually working correctly for the
old style require (or running in Lua).
This commit is contained in:
Vyacheslav Egorov 2023-12-04 22:48:31 +02:00 committed by GitHub
parent 765ac75fe9
commit aafea36235
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
104 changed files with 208 additions and 104 deletions

View File

@ -66,7 +66,8 @@ end
-- and 'false' otherwise. -- and 'false' otherwise.
-- --
-- Example usage: -- Example usage:
-- local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") -- local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
-- local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
-- function testFunc() -- function testFunc()
-- ... -- ...
-- end -- end

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,5 +1,6 @@
--!nonstrict --!nonstrict
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
local stretchTreeDepth = 18 -- about 16Mb local stretchTreeDepth = 18 -- about 16Mb
local longLivedTreeDepth = 16 -- about 4Mb local longLivedTreeDepth = 16 -- about 4Mb

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()
local count = 1 local count = 1

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()
local count = 1 local count = 1

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()
local count = 1 local count = 1

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()
local t = {} local t = {}

View File

@ -21,7 +21,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
]] ]]
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -22,7 +22,8 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]] ]]
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
bench.runCode(function() bench.runCode(function()
for j=1,1e6 do for j=1,1e6 do

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()
local t = table.create(250001, 0) local t = table.create(250001, 0)

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()
local t = table.create(5000001, 0) local t = table.create(5000001, 0)

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()
local t = table.create(250001, 0) local t = table.create(250001, 0)

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
local arr_months = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"} local arr_months = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
bench.runCode(function() bench.runCode(function()
for j=1,1e6 do for j=1,1e6 do

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
bench.runCode(function() bench.runCode(function()
local src = string.rep("abcdefghijklmnopqrstuvwxyz", 100) local src = string.rep("abcdefghijklmnopqrstuvwxyz", 100)

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
bench.runCode(function() bench.runCode(function()
for outer=1,28,3 do for outer=1,28,3 do

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,5 +1,6 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
local RANKS = "12345678" local RANKS = "12345678"
local FILES = "abcdefgh" local FILES = "abcdefgh"

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
local function mmul(matrix1, matrix2) local function mmul(matrix1, matrix2)
local shapeRows = #matrix1 local shapeRows = #matrix1

View File

@ -1,5 +1,6 @@
--!strict --!strict
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
local samples = 100_000 local samples = 100_000

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -23,7 +23,8 @@ SOFTWARE.
]] ]]
-- http://www.bagley.org/~doug/shootout/ -- http://www.bagley.org/~doug/shootout/
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
function test() function test()

View File

@ -25,7 +25,8 @@ SOFTWARE.
-- http://benchmarksgame.alioth.debian.org/ -- http://benchmarksgame.alioth.debian.org/
-- contributed by Mike Pall -- contributed by Mike Pall
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
function test() function test()

View File

@ -25,7 +25,8 @@ SOFTWARE.
-- http://benchmarksgame.alioth.debian.org/ -- http://benchmarksgame.alioth.debian.org/
-- contributed by Mike Pall -- contributed by Mike Pall
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
function test() function test()

View File

@ -21,7 +21,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
]] ]]
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
function test() function test()

View File

@ -21,7 +21,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
]] ]]
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
function test() function test()

View File

@ -21,7 +21,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
]] ]]
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
function test() function test()

View File

@ -23,7 +23,8 @@ SOFTWARE.
]] ]]
-- Julia sets via interval cell-mapping (quadtree version) -- Julia sets via interval cell-mapping (quadtree version)
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
function test() function test()

View File

@ -21,7 +21,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
]] ]]
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
function test() function test()

View File

@ -33,7 +33,8 @@
-- Modification to be compatible with Lua 5.3 -- Modification to be compatible with Lua 5.3
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
function test() function test()

View File

@ -25,7 +25,8 @@ SOFTWARE.
-- http://benchmarksgame.alioth.debian.org/ -- http://benchmarksgame.alioth.debian.org/
-- contributed by Mike Pall -- contributed by Mike Pall
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
function test() function test()

View File

@ -1,4 +1,5 @@
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
function test() function test()

View File

@ -2,7 +2,8 @@
-- http://www.speich.net/computer/moztesting/3d.htm -- http://www.speich.net/computer/moztesting/3d.htm
-- Created by Simon Speich -- Created by Simon Speich
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
function test() function test()

View File

@ -23,7 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]] ]]
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
function test() function test()

View File

@ -22,7 +22,8 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]] ]]
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
function test() function test()

View File

@ -3,7 +3,8 @@
http://shootout.alioth.debian.org/ http://shootout.alioth.debian.org/
contributed by Isaac Gouy contributed by Isaac Gouy
]] ]]
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
function test() function test()

View File

@ -9,7 +9,8 @@
* returns byte-array encrypted value (16 bytes) * returns byte-array encrypted value (16 bytes)
*/]] */]]
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
-- Sbox is pre-computed multiplicative inverse in GF(2^8) used in SubBytes and KeyExpansion [§5.1.1] -- Sbox is pre-computed multiplicative inverse in GF(2^8) used in SubBytes and KeyExpansion [§5.1.1]
local Sbox = { 0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5,0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76, local Sbox = { 0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5,0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76,

View File

@ -3,7 +3,8 @@
http://shootout.alioth.debian.org/ http://shootout.alioth.debian.org/
contributed by Isaac Gouy contributed by Isaac Gouy
]] ]]
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
function test() function test()

View File

@ -23,7 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]] ]]
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
function test() function test()

View File

@ -3,7 +3,8 @@
http://shootout.alioth.debian.org/ http://shootout.alioth.debian.org/
contributed by Isaac Gouy contributed by Isaac Gouy
]] ]]
local bench = script and require(script.Parent.bench_support) or pcall(require, "bench_support") or require("../../bench_support") local function prequire(name) local success, result = pcall(require, name); return if success then result else nil end
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../../bench_support")
function test() function test()

Some files were not shown because too many files have changed in this diff Show More