Skip to content

Conversation

hendrikvanantwerpen
Copy link
Contributor

◀️ #262

Per @dcreager's suggestion, this PR replaces explicit BEGIN/COMMIT with the transaction() mechanism of Rusqlite. This should result in more robust behavior when errors occur, because the open transaction is rolled back as soon as the transaction object is dropped.

@hendrikvanantwerpen hendrikvanantwerpen requested a review from a team as a code owner April 20, 2023 09:01
@hendrikvanantwerpen hendrikvanantwerpen self-assigned this Apr 20, 2023
This was referenced Apr 20, 2023
@github-actions
Copy link

Performance Summary

Comparing base 303bb12 with head 1ee1c9b on microsoft/TypeScript@v4.9.5. 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                                                                   238.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                                                                   234.8

@github-actions
Copy link

github-actions bot commented May 5, 2023

Performance Summary

Comparing base b1a2d37 with head e234bf8 on microsoft/TypeScript@v4.9.5. 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                                                                   216.9
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.4

@hendrikvanantwerpen hendrikvanantwerpen force-pushed the robust-transactions branch 2 times, most recently from 088ba52 to 4d794f1 Compare May 17, 2023 09:48
@github-actions
Copy link

Performance Summary

Comparing base 230c1ae with head afb98e0 on microsoft/TypeScript@v4.9.5. 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
1.234^                                               #                        
     |      @                                        #                        
     |      @                                        #                        
     |      @                                        #                        
     |      @                       ::               #                        
     |      @    :                  :                #                        
     |     :@    :    :             :                #   @@            ::     
     |     :@    :    :      :      :            :   #   @           ::::     
     |     :@    :    :  :  ::      :  :         :   #   @           ::::     
     |     :@    :    :  :  ::      :  :      @  :   #   @           ::::     
     |     @@    :::  :  :  ::  :   :  :: :   @  : ::#   @         : ::::     
     |     @@    :::::::::  :: :::  :  :::::  @  : : #: :@  :: :  @:::::::@: :
   0 +----------------------------------------------------------------------->Gi
     0                                                                   208.7

Copy link

@rewinfrey rewinfrey left a comment

Choose a reason for hiding this comment

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

Thanks for this update, 👍

Base automatically changed from visualize-command to main June 8, 2023 10:53
@hendrikvanantwerpen hendrikvanantwerpen merged commit 3e852e4 into main Jun 8, 2023
@hendrikvanantwerpen hendrikvanantwerpen deleted the robust-transactions 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