Skip to content

Add visualize command #262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 8, 2023
Merged

Add visualize command #262

merged 5 commits into from
Jun 8, 2023

Conversation

hendrikvanantwerpen
Copy link
Collaborator

@hendrikvanantwerpen hendrikvanantwerpen commented Apr 19, 2023

◀️ #261 #264 ▶️

This PR adds a CLI command to generate a HTML visualization from the database.

This has limited use, as the visualizations quickly break down when they contain a lot of data. But because it is useful for debugging, I still think it is useful to have it. And if a better performing visualization is developed one day, it would be more useful.

This also updates the d3 and d3-dag JS files to newer versions.

@github-actions
Copy link

Performance Summary

Comparing base c5332d8 with head c49414d on microsoft/[email protected]. 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 -- test/src/compiler
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 base-perf-results/perf.out
--------------------------------------------------------------------------------


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


    GB
2.300^                                   #                                    
     |                                   #                                    
     |                                   #                                    
     |                                   #                                    
     |                                   #                                    
     |                                   #                                    
     |                                   #           :    :                   
     |                                   #           :    :                   
     |          :                   :    #           :    :                   
     |     :    :    :   :          :  ::#          ::    :     :     : :     
     |     :    :    : ::: :::     :: :: #          :::   :     :   @::::     
     |     :   @: :::: ::: :::     :: :: #:::   ::: :::  @:   : :   @:::: @   
   0 +----------------------------------------------------------------------->Gi
     0                                                                   236.8

@github-actions
Copy link

Performance Summary

Comparing base c5332d8 with head 1e5871a on microsoft/[email protected]. 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 -- test/src/compiler
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 base-perf-results/perf.out
--------------------------------------------------------------------------------


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


    GB
1.234^                                              #                         
     |      @@                                      #     :                   
     |      @                                       #     :                   
     |      @                                       #     :                   
     |      @                                       #     :                   
     |      @    @                  :               #     :                   
     |      @    @                  :         :    :#     :             :     
     |      @    @                  :         :    :#     :           @ :     
     |      @    @       @  :      ::         :    :#:    :          :@::     
     |      @    @ : :   @  :      :: :       : : ::#:   ::  @  :  : :@:::    
     |    @@@    @ : ::  @  :      :: :@     :: : ::#:   ::  @  :  :::@::::   
     |    @ @ : :@:: ::  @  :   :  :: :@ ::  :: : ::#: :::: :@::: ::::@:::@: :
   0 +----------------------------------------------------------------------->Gi
     0                                                                   211.9

@github-actions
Copy link

Performance Summary

Comparing base c5332d8 with head 7b353b0 on microsoft/[email protected]. 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 -- test/src/compiler
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 base-perf-results/perf.out
--------------------------------------------------------------------------------


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


    GB
2.300^                                   #                                    
     |                                   #                                    
     |                                   #                                    
     |                                   #                                    
     |                                   #                                    
     |          @        @@              #                                    
     |     :    @        @              :#                :                   
     |     :    @        @              :#                :                   
     |     :    @        @   @     ::   :#                :                   
     |     :    @   :    @   @     : :  :#:         :     :           : @     
     |     :    @   :: : @  :@     : : ::#:         : :   :         ::::@:    
     |   @@:   @@:: :: ::@ @:@  :  : : ::#:: :  :  ::@:   :  :  :  :::::@:: : 
   0 +----------------------------------------------------------------------->Gi
     0                                                                   238.3

@github-actions
Copy link

Performance Summary

Comparing base a9af2f2 with head 303bb12 on microsoft/[email protected]. 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 -- test/src/compiler
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 base-perf-results/perf.out
--------------------------------------------------------------------------------


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


    GB
1.234^                                               #                        
     |      @                                        #    @                   
     |      @                                        #    @                   
     |      @                                        #    @                   
     |      @    @                  :                #    @                   
     |      @    @                  :                #    @                   
     |      @    @   :              :   :           :#    @     :       :     
     |      @    @   :              :   :           :#    @     :     : :     
     |      @    @   :      :       :   :           :#    @     :    :@::     
     |      @    @ @ :      :       :   :  :     : ::#   :@:   ::  : :@::     
     |    :@@   :@@@::  :: :::  :  ::  :: ::     : ::#   :@:   ::  : :@::::   
     |    :@@   :@@@::: :: :::: ::::: ::: ::  :: : ::# : :@:::::@  :::@::::: :
   0 +----------------------------------------------------------------------->Gi
     0                                                                   216.5

@github-actions
Copy link

github-actions bot commented May 5, 2023

Performance Summary

Comparing base e0bf953 with head b1a2d37 on microsoft/[email protected]. 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 -- test/src/compiler
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 base-perf-results/perf.out
--------------------------------------------------------------------------------


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


    GB
1.234^                                               #                        
     |      @         :                              #                        
     |      @         :                              #                        
     |      @         :                              #                        
     |      @         :                              #                        
     |      @    :    :             :                #                        
     |     :@    :    :             :   :           :#    :             :     
     |     :@    :    :             :   :        :  :#    :           : :     
     |     :@    :    :  :  :       :  ::        :  :#    :          @:::     
     |     :@    :    : @:  :       :  ::  :  :  : @:#    :  : ::    @::: :   
     |    ::@   ::    : @:  :    :  :  ::  :  :: : @:#    @  : :::  :@::: :   
     |    ::@:  ::::::: @: :: ::::  :  :: :: ::: : @:# :: @ ::::@: ::@:::::@::
   0 +----------------------------------------------------------------------->Gi
     0                                                                   212.5

@github-actions
Copy link

Performance Summary

Comparing base e0bf953 with head 230c1ae on microsoft/[email protected]. 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 -- test/src/compiler
Massif arguments:   --massif-out-file=perf.out
ms_print arguments: --x=72 --y=12 base-perf-results/perf.out
--------------------------------------------------------------------------------


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


    GB
2.300^                                   #                                    
     |                                   #                                    
     |                                   #                                    
     |                                   #                                    
     |                                   #                                    
     |                                   #                                    
     |      @                           :#           :                        
     |      @   :                       :#           :                        
     |      @   :                   @@  :#           :                        
     |      @   :    :   :         :@   :#      :    :          :       :     
     |      @   :    :  :: :       :@   :#   :  :    ::         :   :: :::    
     |    ::@  :: :  :  :: :       :@ :::#   :  :@@ :::       ::: ::::@:::::  
   0 +----------------------------------------------------------------------->Gi
     0                                                                   237.8

Base automatically changed from index-special-files to main June 2, 2023 14:39
Visualizations will only work for very small stack graphs. This command is
useful for debugging minimal examples, but running it on any real-world code
will most likely result in HTML files that will not load in any browser.
"#)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for including this help text.

@hendrikvanantwerpen hendrikvanantwerpen merged commit 9de0462 into main Jun 8, 2023
@hendrikvanantwerpen hendrikvanantwerpen deleted the visualize-command branch June 8, 2023 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants