Skip to content

Commit 34a1ead

Browse files
committed
ye
1 parent 4d61c0c commit 34a1ead

1 file changed

Lines changed: 47 additions & 50 deletions

File tree

bench/Run.server.luau

Lines changed: 47 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ end
194194
local player = getPlayer()
195195
Scenarios.Ready:wait()
196196

197-
-- Capture helper: wraps a test with startCapture/stopCapture
197+
-- Capture toggle
198+
local CAPTURE_ENABLED = false
198199
local CAPTURE_FRAMES = 5
199200
local CAPTURE_FIRES = 100 -- keep frames under MAX_INCOMING (65536 bytes)
200201

@@ -209,58 +210,54 @@ local function captureTest(label: string, packet: any, getData: () -> any, targe
209210
Lync.stopCapture()
210211
end
211212

212-
-- Section 1: Lync-specific benchmarks
213+
-- Full benchmarks
213214
print(`\n Lync Bench {FIRES_PER_FRAME}/frame {DURATION}s per test\n`)
214215

215-
-- Capture a few frames of each test before the full run
216-
captureTest("Static booleans", Scenarios.Booleans, function(): any
217-
return true
218-
end, player)
219-
220-
captureTest("Static entities", Scenarios.Entities, function(): any
221-
return Scenarios.STATIC_ENTITY
222-
end, player)
223-
224-
local capFrame = 0
225-
captureTest("Moving entities", Scenarios.Entities, function(): any
226-
capFrame += 1
227-
return {
228-
position = Vector3.new(100.5 + capFrame * 0.1, 50.25, -200.75 + capFrame * 0.05),
229-
velocity = Vector3.new(10.1, 0, -5.3),
230-
health = 87.5,
231-
shield = 42.0,
232-
alive = true,
233-
team = 2,
234-
}
235-
end, player)
236-
237-
local captureRandom = Random.new(42)
238-
captureTest("Chaotic entities", Scenarios.Entities, function(): any
239-
return {
240-
position = Vector3.new(
241-
captureRandom:NextNumber(-500, 500),
242-
captureRandom:NextNumber(0, 200),
243-
captureRandom:NextNumber(-500, 500)
244-
),
245-
velocity = Vector3.new(
246-
captureRandom:NextNumber(-50, 50),
247-
captureRandom:NextNumber(-10, 10),
248-
captureRandom:NextNumber(-50, 50)
249-
),
250-
health = captureRandom:NextNumber(0, 100),
251-
shield = captureRandom:NextNumber(0, 100),
252-
alive = captureRandom:NextNumber(0, 1) > 0.5,
253-
team = captureRandom:NextInteger(1, 4),
254-
}
255-
end, player)
256-
257-
-- Blink tests skipped from capture: 1000 fires produce ~600KB frames
258-
-- which exceed MAX_INCOMING (65536) on the client and break XOR chain.
259-
260-
Lync.dumpCaptures()
261-
print(" [Capture saved to ServerStorage.LyncCapture]\n")
216+
if CAPTURE_ENABLED then
217+
captureTest("Static booleans", Scenarios.Booleans, function(): any
218+
return true
219+
end, player)
262220

263-
-- Full benchmarks
221+
captureTest("Static entities", Scenarios.Entities, function(): any
222+
return Scenarios.STATIC_ENTITY
223+
end, player)
224+
225+
local capFrame = 0
226+
captureTest("Moving entities", Scenarios.Entities, function(): any
227+
capFrame += 1
228+
return {
229+
position = Vector3.new(100.5 + capFrame * 0.1, 50.25, -200.75 + capFrame * 0.05),
230+
velocity = Vector3.new(10.1, 0, -5.3),
231+
health = 87.5,
232+
shield = 42.0,
233+
alive = true,
234+
team = 2,
235+
}
236+
end, player)
237+
238+
local captureRandom = Random.new(42)
239+
captureTest("Chaotic entities", Scenarios.Entities, function(): any
240+
return {
241+
position = Vector3.new(
242+
captureRandom:NextNumber(-500, 500),
243+
captureRandom:NextNumber(0, 200),
244+
captureRandom:NextNumber(-500, 500)
245+
),
246+
velocity = Vector3.new(
247+
captureRandom:NextNumber(-50, 50),
248+
captureRandom:NextNumber(-10, 10),
249+
captureRandom:NextNumber(-50, 50)
250+
),
251+
health = captureRandom:NextNumber(0, 100),
252+
shield = captureRandom:NextNumber(0, 100),
253+
alive = captureRandom:NextNumber(0, 1) > 0.5,
254+
team = captureRandom:NextInteger(1, 4),
255+
}
256+
end, player)
257+
258+
Lync.dumpCaptures()
259+
print(" [Capture saved to ServerStorage.LyncCapture]\n")
260+
end
264261
runTest({
265262
name = "Static booleans",
266263
player = player,

0 commit comments

Comments
 (0)