Will Treesitter ever be stable on big files?

This page summarizes the projects mentioned and recommended in the original post on /r/neovim

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • neovim

    Vim-fork focused on extensibility and usability

    Injection tree is not incremental. This is a direct cause of 1, and is the biggest performance issue caused by TS in nvim now. The injection trees will be rebuilt and reparsed at every buffer change. Usually this will incredibly prolong the screen drawing time and block editing for a long time at every keystroke on large file, causing editor unusable.

  • nvim-treesitter

    Nvim Treesitter configurations and abstraction layer

    Bloated injection queries ships with nvim-treesitter. As a half-official TS support plugin in nvim, all-in-one also means bloating for normal users. See injection query for javascript in nvim-treesitter for example. Usually users are not in high demand of them in normal programming language (unlike markdown), but they will pay the extreme high performance cost for this feature.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

  • tree-sitter

    An incremental parsing system for programming tools

    The following discussion here. TS query cannot be incremental, that is why I regard it as design fault.

  • helix

    A post-modern modal text editor.

    True, However (as someone who doesn't have any experience with tree-sitter) the commits adding incremental injection parsing look quite obtruse: https://github.com/helix-editor/helix/compare/6728e44..4080341

  • syntect

    Rust library for syntax highlighting using Sublime Text syntax definitions.

    I wonder if a plugin integrating syntect would be possible.

  • tree-sitter-comment

    Tree-sitter grammar for comment tags like TODO, FIXME(user).

    you mean this one? https://github.com/stsewd/tree-sitter-comment

  • tracy

    Frame profiler

    I also found that using https://github.com/wolfpld/tracy with tree-sitter functions marked in Neovim that some individual queries and parse operation would have significant perf impact while other do not and that there are some parsers who tend to not really support incremental parsing but often need to throw away from cursor position until file end on certain character. We would need more infrastructure and built-in profiling to detect problems in certain languages earlier.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts