-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Simple benchmarking | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 1 | ||
matrix: | ||
luceeVersion: [ 5.4/snapshot/jar, 6.0/snapshot/jar, 6.1/snapshot/jar, 6.1.0/snapshot/jar, 6.2/snapshot/jar ] | ||
javaVersion: [ 11, 21 ] | ||
exclude: | ||
- luceeVersion: 5.4/snapshot/jar | ||
javaVersion: 21 | ||
- luceeVersion: 6.0/snapshot/jar | ||
javaVersion: 21 | ||
env: | ||
luceeVersionQuery: ${{ matrix.luceeVersion }} | ||
compile: ${{ github.event.inputs.compile }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK ${{matrix.javaVersion}} | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{matrix.javaVersion}} | ||
distribution: "temurin" | ||
- name: Cache Maven packages | ||
if: always() | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2 | ||
key: maven-cache | ||
- name: Cache Lucee files | ||
uses: actions/cache@v4 | ||
if: always() | ||
with: | ||
path: /home/runner/work/_actions/lucee/script-runner/main/lucee-download-cache | ||
key: lucee-downloads | ||
- name: Run Microbenches | ||
uses: lucee/script-runner@main | ||
with: | ||
webroot: ${{ github.workspace }}/custom/benchmark | ||
execute: /index.cfm | ||
luceeVersionQuery: ${{ matrix.luceeVersion }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
component { | ||
this.name="bench-runner"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<cfscript> | ||
runs = server.system.environment.BENCHMARK_CYCLES ?: 10000; | ||
arr = []; | ||
systemOutput("Running hello world [#runs#] times", true); | ||
ArraySet( arr, 1, runs, 0 ); | ||
s = getTickCount(); | ||
ArrayEach( function( item ){ | ||
InternalRequest( | ||
url: "/tests/hello-world.cfm" | ||
); | ||
}, true ); | ||
time = getTickCount()-s; | ||
function _logger( string message="", boolean throw=false ){ | ||
systemOutput( arguments.message, true ); | ||
if ( !FileExists( server.system.environment.GITHUB_STEP_SUMMARY ) ){ | ||
fileWrite( server.system.environment.GITHUB_STEP_SUMMARY, "#### #server.lucee.version# "); | ||
fileAppend( server.system.environment.GITHUB_STEP_SUMMARY, server.system.environment.toJson()); | ||
} | ||
if ( arguments.throw ) { | ||
fileAppend( server.system.environment.GITHUB_STEP_SUMMARY, "> [!WARNING]" & chr(10) ); | ||
fileAppend( server.system.environment.GITHUB_STEP_SUMMARY, "> #arguments.message##chr(10)#"); | ||
throw arguments.message; | ||
} else { | ||
fileAppend( server.system.environment.GITHUB_STEP_SUMMARY, " #arguments.message##chr(10)#"); | ||
} | ||
} | ||
_logger( "Running hello world [#runs#] times, took #numberFormat(time)# ms, or #numberFormat(runs/(time/1000))# per second" ); | ||
</cfscript> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
component { | ||
this.name="bench"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<cfheader name="Server" value="cfml-lucee"> | ||
<cfheader name="Content-Type" value="text/plain"> | ||
<cfcontent reset="true">Hello, World! |