Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Conversation

@dcreager
Copy link
Contributor

We're using the mlua crate, since it seems most actively maintained and performant.

@github-actions
Copy link

Performance Summary

Comparing base 3696992 with head bc424cd on typescript_benchmark benchmark. For details see workflow artifacts. Note that performance is tested on the last commits with changes in stack-graphs, not on every commit.

Before
--------------------------------------------------------------------------------
Command:            base/target/release/tree-sitter-stack-graphs-typescript index -D base.sqlite --max-file-time=30 --hide-error-details -- base/data/typescript_benchmark
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 base-perf-results/perf.out
--------------------------------------------------------------------------------


    GB
3.276^                                                                     :# 
     |                                                                     :# 
     |                                                                     :# 
     |                                                                     :#:
     |                                                                     :#:
     |                                                                     :#:
     |                                             :::@                : :::#:
     |                                             :  @                :@: :#:
     |                                        ::@@@:  @               ::@: :#:
     |                                        : @  :  @               ::@: :#:
     |                                 @@   ::: @  :  @         :@   :::@: :#:
     |              : :::@     :     @:@ : @::: @  :  @       :::@::::::@: :#:
   0 +----------------------------------------------------------------------->Gi
     0                                                                   75.09
After
--------------------------------------------------------------------------------
Command:            head/target/release/tree-sitter-stack-graphs-typescript index -D head.sqlite --max-file-time=30 --hide-error-details -- head/data/typescript_benchmark
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 head-perf-results/perf.out
--------------------------------------------------------------------------------


    GB
3.276^                                                                     :# 
     |                                                                     :# 
     |                                                                     :# 
     |                                                                     :#:
     |                                                                     :#:
     |                                                                     :#:
     |                                             :::@                 ::::#:
     |                                             :  @                 :: :#:
     |                                        ::@@@:  @               @ :: :#:
     |                                        : @  :  @               @::: :#:
     |                                @:@   ::: @  :  @         @:   :@::: :#:
     |              : :::@     :    ::@:@:::::: @  :  @       ::@:::::@::: :#:
   0 +----------------------------------------------------------------------->Gi
     0                                                                   74.99

@github-actions
Copy link

Performance Summary

Comparing base 3696992 with head 9a18451 on typescript_benchmark benchmark. For details see workflow artifacts. Note that performance is tested on the last commits with changes in stack-graphs, not on every commit.

Before
--------------------------------------------------------------------------------
Command:            base/target/release/tree-sitter-stack-graphs-typescript index -D base.sqlite --max-file-time=30 --hide-error-details -- base/data/typescript_benchmark
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 base-perf-results/perf.out
--------------------------------------------------------------------------------


    GB
3.276^                                                                     :# 
     |                                                                     :# 
     |                                                                     :# 
     |                                                                     :#:
     |                                                                     :#:
     |                                                                     :#:
     |                                             :::@                : :::#:
     |                                             :  @                :@: :#:
     |                                        ::@@@:  @               ::@: :#:
     |                                        : @  :  @               ::@: :#:
     |                                 @@   ::: @  :  @         :@   :::@: :#:
     |              : :::@     :     @:@ : @::: @  :  @       :::@::::::@: :#:
   0 +----------------------------------------------------------------------->Gi
     0                                                                   75.09
After
--------------------------------------------------------------------------------
Command:            head/target/release/tree-sitter-stack-graphs-typescript index -D head.sqlite --max-file-time=30 --hide-error-details -- head/data/typescript_benchmark
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 head-perf-results/perf.out
--------------------------------------------------------------------------------


    GB
3.276^                                                                     :# 
     |                                                                     :# 
     |                                                                     :# 
     |                                                                     :#:
     |                                                                     :#:
     |                                                                     :#:
     |                                             :::@                : :::#:
     |                                             :  @                :@: :#:
     |                                        ::@@@:  @               ::@: :#:
     |                                        : @  :  @               ::@: :#:
     |                                @@    ::: @  :  @         :@   :::@: :#:
     |              :::::@     :     :@@:::@::: @  :  @       :::@::::::@: :#:
   0 +----------------------------------------------------------------------->Gi
     0                                                                   75.10

@github-actions
Copy link

Performance Summary

Comparing base 3696992 with head 5a22bf7 on typescript_benchmark benchmark. For details see workflow artifacts. Note that performance is tested on the last commits with changes in stack-graphs, not on every commit.

Before
--------------------------------------------------------------------------------
Command:            base/target/release/tree-sitter-stack-graphs-typescript index -D base.sqlite --max-file-time=30 --hide-error-details -- base/data/typescript_benchmark
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 base-perf-results/perf.out
--------------------------------------------------------------------------------


    GB
3.276^                                                                     :# 
     |                                                                     :# 
     |                                                                     :# 
     |                                                                     :#:
     |                                                                     :#:
     |                                                                     :#:
     |                                             :::@                : :::#:
     |                                             :  @                :@: :#:
     |                                        ::@@@:  @               ::@: :#:
     |                                        : @  :  @               ::@: :#:
     |                                 @@   ::: @  :  @         :@   :::@: :#:
     |              : :::@     :     @:@ : @::: @  :  @       :::@::::::@: :#:
   0 +----------------------------------------------------------------------->Gi
     0                                                                   75.09
After
--------------------------------------------------------------------------------
Command:            head/target/release/tree-sitter-stack-graphs-typescript index -D head.sqlite --max-file-time=30 --hide-error-details -- head/data/typescript_benchmark
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 head-perf-results/perf.out
--------------------------------------------------------------------------------


    GB
3.276^                                                                   ###  
     |                                                                   #    
     |                                                                   #   :
     |                                                                   #  ::
     |                                                                   #  ::
     |                                                                   #  ::
     |                                           :::@                ::::#  ::
     |                                           :  @                ::  #  ::
     |                                      :::@@:  @              ::::  #  ::
     |                                      : :@ :  @              : ::  #  ::
     |                               @@   ::: :@ :  @        @::   : ::  #  ::
     |             :  ::@     :    ::@@:::::: :@ :  @       :@:::::: ::  #  ::
   0 +----------------------------------------------------------------------->Gi
     0                                                                   78.06

@github-actions
Copy link

Performance Summary

Comparing base 3696992 with head 58a0ca0 on typescript_benchmark benchmark. For details see workflow artifacts. Note that performance is tested on the last commits with changes in stack-graphs, not on every commit.

Before
--------------------------------------------------------------------------------
Command:            base/target/release/tree-sitter-stack-graphs-typescript index -D base.sqlite --max-file-time=30 --hide-error-details -- base/data/typescript_benchmark
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 base-perf-results/perf.out
--------------------------------------------------------------------------------


    GB
3.276^                                                                     :# 
     |                                                                     :# 
     |                                                                     :# 
     |                                                                     :#:
     |                                                                     :#:
     |                                                                     :#:
     |                                             :::@                : :::#:
     |                                             :  @                :@: :#:
     |                                        ::@@@:  @               ::@: :#:
     |                                        : @  :  @               ::@: :#:
     |                                 @@   ::: @  :  @         :@   :::@: :#:
     |              : :::@     :     @:@ : @::: @  :  @       :::@::::::@: :#:
   0 +----------------------------------------------------------------------->Gi
     0                                                                   75.09
After
--------------------------------------------------------------------------------
Command:            head/target/release/tree-sitter-stack-graphs-typescript index -D head.sqlite --max-file-time=30 --hide-error-details -- head/data/typescript_benchmark
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 head-perf-results/perf.out
--------------------------------------------------------------------------------


    GB
3.276^                                                                     :# 
     |                                                                     :# 
     |                                                                     :# 
     |                                                                     :#:
     |                                                                     :#:
     |                                                                     :#:
     |                                                                 :@:::#:
     |                                               @                 :@: :#:
     |                                         :::@@@@                 :@: :#:
     |                                         :  @  @                ::@: :#:
     |                                   @   :::  @  @         @::  :@::@: :#:
     |              : ::::@     :      @:@::@:::  @  @       ::@:::::@::@: :#:
   0 +----------------------------------------------------------------------->Gi
     0                                                                   71.62

@github-actions
Copy link

Performance Summary

Comparing base 3696992 with head 5fcd36b on typescript_benchmark benchmark. For details see workflow artifacts. Note that performance is tested on the last commits with changes in stack-graphs, not on every commit.

Before
--------------------------------------------------------------------------------
Command:            base/target/release/tree-sitter-stack-graphs-typescript index -D base.sqlite --max-file-time=30 --hide-error-details -- base/data/typescript_benchmark
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 base-perf-results/perf.out
--------------------------------------------------------------------------------


    GB
3.276^                                                                     :# 
     |                                                                     :# 
     |                                                                     :# 
     |                                                                     :#:
     |                                                                     :#:
     |                                                                     :#:
     |                                             :::@                : :::#:
     |                                             :  @                :@: :#:
     |                                        ::@@@:  @               ::@: :#:
     |                                        : @  :  @               ::@: :#:
     |                                 @@   ::: @  :  @         :@   :::@: :#:
     |              : :::@     :     @:@ : @::: @  :  @       :::@::::::@: :#:
   0 +----------------------------------------------------------------------->Gi
     0                                                                   75.09
After
--------------------------------------------------------------------------------
Command:            head/target/release/tree-sitter-stack-graphs-typescript index -D head.sqlite --max-file-time=30 --hide-error-details -- head/data/typescript_benchmark
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 head-perf-results/perf.out
--------------------------------------------------------------------------------


    GB
3.276^                                                                     :# 
     |                                                                     :# 
     |                                                                     :# 
     |                                                                     :#:
     |                                                                     :#:
     |                                                                     :#:
     |                                                                 @@:::#:
     |                                               @                 @@: :#:
     |                                         :::@@@@                :@@: :#:
     |                                         :  @  @                :@@: :#:
     |                                   @   :::  @  @         :@    ::@@: :#:
     |              @  :@:      :     :::@:::: :  @  @       :::@::::::@@: :#:
   0 +----------------------------------------------------------------------->Gi
     0                                                                   74.28

@github-actions
Copy link

Performance Summary

Comparing base 5a6744b with head c57360d on typescript_benchmark benchmark. For details see workflow artifacts. Note that performance is tested on the last commits with changes in stack-graphs, not on every commit.

Before
--------------------------------------------------------------------------------
Command:            base/target/release/tree-sitter-stack-graphs-typescript index -D base.sqlite --max-file-time=30 --hide-error-details -- base/data/typescript_benchmark
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 base-perf-results/perf.out
--------------------------------------------------------------------------------


    GB
3.276^                                                                     :# 
     |                                                                     :# 
     |                                                                     :# 
     |                                                                     :#:
     |                                                                     :#:
     |                                                                     :#:
     |                                             :::@                 ::::#:
     |                                             :  @                 :: :#:
     |                                        ::@@@:  @                 :: :#:
     |                                        : @  :  @               @@:: :#:
     |                                @:@   ::: @  :  @         :@:  :@ :: :#:
     |             :: :::@     :    ::@:@:::::: @  :  @       :::@::::@ :: :#:
   0 +----------------------------------------------------------------------->Gi
     0                                                                   75.00
After
--------------------------------------------------------------------------------
Command:            head/target/release/tree-sitter-stack-graphs-typescript index -D head.sqlite --max-file-time=30 --hide-error-details -- head/data/typescript_benchmark
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 head-perf-results/perf.out
--------------------------------------------------------------------------------


    GB
3.276^                                                                     :# 
     |                                                                     :# 
     |                                                                     :# 
     |                                                                     :#:
     |                                                                     :#:
     |                                                                     :#:
     |                                             :::@                 @:::#:
     |                                             :  @                 @: :#:
     |                                        ::@@@:  @                 @: :#:
     |                                        : @  :  @               ::@: :#:
     |                                 @@   ::: @  :  @         :@   :: @: :#:
     |              :@::::     :    ::@@ :::::: @  :  @       :::@::::: @: :#:
   0 +----------------------------------------------------------------------->Gi
     0                                                                   75.01

We're using the `mlua` crate, since it seems most actively maintained
and performant.
@github-actions
Copy link

Performance Summary

Comparing base 5a6744b with head 82d0a0a on typescript_benchmark benchmark. For details see workflow artifacts. Note that performance is tested on the last commits with changes in stack-graphs, not on every commit.

Before
--------------------------------------------------------------------------------
Command:            base/target/release/tree-sitter-stack-graphs-typescript index -D base.sqlite --max-file-time=30 --hide-error-details -- base/data/typescript_benchmark
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 base-perf-results/perf.out
--------------------------------------------------------------------------------


    GB
3.276^                                                                     :# 
     |                                                                     :# 
     |                                                                     :# 
     |                                                                     :#:
     |                                                                     :#:
     |                                                                     :#:
     |                                             :::@                 ::::#:
     |                                             :  @                 :: :#:
     |                                        ::@@@:  @                 :: :#:
     |                                        : @  :  @               @@:: :#:
     |                                @:@   ::: @  :  @         :@:  :@ :: :#:
     |             :: :::@     :    ::@:@:::::: @  :  @       :::@::::@ :: :#:
   0 +----------------------------------------------------------------------->Gi
     0                                                                   75.00
After
--------------------------------------------------------------------------------
Command:            head/target/release/tree-sitter-stack-graphs-typescript index -D head.sqlite --max-file-time=30 --hide-error-details -- head/data/typescript_benchmark
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 head-perf-results/perf.out
--------------------------------------------------------------------------------


    GB
3.276^                                                                  :##   
     |                                                                  :#    
     |                                                                  :#  : 
     |                                                                  :# :: 
     |                                                                  :# :: 
     |                                                                  :# :: 
     |                                           :::@                @:::# :: 
     |                                           :  @                @: :# :: 
     |                                      :::@@:  @                @: :# :: 
     |                                      : :@ :  @              ::@: :# :: 
     |                               @:   ::: :@ :  @        :@:   : @: :# :: 
     |             @  ::@     :     :@::::::: :@ :  @       ::@::::: @: :# :: 
   0 +----------------------------------------------------------------------->Gi
     0                                                                   78.03

@github-actions
Copy link

Performance Summary

Comparing base 5a6744b with head 6e3285a on typescript_benchmark benchmark. For details see workflow artifacts. Note that performance is tested on the last commits with changes in stack-graphs, not on every commit.

Before
--------------------------------------------------------------------------------
Command:            base/target/release/tree-sitter-stack-graphs-typescript index -D base.sqlite --max-file-time=30 --hide-error-details -- base/data/typescript_benchmark
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 base-perf-results/perf.out
--------------------------------------------------------------------------------


    GB
3.276^                                                                     :# 
     |                                                                     :# 
     |                                                                     :# 
     |                                                                     :#:
     |                                                                     :#:
     |                                                                     :#:
     |                                             :::@                 ::::#:
     |                                             :  @                 :: :#:
     |                                        ::@@@:  @                 :: :#:
     |                                        : @  :  @               @@:: :#:
     |                                @:@   ::: @  :  @         :@:  :@ :: :#:
     |             :: :::@     :    ::@:@:::::: @  :  @       :::@::::@ :: :#:
   0 +----------------------------------------------------------------------->Gi
     0                                                                   75.00
After
--------------------------------------------------------------------------------
Command:            head/target/release/tree-sitter-stack-graphs-typescript index -D head.sqlite --max-file-time=30 --hide-error-details -- head/data/typescript_benchmark
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 head-perf-results/perf.out
--------------------------------------------------------------------------------


    GB
3.276^                                                                  :##   
     |                                                                  :#    
     |                                                                  :#  : 
     |                                                                  :# :: 
     |                                                                  :# :: 
     |                                                                  :# :: 
     |                                           :::@                @:::# :: 
     |                                           :  @                @: :# :: 
     |                                      ::@@@:  @              : @: :# :: 
     |                                      : @  :  @              ::@: :# :: 
     |                                :   ::: @  :  @        ::@  :::@: :# :: 
     |             @::::@     @    :@@::::::: @  :  @       :::@:::::@: :# :: 
   0 +----------------------------------------------------------------------->Gi
     0                                                                   78.07

You can't do anything with them other than call `tostring` on them, but
even that is helpful in test cases!
This is the spackle that parses a source file using tree-sitter, and
calls a Lua function with it and an empty stack graph.  The Lua function
can do whatever it wants to walk the parse tree and add nodes and edges
to the graph.
This one is fun, because `SpanCalculator` holds a reference to the
file's source code, while the `mlua::UserData` works best for Rust types
that are 'static.

To get around this, we make sure to only ever create `SpanCalculator`
wrappers for source data that is owned by the Lua interpreter, and add
that source data as a user value of the Lua wrapper that we create.
That should cause Lua's garbage collector to ensure that the source code
outlives the `SpanCalculator`, making it safe for us to transmute the
source reference to a 'static lifetime.
The stack graph builder now imports the `lsp-position` module before
handing control to your Lua script.  That lets you create a span
calculator, and use that to fill in spans and definiens for the stack
graph nodes that you create.
@github-actions
Copy link

Performance Summary

Comparing base 1b01a8c with head ff1e99d on typescript_benchmark benchmark. For details see workflow artifacts. Note that performance is tested on the last commits with changes in stack-graphs, not on every commit.

Before
--------------------------------------------------------------------------------
Command:            base/target/release/tree-sitter-stack-graphs-typescript index -D base.sqlite --max-file-time=30 --hide-error-details -- base/data/typescript_benchmark
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 base-perf-results/perf.out
--------------------------------------------------------------------------------


    GB
1.406^                                                #                       
     |                                                #                      :
     |                                             :::#                      :
     |                                          ::@:  #                     ::
     |                                          : @:  #                     ::
     |                                          : @:  #                 ::::::
     |                                         :: @:  #                 :   ::
     |                                  @::   ::: @:  #          :      :   ::
     |                    @             @::   ::: @:  #         ::    :::   ::
     |               :   :@            :@:: ::::: @:  #       @::: :::: :   ::
     |             @@:::::@     :     ::@:::::::: @:  #       @:::::::: :   ::
     |             @ :::::@ ::::: @ : ::@:::::::: @:  #   :  :@:::::@:: :   ::
   0 +----------------------------------------------------------------------->Gi
     0                                                                   70.80
After
--------------------------------------------------------------------------------
Command:            head/target/release/tree-sitter-stack-graphs-typescript index -D head.sqlite --max-file-time=30 --hide-error-details -- head/data/typescript_benchmark
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 head-perf-results/perf.out
--------------------------------------------------------------------------------


    GB
3.276^                                                                  :##   
     |                                                                  :#    
     |                                                                  :#  : 
     |                                                                  :# :: 
     |                                                                  :# :: 
     |                                                                  :# :: 
     |                                           :::@                @:::# :: 
     |                                           :  @                @: :# :: 
     |                                      :::@@:  @                @: :# :: 
     |                                      : :@ :  @              ::@: :# :: 
     |                                :   ::: :@ :  @        :@:  :: @: :# :: 
     |             @ :::@     @    :@@::::::: :@ :  @       ::@::::: @: :# :: 
   0 +----------------------------------------------------------------------->Gi
     0                                                                   78.05

@github github deleted a comment from Behiiy Nov 29, 2023
@CleanCut
Copy link
Contributor

CleanCut commented Sep 9, 2025

The github/stack-graphs repository is no longer being maintained. As per #502, I'm closing all issues and pull requests before archiving the repository.

@CleanCut CleanCut closed this Sep 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants