1818import { BenchBackend , MeasuringStream , NullReadable } from "../backends.js" ;
1919import { runOpenTuiScenario } from "../frameworks/opentui.js" ;
2020import { computeStats , diffCpu , peakMemory , takeCpu , takeMemory , tryGc } from "../measure.js" ;
21+ import { emitReziPerfSnapshot , resetReziPerfSnapshot } from "../reziProfile.js" ;
2122import type {
2223 BenchMetrics ,
2324 Framework ,
@@ -35,7 +36,8 @@ import {
3536const TREE_SIZE = 50 ;
3637
3738async function runRezi ( config : ScenarioConfig ) : Promise < BenchMetrics > {
38- const { createApp } = await import ( "@rezi-ui/core" ) ;
39+ const core = await import ( "@rezi-ui/core" ) ;
40+ const { createApp } = core ;
3941
4042 const samples : number [ ] = [ ] ;
4143
@@ -51,6 +53,7 @@ async function runRezi(config: ScenarioConfig): Promise<BenchMetrics> {
5153 app . dispose ( ) ;
5254 }
5355
56+ resetReziPerfSnapshot ( core ) ;
5457 tryGc ( ) ;
5558 const memBefore = takeMemory ( ) ;
5659 const cpuBefore = takeCpu ( ) ;
@@ -83,7 +86,7 @@ async function runRezi(config: ScenarioConfig): Promise<BenchMetrics> {
8386 const memAfter = takeMemory ( ) ;
8487 memMax = peakMemory ( memMax , memAfter ) ;
8588
86- return {
89+ const metrics : BenchMetrics = {
8790 timing : computeStats ( samples ) ,
8891 memBefore,
8992 memAfter,
@@ -101,6 +104,8 @@ async function runRezi(config: ScenarioConfig): Promise<BenchMetrics> {
101104 bytesProduced : totalBytes ,
102105 ptyBytesObserved : null ,
103106 } ;
107+ emitReziPerfSnapshot ( core , "startup" , { } , config , metrics ) ;
108+ return metrics ;
104109}
105110
106111async function runInkCompat ( config : ScenarioConfig ) : Promise < BenchMetrics > {
@@ -313,7 +318,7 @@ async function runBlessed(config: ScenarioConfig): Promise<BenchMetrics> {
313318 const samples : number [ ] = [ ] ;
314319
315320 for ( let w = 0 ; w < config . warmup ; w ++ ) {
316- const ctx = createBlessedContext ( 120 , 60 ) ;
321+ const ctx = createBlessedContext ( 120 , 40 ) ;
317322 buildBlessedTree ( ctx . blessed , ctx . screen , TREE_SIZE , w ) ;
318323 ctx . screen . render ( ) ;
319324 ctx . flush ( ) ;
@@ -328,7 +333,7 @@ async function runBlessed(config: ScenarioConfig): Promise<BenchMetrics> {
328333 let totalBytes = 0 ;
329334
330335 for ( let i = 0 ; i < config . iterations ; i ++ ) {
331- const ctx = createBlessedContext ( 120 , 60 ) ;
336+ const ctx = createBlessedContext ( 120 , 40 ) ;
332337
333338 const ts = performance . now ( ) ;
334339 buildBlessedTree ( ctx . blessed , ctx . screen , TREE_SIZE , i ) ;
0 commit comments