Kortex: A Kotlin Multiplatform Code Editor Engine Built on Skia for Large Files
The author argues that Jetpack Compose's BasicTextField struggles with large documents, since per-line composables, repeated AnnotatedString creation, and hot-path allocations cause garbage collection pauses and dropped frames. To address this, they built Kortex, an open-source, hardware-accelerated code and text editor engine for Kotlin Multiplatform targeting Desktop, Android, iOS, and WebAssembly. Kortex renders the entire editor viewport as a single surface by dropping down to Skia via Skiko, using a platform-specific SkiaCanvas abstraction. Rendering is organized into ordered layers for backgrounds, gutters, selections, syntax-highlighted text, diagnostics, and carets, all drawn in one GPU pass. The text buffer is powered by Krope, a thread-safe persistent Red-Black Rope structure that supports O(log N) edits with structural sharing.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in