(fn: (term: GhosttyTerminal | XTerm) => Promise<void>)
| 50 | } |
| 51 | |
| 52 | const withTerminals = async (fn: (term: GhosttyTerminal | XTerm) => Promise<void>) => { |
| 53 | const ghostty = await Ghostty.load(); |
| 54 | bench('ghostty-web', async () => { |
| 55 | const container = document.createElement('div'); |
| 56 | document.body.appendChild(container); |
| 57 | const term = new GhosttyTerminal({ ghostty }); |
| 58 | await term.open(container); |
| 59 | await fn(term); |
| 60 | await term.dispose(); |
| 61 | }); |
| 62 | bench('xterm.js', async () => { |
| 63 | const xterm = new XTerm(); |
| 64 | const container = document.createElement('div'); |
| 65 | document.body.appendChild(container); |
| 66 | await xterm.open(container); |
| 67 | await fn(xterm); |
| 68 | await xterm.dispose(); |
| 69 | }); |
| 70 | }; |
| 71 | |
| 72 | const throughput = async (prefix: string, data: Record<string, Uint8Array | string>) => { |
| 73 | await Promise.all( |
no test coverage detected
searching dependent graphs…