Skip to content

Commit e018c65

Browse files
committed
fix(perf-harness): fix routing, URL patterns, and Application.cfc bootstrap
- Fix measureAppBootstrap reinit URL: use & not ? to append bsReinit=1 param - Switch all 5 SCENARIOS from SES URLs to event-style ?event= URLs for reliability - Fix health handler: use event.renderData() instead of return "ok" to bypass layout - Add pathInfoProvider to Router.cfc for Tuckey forward URI extraction - Fix Application.cfc pseudo-constructor: remove var keyword (BoxLang incompatible outside functions) - Change COLDBOX_CONFIG_FILE to dot-notation path (cbperfapp.config.ColdBox) not filesystem path - Add index.cfm entry points for both be-app and stable-app sub-directories - Add Tuckey urlrewrite.xml to forward sub-path requests to correct index.cfm - Add perf-specific server configs for all 4 engines with correct webroot (../../) - Add .gitignore for stable-app/coldbox/ (box install artifact, not tracked) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A9URDbRHAkreUvNUjFdmfG
1 parent 8743020 commit e018c65

13 files changed

Lines changed: 185 additions & 29 deletions

tests/perf-harness/PerformanceSuite.cfc

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,29 @@ component {
3131
variables.ENGINES = {
3232
"boxlang" : {
3333
name : "BoxLang",
34-
serverConfig : variables.REPO_ROOT & "server-boxlang@1.json",
35-
serverName : "coldbox-boxlang",
34+
serverConfig : variables.TASK_DIR & "server-perf-boxlang.json",
35+
serverName : "coldbox-perf-boxlang",
3636
cacheDir : variables.REPO_ROOT & ".engine/boxlang/",
3737
cacheDirs : [ ".boxlang/classes", "home" ]
3838
},
3939
"boxlang-cfml" : {
4040
name : "BoxLang CFML",
41-
serverConfig : variables.REPO_ROOT & "server-boxlang-cfml@1.json",
42-
serverName : "coldbox-boxlang-cfml-1",
41+
serverConfig : variables.TASK_DIR & "server-perf-boxlang-cfml.json",
42+
serverName : "coldbox-perf-boxlang-cfml",
4343
cacheDir : variables.REPO_ROOT & ".engine/boxlang-cfml-1/",
4444
cacheDirs : [ ".boxlang/classes", "home" ]
4545
},
4646
"adobe-2025" : {
4747
name : "Adobe CF 2025",
48-
serverConfig : variables.REPO_ROOT & "server-adobe@2025.json",
49-
serverName : "coldbox-adobe@2025",
48+
serverConfig : variables.TASK_DIR & "server-perf-adobe2025.json",
49+
serverName : "coldbox-perf-adobe2025",
5050
cacheDir : variables.REPO_ROOT & ".engine/adobe2025/",
5151
cacheDirs : [ "WEB-INF/cfclasses" ]
5252
},
5353
"lucee-7" : {
5454
name : "Lucee 7",
55-
serverConfig : variables.REPO_ROOT & "server-lucee@7.json",
56-
serverName : "coldbox-lucee@7",
55+
serverConfig : variables.TASK_DIR & "server-perf-lucee7.json",
56+
serverName : "coldbox-perf-lucee7",
5757
cacheDir : variables.REPO_ROOT & ".engine/lucee7/",
5858
cacheDirs : [ "WEB-INF/lucee/web/cfclasses", "WEB-INF/lucee/web/tmp" ]
5959
}
@@ -63,37 +63,37 @@ component {
6363
{
6464
id : "health",
6565
name : "Health Check",
66-
description : "Routing only — no DI, no view rendering",
67-
bePath : "/tests/perf-harness/be-app/perf/health",
68-
stablePath : "/tests/perf-harness/stable-app/perf/health"
66+
description : "Minimal ColdBox lifecycle — no DI, no view, text response",
67+
bePath : "/tests/perf-harness/be-app/index.cfm?event=Main.health",
68+
stablePath : "/tests/perf-harness/stable-app/index.cfm?event=Main.health"
6969
},
7070
{
7171
id : "view",
7272
name : "Simple View",
7373
description : "View rendering + layout pipeline",
74-
bePath : "/tests/perf-harness/be-app/perf/view",
75-
stablePath : "/tests/perf-harness/stable-app/perf/view"
74+
bePath : "/tests/perf-harness/be-app/index.cfm?event=Main.index",
75+
stablePath : "/tests/perf-harness/stable-app/index.cfm?event=Main.index"
7676
},
7777
{
7878
id : "api",
7979
name : "JSON API",
8080
description : "WireBox DI + JSON serialization via renderData",
81-
bePath : "/tests/perf-harness/be-app/perf/api",
82-
stablePath : "/tests/perf-harness/stable-app/perf/api"
81+
bePath : "/tests/perf-harness/be-app/index.cfm?event=Api.list",
82+
stablePath : "/tests/perf-harness/stable-app/index.cfm?event=Api.list"
8383
},
8484
{
8585
id : "complex",
8686
name : "Complex View",
8787
description : "Multiple model injections + view with data loops",
88-
bePath : "/tests/perf-harness/be-app/perf/complex",
89-
stablePath : "/tests/perf-harness/stable-app/perf/complex"
88+
bePath : "/tests/perf-harness/be-app/index.cfm?event=Main.complex",
89+
stablePath : "/tests/perf-harness/stable-app/index.cfm?event=Main.complex"
9090
},
9191
{
9292
id : "module",
9393
name : "Module Request",
9494
description : "Full HMVC module routing + module-scoped DI",
95-
bePath : "/tests/perf-harness/be-app/perf/module",
96-
stablePath : "/tests/perf-harness/stable-app/perf/module"
95+
bePath : "/tests/perf-harness/be-app/index.cfm?event=perf-module%3AItems.index",
96+
stablePath : "/tests/perf-harness/stable-app/index.cfm?event=perf-module%3AItems.index"
9797
}
9898
]
9999

@@ -373,7 +373,7 @@ component {
373373

374374
private struct function measureAppBootstrap( required string version ){
375375
var healthPath = ( arguments.version == "be" ) ? variables.SCENARIOS[ 1 ].bePath : variables.SCENARIOS[ 1 ].stablePath
376-
var reinitUrl = variables.BASE_URL & healthPath & "?bsReinit=1"
376+
var reinitUrl = variables.BASE_URL & healthPath & "&bsReinit=1"
377377
var healthUrl = variables.BASE_URL & healthPath
378378

379379
// Trigger ColdBox re-initialization

tests/perf-harness/app/config/Router.cfc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33
*/
44
component {
55

6+
/**
7+
* ColdBox hook: called by RoutingService instead of reading CGI.PATH_INFO.
8+
* When the Tuckey URL rewriter does a forward(), the original request URI
9+
* is in the javax.servlet.forward.request_uri attribute; CGI.PATH_INFO is empty.
10+
* This provider extracts the original path and strips the app sub-path prefix.
11+
*/
12+
function pathInfoProvider( event ){
13+
var forwardURI = getPageContext().getRequest().getAttribute( "javax.servlet.forward.request_uri" )
14+
if ( !isNull( forwardURI ) && len( forwardURI ) ) {
15+
return reReplaceNoCase( forwardURI, "^/tests/perf-harness/(be-app|stable-app)", "" )
16+
}
17+
return CGI.PATH_INFO
18+
}
19+
620
function configure(){
721
// Health check — minimal response, no DI, no view
822
route( "/perf/health" ).to( "Main.health" )

tests/perf-harness/app/handlers/Main.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ component extends="coldbox.system.EventHandler" {
88

99
// Baseline — no DI usage, no view, minimal processing
1010
function health( event, rc, prc ){
11-
return "ok"
11+
event.renderData( type="text", data="ok", statusCode=200 )
1212
}
1313

1414
// Simple view — renders main/index with layout

tests/perf-harness/be-app/Application.cfc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ component {
1717
// beAppPath = /…/tests/perf-harness/be-app/
1818
// repoRoot = /…/coldbox-platform/
1919
// sharedApp = /…/tests/perf-harness/app/
20-
var beAppPath = getDirectoryFromPath( getCurrentTemplatePath() )
21-
var repoRoot = reReplaceNoCase( beAppPath, "tests[/\\]perf-harness[/\\]be-app[/\\]", "" )
22-
var sharedApp = repoRoot & "tests/perf-harness/app/"
20+
beAppPath = getDirectoryFromPath( getCurrentTemplatePath() )
21+
repoRoot = reReplaceNoCase( beAppPath, "tests[/\\]perf-harness[/\\]be-app[/\\]", "" )
22+
sharedApp = repoRoot & "tests/perf-harness/app/"
2323

2424
// ─── CF Mappings ──────────────────────────────────────────────────────────
2525
// /coldbox → bleeding edge framework (repo root)
@@ -29,7 +29,7 @@ component {
2929

3030
// ─── ColdBox bootstrap settings ───────────────────────────────────────────
3131
COLDBOX_APP_ROOT_PATH = sharedApp
32-
COLDBOX_CONFIG_FILE = sharedApp & "config/ColdBox.cfc"
32+
COLDBOX_CONFIG_FILE = "cbperfapp.config.ColdBox"
3333
COLDBOX_APP_KEY = "cbperf_be"
3434
COLDBOX_APP_MAPPING = "cbperfapp"
3535
COLDBOX_WEB_MAPPING = "tests/perf-harness/be-app"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<cfsetting enablecfoutputonly="true">
2+
<cfsetting showdebugoutput="false">
3+
<cfscript>
4+
_forwardURI = getPageContext().getRequest().getAttribute( "javax.servlet.forward.request_uri" )
5+
if ( !isNull( _forwardURI ) && len( _forwardURI ) ) {
6+
CGI.PATH_INFO = reReplaceNoCase( _forwardURI, "^/tests/perf-harness/be-app", "" )
7+
}
8+
</cfscript>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"app": {
3+
"cfengine": "adobe@2025",
4+
"serverHomeDirectory": "../../.engine/adobe2025"
5+
},
6+
"name": "coldbox-perf-adobe2025",
7+
"force": true,
8+
"openBrowser": false,
9+
"web": {
10+
"webroot": "../../",
11+
"directoryBrowsing": true,
12+
"http": { "port": "8599" },
13+
"rewrites": { "enable": true },
14+
"aliases": { "/coldbox": "../../" }
15+
},
16+
"JVM": {
17+
"heapSize": "1024",
18+
"javaHome": "/usr/lib/jvm/java-21-openjdk-amd64"
19+
},
20+
"cfconfig": { "file": "../../.cfconfig.json" },
21+
"scripts": {
22+
"onServerInstall": "cfpm install caching,zip,orm,mysql,postgresql --noSave"
23+
}
24+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"app":{
3+
"cfengine":"boxlang@1",
4+
"serverHomeDirectory":"../../.engine/boxlang-cfml-1"
5+
},
6+
"name":"coldbox-perf-boxlang-cfml",
7+
"force":true,
8+
"openBrowser":false,
9+
"web":{
10+
"webroot":"../../",
11+
"directoryBrowsing":true,
12+
"http":{
13+
"port":"8599"
14+
},
15+
"rewrites":{
16+
"enable":true,
17+
"config":"urlrewrite.xml"
18+
},
19+
"aliases":{
20+
"/coldbox":"../../"
21+
}
22+
},
23+
"JVM":{
24+
"heapSize":"1024",
25+
"javaHome":"/usr/lib/jvm/java-21-openjdk-amd64"
26+
},
27+
"cfconfig":{
28+
"file":"../../.cfconfig.json"
29+
},
30+
"env":{
31+
"BOXLANG_DEBUG":false
32+
},
33+
"scripts":{
34+
"onServerInitialInstall":"install bx-compat-cfml --noSave"
35+
}
36+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"app": {
3+
"cfengine": "boxlang@1",
4+
"serverHomeDirectory": "../../.engine/boxlang"
5+
},
6+
"name": "coldbox-perf-boxlang",
7+
"force": true,
8+
"openBrowser": false,
9+
"web": {
10+
"webroot": "../../",
11+
"directoryBrowsing": true,
12+
"http": { "port": "8599" },
13+
"rewrites": { "enable": true },
14+
"aliases": { "/coldbox": "../../" }
15+
},
16+
"JVM": {
17+
"heapSize": "1024",
18+
"javaHome": "/usr/lib/jvm/java-21-openjdk-amd64"
19+
},
20+
"cfconfig": { "file": "../../.cfconfig.json" },
21+
"env": { "BOXLANG_DEBUG": false }
22+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"app": {
3+
"cfengine": "lucee@7",
4+
"serverHomeDirectory": "../../.engine/lucee7"
5+
},
6+
"name": "coldbox-perf-lucee7",
7+
"force": true,
8+
"openBrowser": false,
9+
"web": {
10+
"webroot": "../../",
11+
"directoryBrowsing": true,
12+
"http": { "port": "8599" },
13+
"rewrites": { "enable": true },
14+
"aliases": { "/coldbox": "../../" }
15+
},
16+
"JVM": {
17+
"heapSize": "1024",
18+
"javaHome": "/usr/lib/jvm/java-21-openjdk-amd64"
19+
},
20+
"cfconfig": { "file": "../../.cfconfig.json" }
21+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
coldbox/

0 commit comments

Comments
 (0)