haikuwebkit/PerformanceTests/APIBench/api-bench

289 lines
7.4 KiB
Plaintext
Raw Permalink Normal View History

New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
#!/usr/bin/env bash
# Copyright (C) 2020 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
Add C and ObjC tests to APIBench https://bugs.webkit.org/show_bug.cgi?id=219246 Reviewed by Yusuke Suzuki. The benchmark now consists of two groups: initially they are identical, but the first group will not be changed going forward while the second group will be free to adopt new APIs. The two original tests (one mostly JS and the other mostly native) were also split into three tests each (C, ObjC and Swift). * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/References/RichardsC/RichardsC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/References/RichardsC/RichardsC.xcodeproj/xcshareddata/xcschemes/RichardsC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsC/RichardsC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/References/RichardsC/RichardsC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/References/RichardsJS/RichardsJS.js: Renamed from PerformanceTests/APIBench/RichardsJS/RichardsJS.js. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/xcshareddata/xcschemes/RichardsObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsObjC/RichardsObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsObjC/RichardsObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.h: Added. * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/References/RichardsObjC/RichardsObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/References/RichardsObjC/RichardsObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[WorkerTask createWithScheduler:priority:queue:]): (-[WorkerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/main.m: Added. (runRichards): (main): * APIBench/References/RichardsObjC/RichardsObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsSwift/RichardsSwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsSwift/RichardsSwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Scheduler.swift. * APIBench/References/RichardsSwift/RichardsSwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Task.swift. * APIBench/References/RichardsSwift/RichardsSwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/richards.swift. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. (Packet.addTo(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. (runRichards): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/api-bench: Canonical link: https://commits.webkit.org/231979@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-01 00:46:54 +00:00
# notice, this list of conditions and the following disclaimer.
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
Add C and ObjC tests to APIBench https://bugs.webkit.org/show_bug.cgi?id=219246 Reviewed by Yusuke Suzuki. The benchmark now consists of two groups: initially they are identical, but the first group will not be changed going forward while the second group will be free to adopt new APIs. The two original tests (one mostly JS and the other mostly native) were also split into three tests each (C, ObjC and Swift). * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/References/RichardsC/RichardsC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/References/RichardsC/RichardsC.xcodeproj/xcshareddata/xcschemes/RichardsC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsC/RichardsC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/References/RichardsC/RichardsC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/References/RichardsJS/RichardsJS.js: Renamed from PerformanceTests/APIBench/RichardsJS/RichardsJS.js. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/xcshareddata/xcschemes/RichardsObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsObjC/RichardsObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsObjC/RichardsObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.h: Added. * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/References/RichardsObjC/RichardsObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/References/RichardsObjC/RichardsObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[WorkerTask createWithScheduler:priority:queue:]): (-[WorkerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/main.m: Added. (runRichards): (main): * APIBench/References/RichardsObjC/RichardsObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsSwift/RichardsSwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsSwift/RichardsSwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Scheduler.swift. * APIBench/References/RichardsSwift/RichardsSwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Task.swift. * APIBench/References/RichardsSwift/RichardsSwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/richards.swift. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. (Packet.addTo(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. (runRichards): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/api-bench: Canonical link: https://commits.webkit.org/231979@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-01 00:46:54 +00:00
# documentation and/or other materials provided with the distribution.
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
#
# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set -eo pipefail
API_BENCH_EXECUTABLE=$(basename "$0")
pushd "$(dirname "$0")" &> /dev/null
API_BENCH_DIR=$PWD
popd &> /dev/null
Add C and ObjC tests to APIBench https://bugs.webkit.org/show_bug.cgi?id=219246 Reviewed by Yusuke Suzuki. The benchmark now consists of two groups: initially they are identical, but the first group will not be changed going forward while the second group will be free to adopt new APIs. The two original tests (one mostly JS and the other mostly native) were also split into three tests each (C, ObjC and Swift). * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/References/RichardsC/RichardsC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/References/RichardsC/RichardsC.xcodeproj/xcshareddata/xcschemes/RichardsC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsC/RichardsC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/References/RichardsC/RichardsC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/References/RichardsJS/RichardsJS.js: Renamed from PerformanceTests/APIBench/RichardsJS/RichardsJS.js. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/xcshareddata/xcschemes/RichardsObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsObjC/RichardsObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsObjC/RichardsObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.h: Added. * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/References/RichardsObjC/RichardsObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/References/RichardsObjC/RichardsObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[WorkerTask createWithScheduler:priority:queue:]): (-[WorkerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/main.m: Added. (runRichards): (main): * APIBench/References/RichardsObjC/RichardsObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsSwift/RichardsSwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsSwift/RichardsSwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Scheduler.swift. * APIBench/References/RichardsSwift/RichardsSwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Task.swift. * APIBench/References/RichardsSwift/RichardsSwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/richards.swift. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. (Packet.addTo(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. (runRichards): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/api-bench: Canonical link: https://commits.webkit.org/231979@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-01 00:46:54 +00:00
CURRENT_BENCHMARK_ID=0
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
BENCHMARKS=()
BUILD_DIRECTORIES=()
Add C and ObjC tests to APIBench https://bugs.webkit.org/show_bug.cgi?id=219246 Reviewed by Yusuke Suzuki. The benchmark now consists of two groups: initially they are identical, but the first group will not be changed going forward while the second group will be free to adopt new APIs. The two original tests (one mostly JS and the other mostly native) were also split into three tests each (C, ObjC and Swift). * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/References/RichardsC/RichardsC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/References/RichardsC/RichardsC.xcodeproj/xcshareddata/xcschemes/RichardsC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsC/RichardsC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/References/RichardsC/RichardsC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/References/RichardsJS/RichardsJS.js: Renamed from PerformanceTests/APIBench/RichardsJS/RichardsJS.js. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/xcshareddata/xcschemes/RichardsObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsObjC/RichardsObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsObjC/RichardsObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.h: Added. * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/References/RichardsObjC/RichardsObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/References/RichardsObjC/RichardsObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[WorkerTask createWithScheduler:priority:queue:]): (-[WorkerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/main.m: Added. (runRichards): (main): * APIBench/References/RichardsObjC/RichardsObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsSwift/RichardsSwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsSwift/RichardsSwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Scheduler.swift. * APIBench/References/RichardsSwift/RichardsSwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Task.swift. * APIBench/References/RichardsSwift/RichardsSwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/richards.swift. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. (Packet.addTo(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. (runRichards): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/api-bench: Canonical link: https://commits.webkit.org/231979@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-01 00:46:54 +00:00
REFERENCES=("X")
CURRENT_API=()
UPCOMING_API=()
Add a JSC API to allow acquiring the JSLock https://bugs.webkit.org/show_bug.cgi?id=219663 Reviewed by Filip Pizlo. PerformanceTests: This patch does 3 things: - Change how the geomean is calculated in api-bench to avoid overflowing - Allow linking against the local build we're benchmarking - Adopt the new JSLock API in the UpcomingAPI subtests Using the new API the score improves by ~13.5%. Here are the results for each of the "UpcomingAPI" subtests plus the total score: Before After RichardsMostlyC: 77ms 23ms RichardsMostlyObjC: 309ms 282ms RichardsMostlySwift 305ms 280ms RichardsSomeC: 101ms 95ms RichardsSomeObjC: 160ms 157ms RichardsSomeSwift: 201ms 202ms ------------------------------------------ Score: 29.5974 33.6404 * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: (workfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyObjC.xcscheme: Renamed from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: (+[WorkerTask context]): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/BridgingHeader.h: Copied from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: (main): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/BridgingHeader.h: Copied from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: * APIBench/api-bench: Source/JavaScriptCore: Introduce two new functions to the C API: JSLock and JSUnlock. These functions allow users to take control of the JSContext's lock, which can greatly reduce the overhead of bridging between JS and native. * API/JSLockRef.cpp: Added. (JSLock): (JSUnlock): * API/JSLockRefPrivate.h: Added. * API/JSValueRef.cpp: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: Canonical link: https://commits.webkit.org/232323@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270659 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-10 23:10:36 +00:00
ARCHS=${ARCHS:-$(uname -m)}
Removing unnecessary locking from JSValue API functions https://bugs.webkit.org/show_bug.cgi?id=219723 Reviewed by Filip Pizlo. PerformanceTests: Print an error message when benchmarks fail to run and add option to change the configuration used to build the benchmarks. * APIBench/api-bench: Source/JavaScriptCore: Remove the unnecessary locking from the JSValueIs* and JSValueMake* API functions that only work on primitives. Also remove the unnecessary method dispatching and call from the -[JSValue is*] methods. This improves the APIBench score by another ~8% since these are such common operations. Here are the results: (Baseline includes https://bugs.webkit.org/show_bug.cgi?id=219663) CURRENT_API: Baseline Change ---------------------------------------- RichardsMostlyC: 74ms 60ms RichardsMostlyObjC: 304ms 300ms RichardsMostlySwift: 305ms 293ms RichardsSomeC: 97ms 77ms RichardsSomeObjC: 158ms 159ms RichardsSomeSwift: 202ms 198ms UPCOMING_API: Baseline Change ---------------------------------------- RichardsMostlyC: 23ms 19ms RichardsMostlyObjC: 282ms 282ms RichardsMostlySwift: 280ms 282ms RichardsSomeC: 95ms 76ms RichardsSomeObjC: 157ms 156ms RichardsSomeSwift: 202ms 197ms ---------------------------------------- Score: 33.6404 36.4006 * API/APICast.h: (toRef): * API/JSValue.mm: (-[JSValue isUndefined]): (-[JSValue isNull]): (-[JSValue isBoolean]): (-[JSValue isNumber]): (-[JSValue isString]): (-[JSValue isObject]): (-[JSValue isSymbol]): * API/JSValueRef.cpp: (JSValueGetType): (JSValueIsUndefined): (JSValueIsNull): (JSValueIsBoolean): (JSValueIsNumber): (JSValueIsString): (JSValueIsObject): (JSValueIsSymbol): (JSValueMakeUndefined): (JSValueMakeNull): (JSValueMakeBoolean): (JSValueMakeNumber): Canonical link: https://commits.webkit.org/232328@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270665 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-11 04:20:19 +00:00
CONFIGURATION=${CONFIGURATION:-Release}
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
shouldBuild=true
Add C and ObjC tests to APIBench https://bugs.webkit.org/show_bug.cgi?id=219246 Reviewed by Yusuke Suzuki. The benchmark now consists of two groups: initially they are identical, but the first group will not be changed going forward while the second group will be free to adopt new APIs. The two original tests (one mostly JS and the other mostly native) were also split into three tests each (C, ObjC and Swift). * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/References/RichardsC/RichardsC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/References/RichardsC/RichardsC.xcodeproj/xcshareddata/xcschemes/RichardsC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsC/RichardsC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/References/RichardsC/RichardsC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/References/RichardsJS/RichardsJS.js: Renamed from PerformanceTests/APIBench/RichardsJS/RichardsJS.js. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/xcshareddata/xcschemes/RichardsObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsObjC/RichardsObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsObjC/RichardsObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.h: Added. * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/References/RichardsObjC/RichardsObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/References/RichardsObjC/RichardsObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[WorkerTask createWithScheduler:priority:queue:]): (-[WorkerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/main.m: Added. (runRichards): (main): * APIBench/References/RichardsObjC/RichardsObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsSwift/RichardsSwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsSwift/RichardsSwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Scheduler.swift. * APIBench/References/RichardsSwift/RichardsSwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Task.swift. * APIBench/References/RichardsSwift/RichardsSwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/richards.swift. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. (Packet.addTo(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. (runRichards): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/api-bench: Canonical link: https://commits.webkit.org/231979@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-01 00:46:54 +00:00
runReferences=true
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
verbose=false
iterations=5
log() {
if [ "$verbose" == true ]; then
echo "$*"
fi
}
printUsage() {
cat <<EOF
Add C and ObjC tests to APIBench https://bugs.webkit.org/show_bug.cgi?id=219246 Reviewed by Yusuke Suzuki. The benchmark now consists of two groups: initially they are identical, but the first group will not be changed going forward while the second group will be free to adopt new APIs. The two original tests (one mostly JS and the other mostly native) were also split into three tests each (C, ObjC and Swift). * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/References/RichardsC/RichardsC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/References/RichardsC/RichardsC.xcodeproj/xcshareddata/xcschemes/RichardsC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsC/RichardsC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/References/RichardsC/RichardsC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/References/RichardsJS/RichardsJS.js: Renamed from PerformanceTests/APIBench/RichardsJS/RichardsJS.js. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/xcshareddata/xcschemes/RichardsObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsObjC/RichardsObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsObjC/RichardsObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.h: Added. * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/References/RichardsObjC/RichardsObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/References/RichardsObjC/RichardsObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[WorkerTask createWithScheduler:priority:queue:]): (-[WorkerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/main.m: Added. (runRichards): (main): * APIBench/References/RichardsObjC/RichardsObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsSwift/RichardsSwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsSwift/RichardsSwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Scheduler.swift. * APIBench/References/RichardsSwift/RichardsSwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Task.swift. * APIBench/References/RichardsSwift/RichardsSwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/richards.swift. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. (Packet.addTo(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. (runRichards): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/api-bench: Canonical link: https://commits.webkit.org/231979@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-01 00:46:54 +00:00
usage: $API_BENCH_EXECUTABLE [-h|--help] [--no-build] [--no-reference(s)] [-v|--verbose] [--iterations <n=$iterations>] <build_directory1> [<build_directory2> ...]
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
EOF
exit 0
}
collectFlags() {
while [ $# -gt 0 ]; do
case "$1" in
-h|--help)
printUsage
;;
--no-build)
shouldBuild=false
;;
Add C and ObjC tests to APIBench https://bugs.webkit.org/show_bug.cgi?id=219246 Reviewed by Yusuke Suzuki. The benchmark now consists of two groups: initially they are identical, but the first group will not be changed going forward while the second group will be free to adopt new APIs. The two original tests (one mostly JS and the other mostly native) were also split into three tests each (C, ObjC and Swift). * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/References/RichardsC/RichardsC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/References/RichardsC/RichardsC.xcodeproj/xcshareddata/xcschemes/RichardsC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsC/RichardsC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/References/RichardsC/RichardsC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/References/RichardsJS/RichardsJS.js: Renamed from PerformanceTests/APIBench/RichardsJS/RichardsJS.js. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/xcshareddata/xcschemes/RichardsObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsObjC/RichardsObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsObjC/RichardsObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.h: Added. * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/References/RichardsObjC/RichardsObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/References/RichardsObjC/RichardsObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[WorkerTask createWithScheduler:priority:queue:]): (-[WorkerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/main.m: Added. (runRichards): (main): * APIBench/References/RichardsObjC/RichardsObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsSwift/RichardsSwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsSwift/RichardsSwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Scheduler.swift. * APIBench/References/RichardsSwift/RichardsSwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Task.swift. * APIBench/References/RichardsSwift/RichardsSwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/richards.swift. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. (Packet.addTo(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. (runRichards): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/api-bench: Canonical link: https://commits.webkit.org/231979@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-01 00:46:54 +00:00
--no-reference|--no-references)
runReferences=false
;;
-v|--verbose)
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
verbose=true
;;
--iterations)
shift
iterations=$1
;;
*)
BUILD_DIRECTORIES=("$@")
break 2
;;
esac
shift
done
if [ ${#BUILD_DIRECTORIES[@]} -lt 1 ]; then
printUsage
exit 1
fi
for i in "${!BUILD_DIRECTORIES[@]}"; do
local buildDirectory
buildDirectory=${BUILD_DIRECTORIES[$i]}
if ! [ -d "$buildDirectory" ]; then
echo "No such file or directory: $buildDirectory"
exit 1
fi
pushd "$buildDirectory" &> /dev/null
BUILD_DIRECTORIES[$i]=$PWD
popd &> /dev/null
done
}
Add C and ObjC tests to APIBench https://bugs.webkit.org/show_bug.cgi?id=219246 Reviewed by Yusuke Suzuki. The benchmark now consists of two groups: initially they are identical, but the first group will not be changed going forward while the second group will be free to adopt new APIs. The two original tests (one mostly JS and the other mostly native) were also split into three tests each (C, ObjC and Swift). * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/References/RichardsC/RichardsC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/References/RichardsC/RichardsC.xcodeproj/xcshareddata/xcschemes/RichardsC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsC/RichardsC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/References/RichardsC/RichardsC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/References/RichardsJS/RichardsJS.js: Renamed from PerformanceTests/APIBench/RichardsJS/RichardsJS.js. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/xcshareddata/xcschemes/RichardsObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsObjC/RichardsObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsObjC/RichardsObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.h: Added. * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/References/RichardsObjC/RichardsObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/References/RichardsObjC/RichardsObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[WorkerTask createWithScheduler:priority:queue:]): (-[WorkerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/main.m: Added. (runRichards): (main): * APIBench/References/RichardsObjC/RichardsObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsSwift/RichardsSwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsSwift/RichardsSwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Scheduler.swift. * APIBench/References/RichardsSwift/RichardsSwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Task.swift. * APIBench/References/RichardsSwift/RichardsSwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/richards.swift. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. (Packet.addTo(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. (runRichards): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/api-bench: Canonical link: https://commits.webkit.org/231979@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-01 00:46:54 +00:00
collectBenchmarkDir() {
local benchmarkVar=$1
local benchmarkDir=$2
benchmarks=("$API_BENCH_DIR"/"$benchmarkDir"/*)
for benchmark in "${benchmarks[@]}"; do
local benchmarkID=$CURRENT_BENCHMARK_ID
CURRENT_BENCHMARK_ID=$((CURRENT_BENCHMARK_ID+1))
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
pushd "$benchmark" &> /dev/null
BENCHMARKS[$benchmarkID]=$PWD
Add C and ObjC tests to APIBench https://bugs.webkit.org/show_bug.cgi?id=219246 Reviewed by Yusuke Suzuki. The benchmark now consists of two groups: initially they are identical, but the first group will not be changed going forward while the second group will be free to adopt new APIs. The two original tests (one mostly JS and the other mostly native) were also split into three tests each (C, ObjC and Swift). * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/References/RichardsC/RichardsC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/References/RichardsC/RichardsC.xcodeproj/xcshareddata/xcschemes/RichardsC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsC/RichardsC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/References/RichardsC/RichardsC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/References/RichardsJS/RichardsJS.js: Renamed from PerformanceTests/APIBench/RichardsJS/RichardsJS.js. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/xcshareddata/xcschemes/RichardsObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsObjC/RichardsObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsObjC/RichardsObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.h: Added. * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/References/RichardsObjC/RichardsObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/References/RichardsObjC/RichardsObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[WorkerTask createWithScheduler:priority:queue:]): (-[WorkerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/main.m: Added. (runRichards): (main): * APIBench/References/RichardsObjC/RichardsObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsSwift/RichardsSwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsSwift/RichardsSwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Scheduler.swift. * APIBench/References/RichardsSwift/RichardsSwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Task.swift. * APIBench/References/RichardsSwift/RichardsSwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/richards.swift. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. (Packet.addTo(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. (runRichards): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/api-bench: Canonical link: https://commits.webkit.org/231979@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-01 00:46:54 +00:00
eval "${benchmarkVar}[\$benchmarkID]=$benchmarkID"
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
popd &> /dev/null
done
}
Add C and ObjC tests to APIBench https://bugs.webkit.org/show_bug.cgi?id=219246 Reviewed by Yusuke Suzuki. The benchmark now consists of two groups: initially they are identical, but the first group will not be changed going forward while the second group will be free to adopt new APIs. The two original tests (one mostly JS and the other mostly native) were also split into three tests each (C, ObjC and Swift). * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/References/RichardsC/RichardsC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/References/RichardsC/RichardsC.xcodeproj/xcshareddata/xcschemes/RichardsC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsC/RichardsC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/References/RichardsC/RichardsC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/References/RichardsJS/RichardsJS.js: Renamed from PerformanceTests/APIBench/RichardsJS/RichardsJS.js. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/xcshareddata/xcschemes/RichardsObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsObjC/RichardsObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsObjC/RichardsObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.h: Added. * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/References/RichardsObjC/RichardsObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/References/RichardsObjC/RichardsObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[WorkerTask createWithScheduler:priority:queue:]): (-[WorkerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/main.m: Added. (runRichards): (main): * APIBench/References/RichardsObjC/RichardsObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsSwift/RichardsSwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsSwift/RichardsSwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Scheduler.swift. * APIBench/References/RichardsSwift/RichardsSwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Task.swift. * APIBench/References/RichardsSwift/RichardsSwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/richards.swift. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. (Packet.addTo(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. (runRichards): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/api-bench: Canonical link: https://commits.webkit.org/231979@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-01 00:46:54 +00:00
collectBenchmarks() {
if [ "$runReferences" == true ]; then
collectBenchmarkDir "REFERENCES" References
fi
collectBenchmarkDir "CURRENT_API" CurrentAPI
collectBenchmarkDir "UPCOMING_API" UpcomingAPI
}
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
forEachBenchmark() {
local functor
functor="$1"
declare "$functor"
for benchmarkID in "${!BENCHMARKS[@]}"; do
local benchmark
benchmark=${BENCHMARKS[$benchmarkID]}
pushd "$benchmark" &> /dev/null
BENCHMARK_ID=$benchmarkID
BENCHMARK_NAME=$(basename "$benchmark")
"$functor"
popd &> /dev/null
done
}
buildBenchmark() {
project=$BENCHMARK_NAME.xcodeproj
if ! [ -e "$project" ]; then
return
fi
Add a JSC API to allow acquiring the JSLock https://bugs.webkit.org/show_bug.cgi?id=219663 Reviewed by Filip Pizlo. PerformanceTests: This patch does 3 things: - Change how the geomean is calculated in api-bench to avoid overflowing - Allow linking against the local build we're benchmarking - Adopt the new JSLock API in the UpcomingAPI subtests Using the new API the score improves by ~13.5%. Here are the results for each of the "UpcomingAPI" subtests plus the total score: Before After RichardsMostlyC: 77ms 23ms RichardsMostlyObjC: 309ms 282ms RichardsMostlySwift 305ms 280ms RichardsSomeC: 101ms 95ms RichardsSomeObjC: 160ms 157ms RichardsSomeSwift: 201ms 202ms ------------------------------------------ Score: 29.5974 33.6404 * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: (workfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyObjC.xcscheme: Renamed from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: (+[WorkerTask context]): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/BridgingHeader.h: Copied from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: (main): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/BridgingHeader.h: Copied from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: * APIBench/api-bench: Source/JavaScriptCore: Introduce two new functions to the C API: JSLock and JSUnlock. These functions allow users to take control of the JSContext's lock, which can greatly reduce the overhead of bridging between JS and native. * API/JSLockRef.cpp: Added. (JSLock): (JSUnlock): * API/JSLockRefPrivate.h: Added. * API/JSValueRef.cpp: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: Canonical link: https://commits.webkit.org/232323@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270659 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-10 23:10:36 +00:00
log "Building $BENCHMARK_NAME... (FRAMEWORK_SEARCH_PATHS='$BUILD_DIRECTORY')"
Removing unnecessary locking from JSValue API functions https://bugs.webkit.org/show_bug.cgi?id=219723 Reviewed by Filip Pizlo. PerformanceTests: Print an error message when benchmarks fail to run and add option to change the configuration used to build the benchmarks. * APIBench/api-bench: Source/JavaScriptCore: Remove the unnecessary locking from the JSValueIs* and JSValueMake* API functions that only work on primitives. Also remove the unnecessary method dispatching and call from the -[JSValue is*] methods. This improves the APIBench score by another ~8% since these are such common operations. Here are the results: (Baseline includes https://bugs.webkit.org/show_bug.cgi?id=219663) CURRENT_API: Baseline Change ---------------------------------------- RichardsMostlyC: 74ms 60ms RichardsMostlyObjC: 304ms 300ms RichardsMostlySwift: 305ms 293ms RichardsSomeC: 97ms 77ms RichardsSomeObjC: 158ms 159ms RichardsSomeSwift: 202ms 198ms UPCOMING_API: Baseline Change ---------------------------------------- RichardsMostlyC: 23ms 19ms RichardsMostlyObjC: 282ms 282ms RichardsMostlySwift: 280ms 282ms RichardsSomeC: 95ms 76ms RichardsSomeObjC: 157ms 156ms RichardsSomeSwift: 202ms 197ms ---------------------------------------- Score: 33.6404 36.4006 * API/APICast.h: (toRef): * API/JSValue.mm: (-[JSValue isUndefined]): (-[JSValue isNull]): (-[JSValue isBoolean]): (-[JSValue isNumber]): (-[JSValue isString]): (-[JSValue isObject]): (-[JSValue isSymbol]): * API/JSValueRef.cpp: (JSValueGetType): (JSValueIsUndefined): (JSValueIsNull): (JSValueIsBoolean): (JSValueIsNumber): (JSValueIsString): (JSValueIsObject): (JSValueIsSymbol): (JSValueMakeUndefined): (JSValueMakeNull): (JSValueMakeBoolean): (JSValueMakeNumber): Canonical link: https://commits.webkit.org/232328@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270665 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-11 04:20:19 +00:00
xcodebuild -project "$project" -target "$BENCHMARK_NAME" -configuration "$CONFIGURATION" build "FRAMEWORK_SEARCH_PATHS='$BUILD_DIRECTORY'" "ARCHS='$ARCHS'"
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
}
build() {
Add a JSC API to allow acquiring the JSLock https://bugs.webkit.org/show_bug.cgi?id=219663 Reviewed by Filip Pizlo. PerformanceTests: This patch does 3 things: - Change how the geomean is calculated in api-bench to avoid overflowing - Allow linking against the local build we're benchmarking - Adopt the new JSLock API in the UpcomingAPI subtests Using the new API the score improves by ~13.5%. Here are the results for each of the "UpcomingAPI" subtests plus the total score: Before After RichardsMostlyC: 77ms 23ms RichardsMostlyObjC: 309ms 282ms RichardsMostlySwift 305ms 280ms RichardsSomeC: 101ms 95ms RichardsSomeObjC: 160ms 157ms RichardsSomeSwift: 201ms 202ms ------------------------------------------ Score: 29.5974 33.6404 * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: (workfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyObjC.xcscheme: Renamed from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: (+[WorkerTask context]): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/BridgingHeader.h: Copied from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: (main): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/BridgingHeader.h: Copied from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: * APIBench/api-bench: Source/JavaScriptCore: Introduce two new functions to the C API: JSLock and JSUnlock. These functions allow users to take control of the JSContext's lock, which can greatly reduce the overhead of bridging between JS and native. * API/JSLockRef.cpp: Added. (JSLock): (JSUnlock): * API/JSLockRefPrivate.h: Added. * API/JSValueRef.cpp: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: Canonical link: https://commits.webkit.org/232323@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270659 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-10 23:10:36 +00:00
BUILD_DIRECTORY=$1
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
forEachBenchmark "buildBenchmark"
}
runJSBenchmark() {
"$DYLD_FRAMEWORK_PATH/jsc" "$BENCHMARK_NAME.js"
}
runNativeBenchmark() {
Removing unnecessary locking from JSValue API functions https://bugs.webkit.org/show_bug.cgi?id=219723 Reviewed by Filip Pizlo. PerformanceTests: Print an error message when benchmarks fail to run and add option to change the configuration used to build the benchmarks. * APIBench/api-bench: Source/JavaScriptCore: Remove the unnecessary locking from the JSValueIs* and JSValueMake* API functions that only work on primitives. Also remove the unnecessary method dispatching and call from the -[JSValue is*] methods. This improves the APIBench score by another ~8% since these are such common operations. Here are the results: (Baseline includes https://bugs.webkit.org/show_bug.cgi?id=219663) CURRENT_API: Baseline Change ---------------------------------------- RichardsMostlyC: 74ms 60ms RichardsMostlyObjC: 304ms 300ms RichardsMostlySwift: 305ms 293ms RichardsSomeC: 97ms 77ms RichardsSomeObjC: 158ms 159ms RichardsSomeSwift: 202ms 198ms UPCOMING_API: Baseline Change ---------------------------------------- RichardsMostlyC: 23ms 19ms RichardsMostlyObjC: 282ms 282ms RichardsMostlySwift: 280ms 282ms RichardsSomeC: 95ms 76ms RichardsSomeObjC: 157ms 156ms RichardsSomeSwift: 202ms 197ms ---------------------------------------- Score: 33.6404 36.4006 * API/APICast.h: (toRef): * API/JSValue.mm: (-[JSValue isUndefined]): (-[JSValue isNull]): (-[JSValue isBoolean]): (-[JSValue isNumber]): (-[JSValue isString]): (-[JSValue isObject]): (-[JSValue isSymbol]): * API/JSValueRef.cpp: (JSValueGetType): (JSValueIsUndefined): (JSValueIsNull): (JSValueIsBoolean): (JSValueIsNumber): (JSValueIsString): (JSValueIsObject): (JSValueIsSymbol): (JSValueMakeUndefined): (JSValueMakeNull): (JSValueMakeBoolean): (JSValueMakeNumber): Canonical link: https://commits.webkit.org/232328@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270665 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-11 04:20:19 +00:00
pushd "build/$CONFIGURATION" &> /dev/null
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
"./$BENCHMARK_NAME"
Removing unnecessary locking from JSValue API functions https://bugs.webkit.org/show_bug.cgi?id=219723 Reviewed by Filip Pizlo. PerformanceTests: Print an error message when benchmarks fail to run and add option to change the configuration used to build the benchmarks. * APIBench/api-bench: Source/JavaScriptCore: Remove the unnecessary locking from the JSValueIs* and JSValueMake* API functions that only work on primitives. Also remove the unnecessary method dispatching and call from the -[JSValue is*] methods. This improves the APIBench score by another ~8% since these are such common operations. Here are the results: (Baseline includes https://bugs.webkit.org/show_bug.cgi?id=219663) CURRENT_API: Baseline Change ---------------------------------------- RichardsMostlyC: 74ms 60ms RichardsMostlyObjC: 304ms 300ms RichardsMostlySwift: 305ms 293ms RichardsSomeC: 97ms 77ms RichardsSomeObjC: 158ms 159ms RichardsSomeSwift: 202ms 198ms UPCOMING_API: Baseline Change ---------------------------------------- RichardsMostlyC: 23ms 19ms RichardsMostlyObjC: 282ms 282ms RichardsMostlySwift: 280ms 282ms RichardsSomeC: 95ms 76ms RichardsSomeObjC: 157ms 156ms RichardsSomeSwift: 202ms 197ms ---------------------------------------- Score: 33.6404 36.4006 * API/APICast.h: (toRef): * API/JSValue.mm: (-[JSValue isUndefined]): (-[JSValue isNull]): (-[JSValue isBoolean]): (-[JSValue isNumber]): (-[JSValue isString]): (-[JSValue isObject]): (-[JSValue isSymbol]): * API/JSValueRef.cpp: (JSValueGetType): (JSValueIsUndefined): (JSValueIsNull): (JSValueIsBoolean): (JSValueIsNumber): (JSValueIsString): (JSValueIsObject): (JSValueIsSymbol): (JSValueMakeUndefined): (JSValueMakeNull): (JSValueMakeBoolean): (JSValueMakeNumber): Canonical link: https://commits.webkit.org/232328@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270665 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-11 04:20:19 +00:00
local exitCode=$?
if [ $exitCode -ne 0 ]; then
echo "Benchmark exited with an error: $PWD/$BENCHMARK_NAME exited with $exitCode" 1>&2
fi
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
popd &> /dev/null
Removing unnecessary locking from JSValue API functions https://bugs.webkit.org/show_bug.cgi?id=219723 Reviewed by Filip Pizlo. PerformanceTests: Print an error message when benchmarks fail to run and add option to change the configuration used to build the benchmarks. * APIBench/api-bench: Source/JavaScriptCore: Remove the unnecessary locking from the JSValueIs* and JSValueMake* API functions that only work on primitives. Also remove the unnecessary method dispatching and call from the -[JSValue is*] methods. This improves the APIBench score by another ~8% since these are such common operations. Here are the results: (Baseline includes https://bugs.webkit.org/show_bug.cgi?id=219663) CURRENT_API: Baseline Change ---------------------------------------- RichardsMostlyC: 74ms 60ms RichardsMostlyObjC: 304ms 300ms RichardsMostlySwift: 305ms 293ms RichardsSomeC: 97ms 77ms RichardsSomeObjC: 158ms 159ms RichardsSomeSwift: 202ms 198ms UPCOMING_API: Baseline Change ---------------------------------------- RichardsMostlyC: 23ms 19ms RichardsMostlyObjC: 282ms 282ms RichardsMostlySwift: 280ms 282ms RichardsSomeC: 95ms 76ms RichardsSomeObjC: 157ms 156ms RichardsSomeSwift: 202ms 197ms ---------------------------------------- Score: 33.6404 36.4006 * API/APICast.h: (toRef): * API/JSValue.mm: (-[JSValue isUndefined]): (-[JSValue isNull]): (-[JSValue isBoolean]): (-[JSValue isNumber]): (-[JSValue isString]): (-[JSValue isObject]): (-[JSValue isSymbol]): * API/JSValueRef.cpp: (JSValueGetType): (JSValueIsUndefined): (JSValueIsNull): (JSValueIsBoolean): (JSValueIsNumber): (JSValueIsString): (JSValueIsObject): (JSValueIsSymbol): (JSValueMakeUndefined): (JSValueMakeNull): (JSValueMakeBoolean): (JSValueMakeNumber): Canonical link: https://commits.webkit.org/232328@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270665 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-11 04:20:19 +00:00
return $exitCode
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
}
runBenchmarkIteration() {
if [ -e "build" ]; then
runNativeBenchmark
else
runJSBenchmark
fi
}
runBenchmark() {
log "Running $BENCHMARK_NAME..."
local result
result=$(runBenchmarkIteration)
Removing unnecessary locking from JSValue API functions https://bugs.webkit.org/show_bug.cgi?id=219723 Reviewed by Filip Pizlo. PerformanceTests: Print an error message when benchmarks fail to run and add option to change the configuration used to build the benchmarks. * APIBench/api-bench: Source/JavaScriptCore: Remove the unnecessary locking from the JSValueIs* and JSValueMake* API functions that only work on primitives. Also remove the unnecessary method dispatching and call from the -[JSValue is*] methods. This improves the APIBench score by another ~8% since these are such common operations. Here are the results: (Baseline includes https://bugs.webkit.org/show_bug.cgi?id=219663) CURRENT_API: Baseline Change ---------------------------------------- RichardsMostlyC: 74ms 60ms RichardsMostlyObjC: 304ms 300ms RichardsMostlySwift: 305ms 293ms RichardsSomeC: 97ms 77ms RichardsSomeObjC: 158ms 159ms RichardsSomeSwift: 202ms 198ms UPCOMING_API: Baseline Change ---------------------------------------- RichardsMostlyC: 23ms 19ms RichardsMostlyObjC: 282ms 282ms RichardsMostlySwift: 280ms 282ms RichardsSomeC: 95ms 76ms RichardsSomeObjC: 157ms 156ms RichardsSomeSwift: 202ms 197ms ---------------------------------------- Score: 33.6404 36.4006 * API/APICast.h: (toRef): * API/JSValue.mm: (-[JSValue isUndefined]): (-[JSValue isNull]): (-[JSValue isBoolean]): (-[JSValue isNumber]): (-[JSValue isString]): (-[JSValue isObject]): (-[JSValue isSymbol]): * API/JSValueRef.cpp: (JSValueGetType): (JSValueIsUndefined): (JSValueIsNull): (JSValueIsBoolean): (JSValueIsNumber): (JSValueIsString): (JSValueIsObject): (JSValueIsSymbol): (JSValueMakeUndefined): (JSValueMakeNull): (JSValueMakeBoolean): (JSValueMakeNumber): Canonical link: https://commits.webkit.org/232328@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270665 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-11 04:20:19 +00:00
if [ $? -ne 0 ]; then
exit 1
fi
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
RESULTS[$((BENCHMARK_ID * iterations + ITERATION))]=$result
log "Finished in ${result}ms"
}
computeAverage() {
local benchmarkID benchmark sum avg
benchmarkID=$1
benchmark=${BENCHMARKS[$benchmarkID]}
sum=0
for iteration in $(seq 0 1 $((iterations - 1))); do
local result
result=${RESULTS[$((benchmarkID * iterations + iteration))]}
sum=$((sum + result))
done
bc <<< "$sum.0 / $iterations.0"
}
printAverage() {
local benchmarkID benchmark name avg
benchmarkID=$1
avg=$2
benchmark=${BENCHMARKS[$benchmarkID]}
name=$(basename "$benchmark")
echo "$name: ${avg}ms"
}
printBenchmark() {
printAverage "$@" "$(computeAverage "$@")"
}
printResults() {
Add C and ObjC tests to APIBench https://bugs.webkit.org/show_bug.cgi?id=219246 Reviewed by Yusuke Suzuki. The benchmark now consists of two groups: initially they are identical, but the first group will not be changed going forward while the second group will be free to adopt new APIs. The two original tests (one mostly JS and the other mostly native) were also split into three tests each (C, ObjC and Swift). * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/References/RichardsC/RichardsC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/References/RichardsC/RichardsC.xcodeproj/xcshareddata/xcschemes/RichardsC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsC/RichardsC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/References/RichardsC/RichardsC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/References/RichardsJS/RichardsJS.js: Renamed from PerformanceTests/APIBench/RichardsJS/RichardsJS.js. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/xcshareddata/xcschemes/RichardsObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsObjC/RichardsObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsObjC/RichardsObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.h: Added. * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/References/RichardsObjC/RichardsObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/References/RichardsObjC/RichardsObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[WorkerTask createWithScheduler:priority:queue:]): (-[WorkerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/main.m: Added. (runRichards): (main): * APIBench/References/RichardsObjC/RichardsObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsSwift/RichardsSwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsSwift/RichardsSwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Scheduler.swift. * APIBench/References/RichardsSwift/RichardsSwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Task.swift. * APIBench/References/RichardsSwift/RichardsSwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/richards.swift. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. (Packet.addTo(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. (runRichards): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/api-bench: Canonical link: https://commits.webkit.org/231979@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-01 00:46:54 +00:00
local buildDirectory=$1
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
echo "Results for $buildDirectory ($iterations iterations)"
echo "================================================================================"
Add C and ObjC tests to APIBench https://bugs.webkit.org/show_bug.cgi?id=219246 Reviewed by Yusuke Suzuki. The benchmark now consists of two groups: initially they are identical, but the first group will not be changed going forward while the second group will be free to adopt new APIs. The two original tests (one mostly JS and the other mostly native) were also split into three tests each (C, ObjC and Swift). * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/References/RichardsC/RichardsC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/References/RichardsC/RichardsC.xcodeproj/xcshareddata/xcschemes/RichardsC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsC/RichardsC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/References/RichardsC/RichardsC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/References/RichardsJS/RichardsJS.js: Renamed from PerformanceTests/APIBench/RichardsJS/RichardsJS.js. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/xcshareddata/xcschemes/RichardsObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsObjC/RichardsObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsObjC/RichardsObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.h: Added. * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/References/RichardsObjC/RichardsObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/References/RichardsObjC/RichardsObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[WorkerTask createWithScheduler:priority:queue:]): (-[WorkerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/main.m: Added. (runRichards): (main): * APIBench/References/RichardsObjC/RichardsObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsSwift/RichardsSwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsSwift/RichardsSwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Scheduler.swift. * APIBench/References/RichardsSwift/RichardsSwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Task.swift. * APIBench/References/RichardsSwift/RichardsSwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/richards.swift. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. (Packet.addTo(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. (runRichards): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/api-bench: Canonical link: https://commits.webkit.org/231979@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-01 00:46:54 +00:00
if [ "$runReferences" == true ]; then
echo ""
echo "References:"
echo "----------------------------------------"
for benchmarkID in "${REFERENCES[@]}"; do
printBenchmark "$benchmarkID"
done
fi
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
local score count
Add a JSC API to allow acquiring the JSLock https://bugs.webkit.org/show_bug.cgi?id=219663 Reviewed by Filip Pizlo. PerformanceTests: This patch does 3 things: - Change how the geomean is calculated in api-bench to avoid overflowing - Allow linking against the local build we're benchmarking - Adopt the new JSLock API in the UpcomingAPI subtests Using the new API the score improves by ~13.5%. Here are the results for each of the "UpcomingAPI" subtests plus the total score: Before After RichardsMostlyC: 77ms 23ms RichardsMostlyObjC: 309ms 282ms RichardsMostlySwift 305ms 280ms RichardsSomeC: 101ms 95ms RichardsSomeObjC: 160ms 157ms RichardsSomeSwift: 201ms 202ms ------------------------------------------ Score: 29.5974 33.6404 * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: (workfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyObjC.xcscheme: Renamed from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: (+[WorkerTask context]): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/BridgingHeader.h: Copied from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: (main): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/BridgingHeader.h: Copied from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: * APIBench/api-bench: Source/JavaScriptCore: Introduce two new functions to the C API: JSLock and JSUnlock. These functions allow users to take control of the JSContext's lock, which can greatly reduce the overhead of bridging between JS and native. * API/JSLockRef.cpp: Added. (JSLock): (JSUnlock): * API/JSLockRefPrivate.h: Added. * API/JSValueRef.cpp: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: Canonical link: https://commits.webkit.org/232323@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270659 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-10 23:10:36 +00:00
score=0
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
count=0
Add C and ObjC tests to APIBench https://bugs.webkit.org/show_bug.cgi?id=219246 Reviewed by Yusuke Suzuki. The benchmark now consists of two groups: initially they are identical, but the first group will not be changed going forward while the second group will be free to adopt new APIs. The two original tests (one mostly JS and the other mostly native) were also split into three tests each (C, ObjC and Swift). * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/References/RichardsC/RichardsC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/References/RichardsC/RichardsC.xcodeproj/xcshareddata/xcschemes/RichardsC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsC/RichardsC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/References/RichardsC/RichardsC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/References/RichardsJS/RichardsJS.js: Renamed from PerformanceTests/APIBench/RichardsJS/RichardsJS.js. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/xcshareddata/xcschemes/RichardsObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsObjC/RichardsObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsObjC/RichardsObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.h: Added. * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/References/RichardsObjC/RichardsObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/References/RichardsObjC/RichardsObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[WorkerTask createWithScheduler:priority:queue:]): (-[WorkerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/main.m: Added. (runRichards): (main): * APIBench/References/RichardsObjC/RichardsObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsSwift/RichardsSwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsSwift/RichardsSwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Scheduler.swift. * APIBench/References/RichardsSwift/RichardsSwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Task.swift. * APIBench/References/RichardsSwift/RichardsSwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/richards.swift. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. (Packet.addTo(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. (runRichards): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/api-bench: Canonical link: https://commits.webkit.org/231979@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-01 00:46:54 +00:00
printCategory() {
local category=$1
echo ""
echo "$category:"
echo "----------------------------------------"
for benchmarkID in $(eval 'echo ${'"$category"'[@]}'); do
avg=$(computeAverage "$benchmarkID")
printAverage "$benchmarkID" "$avg"
count=$((count + 1))
Add a JSC API to allow acquiring the JSLock https://bugs.webkit.org/show_bug.cgi?id=219663 Reviewed by Filip Pizlo. PerformanceTests: This patch does 3 things: - Change how the geomean is calculated in api-bench to avoid overflowing - Allow linking against the local build we're benchmarking - Adopt the new JSLock API in the UpcomingAPI subtests Using the new API the score improves by ~13.5%. Here are the results for each of the "UpcomingAPI" subtests plus the total score: Before After RichardsMostlyC: 77ms 23ms RichardsMostlyObjC: 309ms 282ms RichardsMostlySwift 305ms 280ms RichardsSomeC: 101ms 95ms RichardsSomeObjC: 160ms 157ms RichardsSomeSwift: 201ms 202ms ------------------------------------------ Score: 29.5974 33.6404 * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: (workfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyObjC.xcscheme: Renamed from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: (+[WorkerTask context]): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/BridgingHeader.h: Copied from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: (main): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/BridgingHeader.h: Copied from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: * APIBench/api-bench: Source/JavaScriptCore: Introduce two new functions to the C API: JSLock and JSUnlock. These functions allow users to take control of the JSContext's lock, which can greatly reduce the overhead of bridging between JS and native. * API/JSLockRef.cpp: Added. (JSLock): (JSUnlock): * API/JSLockRefPrivate.h: Added. * API/JSValueRef.cpp: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: Canonical link: https://commits.webkit.org/232323@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270659 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-10 23:10:36 +00:00
score=$(echo "$score" "$avg" | awk '{print ($1 + log($2)) }')
Add C and ObjC tests to APIBench https://bugs.webkit.org/show_bug.cgi?id=219246 Reviewed by Yusuke Suzuki. The benchmark now consists of two groups: initially they are identical, but the first group will not be changed going forward while the second group will be free to adopt new APIs. The two original tests (one mostly JS and the other mostly native) were also split into three tests each (C, ObjC and Swift). * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/CurrentAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/CurrentAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. * APIBench/CurrentAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/CurrentAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/CurrentAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. * APIBench/CurrentAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/References/RichardsC/RichardsC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/References/RichardsC/RichardsC.xcodeproj/xcshareddata/xcschemes/RichardsC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsC/RichardsC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/References/RichardsC/RichardsC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/References/RichardsJS/RichardsJS.js: Renamed from PerformanceTests/APIBench/RichardsJS/RichardsJS.js. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsObjC/RichardsObjC.xcodeproj/xcshareddata/xcschemes/RichardsObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsObjC/RichardsObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/Packet.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsObjC/RichardsObjC/Packet.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.h: Added. * APIBench/References/RichardsObjC/RichardsObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/References/RichardsObjC/RichardsObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/References/RichardsObjC/RichardsObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsObjC/RichardsObjC/WorkerTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[WorkerTask createWithScheduler:priority:queue:]): (-[WorkerTask run:]): * APIBench/References/RichardsObjC/RichardsObjC/main.m: Added. (runRichards): (main): * APIBench/References/RichardsObjC/RichardsObjC/richards.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj. * APIBench/References/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/References/RichardsSwift/RichardsSwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/IdleTask.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/Packet.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/References/RichardsSwift/RichardsSwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Scheduler.swift. * APIBench/References/RichardsSwift/RichardsSwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Task.swift. * APIBench/References/RichardsSwift/RichardsSwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift. * APIBench/References/RichardsSwift/RichardsSwift/main.swift: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/References/RichardsSwift/RichardsSwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/richards.swift. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyC.xcscheme: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: Added. (pkt): (trace): (schedule): (wait_): (holdself): (findtcb): (release): (qpkt): (idlefn): (valueToTask): (waitWrapper): (qpktWrapper): (readFile): (workfn): (handlerfn): (devfn): (append): (setup): (getQpktcount): (getHoldcount): (main): * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.js: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (createWorkfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Device.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/DeviceTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[DeviceTask createWithScheduler:device:priority:]): (-[DeviceTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/HandlerTask.m: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (+[HandlerTask createWithScheduler:device:priority:queue:]): (-[HandlerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/IdleTask.m: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. (+[IdleTask createWithScheduler:priority:]): (-[IdleTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.h: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/Packet.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Packet.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/IdleTask.swift. (+[Packet create:withLink:]): (-[Packet addToQueue:]): (+[DevicePacket create:withLink:]): (+[WorkPacket createWithLink:]): (+[WorkPacket size]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.h: Added. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Scheduler.m: Added. (-[Scheduler schedule]): (-[Scheduler addTask:]): (-[Scheduler releaseDevice:]): (-[Scheduler holdCurrent]): (-[Scheduler waitCurrent]): (-[Scheduler queue:]): (-[Scheduler handle:]): (-[Scheduler _queueImpl:packet:]): (-[Scheduler _find:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.h: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/Task.m: Added. (+[Task createWithScheduler:priority:queue:]): (-[Task run:]): (-[Task release_]): (-[Task hold]): (-[Task wait]): (-[Task resume]): (-[Task takePacket]): (-[Task checkPriorityAdd:packet:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.h: Copied from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: Added. (+[WorkerTask createWithScheduler:priority:queue:]): (+[WorkerTask context]): (+[WorkerTask constructor]): (-[WorkerTask run:]): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/main.m: Added. (runRichards): (main): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/richards.m: Renamed from PerformanceTests/APIBench/RichardsSwift/RichardsSwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift. (Packet.addTo(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js. (return.prototype.run): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Renamed from PerformanceTests/APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift. (runRichards): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: Added. (WorkerTask_run): (WorkerTask_constructor): (WorkerTask_getProperty): (main): * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/project.pbxproj: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC.xcodeproj/xcshareddata/xcschemes/RichardsSomeObjC.xcscheme: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: Added. (-[WorkerTask initWithScheduler:v1:v2:]): (-[WorkerTask toString]): (-[WorkerTask run:]): (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/richards.js: Copied from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/xcshareddata/xcschemes/RichardsSomeSwift.xcscheme: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/richards.js: Renamed from PerformanceTests/APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/api-bench: Canonical link: https://commits.webkit.org/231979@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-01 00:46:54 +00:00
done
}
printCategory "CURRENT_API"
printCategory "UPCOMING_API"
Add a JSC API to allow acquiring the JSLock https://bugs.webkit.org/show_bug.cgi?id=219663 Reviewed by Filip Pizlo. PerformanceTests: This patch does 3 things: - Change how the geomean is calculated in api-bench to avoid overflowing - Allow linking against the local build we're benchmarking - Adopt the new JSLock API in the UpcomingAPI subtests Using the new API the score improves by ~13.5%. Here are the results for each of the "UpcomingAPI" subtests plus the total score: Before After RichardsMostlyC: 77ms 23ms RichardsMostlyObjC: 309ms 282ms RichardsMostlySwift 305ms 280ms RichardsSomeC: 101ms 95ms RichardsSomeObjC: 160ms 157ms RichardsSomeSwift: 201ms 202ms ------------------------------------------ Score: 29.5974 33.6404 * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: (workfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyObjC.xcscheme: Renamed from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: (+[WorkerTask context]): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/BridgingHeader.h: Copied from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: (main): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/BridgingHeader.h: Copied from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: * APIBench/api-bench: Source/JavaScriptCore: Introduce two new functions to the C API: JSLock and JSUnlock. These functions allow users to take control of the JSContext's lock, which can greatly reduce the overhead of bridging between JS and native. * API/JSLockRef.cpp: Added. (JSLock): (JSUnlock): * API/JSLockRefPrivate.h: Added. * API/JSValueRef.cpp: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: Canonical link: https://commits.webkit.org/232323@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270659 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-10 23:10:36 +00:00
score=$(echo "$score" "$count" | awk '{ print(5000.0 / exp($1 / $2)) }')
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
echo ""
echo "Score: $score"
}
run() {
local buildDirectory
buildDirectory=$1
export DYLD_FRAMEWORK_PATH=$buildDirectory
for iteration in $(seq 0 1 $((iterations-1))); do
ITERATION=$iteration
forEachBenchmark "runBenchmark"
done
printResults "$buildDirectory"
}
main() {
collectFlags "$@"
collectBenchmarks
for buildDirectory in "${BUILD_DIRECTORIES[@]}"; do
Add a JSC API to allow acquiring the JSLock https://bugs.webkit.org/show_bug.cgi?id=219663 Reviewed by Filip Pizlo. PerformanceTests: This patch does 3 things: - Change how the geomean is calculated in api-bench to avoid overflowing - Allow linking against the local build we're benchmarking - Adopt the new JSLock API in the UpcomingAPI subtests Using the new API the score improves by ~13.5%. Here are the results for each of the "UpcomingAPI" subtests plus the total score: Before After RichardsMostlyC: 77ms 23ms RichardsMostlyObjC: 309ms 282ms RichardsMostlySwift 305ms 280ms RichardsSomeC: 101ms 95ms RichardsSomeObjC: 160ms 157ms RichardsSomeSwift: 201ms 202ms ------------------------------------------ Score: 29.5974 33.6404 * APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c: (workfn): * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyObjC.xcscheme: Renamed from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme. * APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m: (+[WorkerTask context]): * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/BridgingHeader.h: Copied from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: * APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m: (main): * APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m: (main): * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj: * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/BridgingHeader.h: Copied from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift. * APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift: * APIBench/api-bench: Source/JavaScriptCore: Introduce two new functions to the C API: JSLock and JSUnlock. These functions allow users to take control of the JSContext's lock, which can greatly reduce the overhead of bridging between JS and native. * API/JSLockRef.cpp: Added. (JSLock): (JSUnlock): * API/JSLockRefPrivate.h: Added. * API/JSValueRef.cpp: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: Canonical link: https://commits.webkit.org/232323@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270659 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-10 23:10:36 +00:00
if [ "$shouldBuild" == true ]; then
build "$buildDirectory"
fi
New API benchmark https://bugs.webkit.org/show_bug.cgi?id=213750 Reviewed by Saam Barati. APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks: - RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs. - RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is. - RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler. - RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport. The benchmark can be built and run using the api-bench script, as following: PerformanceTests/APIBench/api-bench WebKitBuild/Release By default, it will build each of the benchmarks and run 5 iterations. The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]). The script prints the average for the references and tests and the final score: Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations) ================================================================================ References: ---------------------------------------- RichardsJS: 14ms RichardsSwift: 29ms Tests: ---------------------------------------- RichardsMostlyJS: 218ms RichardsMostlySwift: 315ms Score: 19.0804 * APIBench/RichardsJS/RichardsJS.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (WorkerTask): (WorkerTask.prototype.run): (WorkerTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added. * APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added. (run(_:)): (toString): (WorkerTask.toString): (WorkerTask.run(_:)): * APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added. (runRichards): (Scheduler): (Scheduler.prototype.addIdleTask): (Scheduler.prototype.addWorkerTask): (Scheduler.prototype.addHandlerTask): (Scheduler.prototype.addDeviceTask): (Scheduler.prototype.addRunningTask): (Scheduler.prototype.addTask): (Scheduler.prototype.schedule): (Scheduler.prototype.release): (Scheduler.prototype.holdCurrent): (Scheduler.prototype.suspendCurrent): (Scheduler.prototype.queue): (TaskControlBlock): (TaskControlBlock.prototype.setRunning): (TaskControlBlock.prototype.markAsNotHeld): (TaskControlBlock.prototype.markAsHeld): (TaskControlBlock.prototype.isHeldOrSuspended): (TaskControlBlock.prototype.markAsSuspended): (TaskControlBlock.prototype.markAsRunnable): (TaskControlBlock.prototype.run): (TaskControlBlock.prototype.checkPriorityAdd): (TaskControlBlock.prototype.toString): (IdleTask): (IdleTask.prototype.run): (IdleTask.prototype.toString): (DeviceTask): (DeviceTask.prototype.run): (DeviceTask.prototype.toString): (HandlerTask): (HandlerTask.prototype.run): (HandlerTask.prototype.toString): (Packet): (Packet.prototype.addTo): (Packet.prototype.toString): * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added. (waitCurrent): (handle(_:)): (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release_(_:)): (holdCurrent): (queue(_:)): (queueImpl(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added. (Task.run(_:)): (Task.release_): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added. * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added. (return.prototype.run): * APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added. (runRichards): * APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added. * APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added. * APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added. (DeviceTask.create(_:device:priority:)): (DeviceTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added. (HandlerTask.device): (HandlerTask.create(_:device:priority:queue:)): (HandlerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added. (IdleTask.create(_:priority:)): (IdleTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added. (Packet.addTo(_:)): * APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added. (Scheduler.schedule): (Scheduler.add(_:)): (Scheduler.release(_:)): (holdCurrent): (waitCurrent): (queue(_:)): (handle(_:)): (queueImpl(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/Task.swift: Added. (Task.run(_:)): (Task.release): (Task.hold): (Task.wait): (Task.resume): (Task.takePacket): (Task.checkPriorityAdd(_:packet:)): * APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added. (WorkerTask.create(_:priority:queue:)): (WorkerTask.run(_:)): * APIBench/RichardsSwift/RichardsSwift/main.swift: Added. * APIBench/RichardsSwift/RichardsSwift/richards.swift: Added. (runRichards): * APIBench/api-bench: Added. Canonical link: https://commits.webkit.org/226562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 01:12:31 +00:00
run "$buildDirectory"
done
}
main "$@"