Commit Graph
38 Commits
Author SHA1 Message Date
Cursor AgentandDaniel Imms f22ef02831 Move primitives and runtime out of src/common/
Relocate src/common/primitives and src/common/runtime to src/primitives
and src/runtime. Add src/tsconfig.json as the primitives+runtime solution.
Update tsconfigs, esbuild, webpack aliases, publish path, and docs.

Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
2026-05-31 00:30:53 +00:00
Cursor AgentandDaniel Imms c569e5ab19 Full common split: composite tsconfigs and target-* modules
- Add composite TypeScript projects for common/primitives and common/runtime
- Decouple primitives from runtime (buffer service interfaces, UnicodeProperties, CellTypes, etc.)
- Move Types.ts to runtime; re-export primitive types from runtime/Types
- Rename src/browser -> src/target-browser, src/headless -> src/target-headless
- Update import paths (target-browser/*, target-headless/*) across repo
- Fix esbuild outbase so common/* and target-* resolve under out-esbuild/
- Point unicode addons at primitives for UnicodeTypes/UnicodeProperties
- Update ARCHITECTURE.md and AGENTS.md

Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
2026-05-31 00:19:43 +00:00
Cursor AgentandDaniel Imms 9a65429a30 Split common into primitives and runtime layers
Reorganize src/common per issue #5963: move building blocks under
primitives/ and services/integration under runtime/. Preserve existing
common/* import paths via TypeScript path mapping. Add src/ARCHITECTURE.md
documenting modules and goals.

Fix two relative imports broken by the directory depth change.

Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
2026-05-30 23:47:30 +00:00
Daniel Imms acd2472961 Merge remote-tracking branch 'upstream/master' into package_upgrades 2026-05-27 19:23:43 -07:00
Daniel ImmsandCursor f484584b70 Speed up decoration cell lookup with a per-line index
Refs #5176.

forEachDecorationAtCell and getDecorationsAtCell previously scanned every
registered decoration on each call. With thousands of search highlights this
becomes O(total decorations) per cell and blocks rendering during viewport
refreshes.

Maintain a Map of buffer line -> decorations that cover that line. Multi-line
decorations are indexed on every line in their span, so mixed single-line and
multi-line workloads stay fast without falling back to a full scan.

Keep the index aligned with buffer mutations:
- Register and unregister decorations in the line buckets on add/dispose.
- On trim, shift line keys synchronously (before marker handlers run).
- On insert/delete, re-index affected decorations in a microtask after marker
  line updates are applied.

Inject IBufferService so line listeners follow the active buffer. Add unit
tests for trim, dispose-on-trim, insert, and dense single-line plus multi-line
lookup. Add DecorationService.benchmark.ts to measure sparse hits and
viewport-sized grid scans with 20k decorations.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-26 09:30:25 -07:00
Jörg Breitbart dc1ae4514b package upgrades & linter fixes 2026-05-09 17:42:49 +02:00
Jörg Breitbart b7e535e2ec APC perf test 2026-04-24 17:09:37 +02:00
Jörg Breitbart 22778b5b49 fix utf8 terminal benchmark 2026-04-24 09:15:26 +02:00
Daniel Imms eccbc60aa0 Migrate to tsgo
Fixes #5689
2026-02-13 06:59:24 -08:00
Daniel Imms 431d511c95 Fix benchmark usage, add instructions 2026-01-31 15:28:11 -08:00
Daniel Imms 042bb4bed9 Optimize Emitter.fire for 0 and 1 listeners
Before:
      Context "Emitter.fire()"
         Context "0 listeners"
            Case "#1" : 1 runs - average throughput: 97.77 MB/s
         Context "1 listener"
            Case "#1" : 1 runs - average throughput: 49.30 MB/s
         Context "2 listeners"
            Case "#1" : 1 runs - average throughput: 35.37 MB/s
         Context "5 listeners"
            Case "#1" : 1 runs - average throughput: 15.32 MB/s

After:
      Context "Emitter.fire()"
         Context "0 listeners"
            Case "#1" : 1 runs - average throughput: 376.94 MB/s
         Context "1 listener"
            Case "#1" : 1 runs - average throughput: 84.29 MB/s
         Context "2 listeners"
            Case "#1" : 1 runs - average throughput: 32.36 MB/s
         Context "5 listeners"
            Case "#1" : 1 runs - average throughput: 15.93 MB/s
2026-01-31 14:42:23 -08:00
Daniel Imms 1f11c7e46c Get sources building with esbuild 2024-07-05 08:46:15 -07:00
Daniel Imms f6c4aee928 Move benchmarks off removed node-pty apis 2023-10-02 11:05:33 -07:00
Daniel Imms ceef536b79 Upgrade es6 -> es2021
This uses the recommended target for node 16 in tsconfig/bases.

Fixes #4706
2023-09-01 07:36:48 -07:00
Simon Lamon d7d85870d2 remove headless include in benchmark projects 2021-11-20 17:33:38 +00:00
Daniel Imms d8899b0b5d Fix eslint errors in test/benchmark 2021-08-12 12:59:22 -07:00
Jörg Breitbart cc005a274d multiple changes:
- reorder exception throwing to be sync to band position
- document WriteBuffer._innerWrite
- remove any declarations
- remove conditional assigments
- use faster return value branching in all parsers
- remove dead code in benchmark
2021-02-27 20:18:41 +01:00
Jörg Breitbart 0ad9f70645 Merge branch 'master' into async_handlers 2021-01-22 17:49:31 +01:00
Jörg Breitbart 3f659a15da minor fixes:
- better perf for short DCS without params (8 times faster)
- test perf for class and string based interfaces of OSC and DCS
  separately
- undo wrong commit on parser
2021-01-21 15:58:03 +01:00
Jörg Breitbart c50c134e25 simplify parser handler interface:
- remove setHandler
- apply boolean return to ESC|CSI|OSC|DCS handlers
  (rewrite empty return defaulting to true)
- rename addHandler to registerHandler
2021-01-20 23:03:55 +01:00
Jörg Breitbart bc1048062d early version of async support for CSI and ESC handlers 2021-01-20 20:05:14 +01:00
Daniel Imms bdb438972f Fix errors in Terminal and elsewhere
This was mostly ! to compel TS, we should actually fix this down the road
but that can come later.
2020-04-26 10:44:44 -07:00
Daniel Imms d085768e8b Fix some lint issues 2020-04-26 08:23:38 -07:00
Daniel Imms 88a50d3779 Fix most rules 2020-03-28 06:51:36 -07:00
Daniel Imms 51a564eb9c Remove links to serialize from test/benchmark 2020-02-04 07:45:12 -08:00
javacs3 a4efefbf5e refactor: serialize-addon, move SerializeAddon.benchmark.ts into addons/xterm-addon-serialize and add README.md 2019-12-31 22:06:19 +08:00
javacs3 903d75e6d3 Refactor
1. add 8 secs timeout for SerializeAddon API test
2. move demo page's addons control panel into a single div
3. remove unnecessary config in demo page
4. remove v8-profiler-node8 dependency
5. remove duplicate css option
2019-11-28 22:22:04 +08:00
Daniel Imms 6dda0c2b97 Merge branch 'feat/serialize-addon' into pr/JavaCS3/2369 2019-11-24 10:05:14 -08:00
javacs3 e2df7dc96c add benchmark for serialize addon 2019-11-21 20:41:48 +08:00
Jörg Breitbart c2ec16a16c encapsulate deferred writing in WriteBuffer class 2019-09-13 16:31:28 +02:00
Jörg Breitbart fe74b5588d use write callback in benchmark test 2019-09-13 13:11:23 +02:00
Jörg Breitbart 75ba717bd7 merge write methods, optional callback 2019-09-12 13:36:58 +02:00
Jörg Breitbart 1286eb618a rename to OscHandler and DcsHandler 2019-08-08 19:41:12 +02:00
Jörg Breitbart 812fc5e6ec register functions by prefix/intermediate/final bytes 2019-07-31 04:49:01 +02:00
Jörg Breitbart f626e1c93d fix OSC parsing 2019-07-25 20:38:14 +02:00
Jörg Breitbart 63a4e8ffde Merge branch 'master' into parser_colon_notation 2019-06-25 16:07:50 +02:00
Jörg Breitbart 1dc4e36972 fix CSI bug, cleanup test 2019-06-19 00:42:20 +02:00
Jörg Breitbart a28761bf3e restructured test folder 2019-06-19 00:07:09 +02:00