Skip to content

Conversation

@wenkokke
Copy link
Collaborator

This PR adds a script to dump the disk I/O complexities from the table in the package description.

@wenkokke
Copy link
Collaborator Author

@jeltsch This script should work well with the sed scripts that you've written for checking the complexities.

@jeltsch
Copy link
Collaborator

jeltsch commented May 26, 2025

@jeltsch This script should work well with the sed scripts that you've written for checking the complexities.

Cool! I just had a quick look at its source code and will have a closer look tomorrow.

@wenkokke wenkokke force-pushed the wenkokke/dump-diskio-complexities branch 9 times, most recently from cd7282d to 67005b6 Compare May 27, 2025 18:42
@wenkokke
Copy link
Collaborator Author

The lint-diskio-complexities script finds the following inconsistencies:

Comparing Database.LSMTree.Simple to Database.LSMTree:
Database.LSMTree.Simple closeCursor           LazyLevelling O(T\log_T\frac{n}{B})            
Database.LSMTree        closeCursor           *             O(T\log_T\frac{n}{B})            
Database.LSMTree.Simple deleteSnapshot        LazyLevelling O(T\log_T\frac{n}{B})            
Database.LSMTree        deleteSnapshot        *             O(T\log_T\frac{n}{B})            
Database.LSMTree.Simple duplicate             *             O(1)                             
Database.LSMTree        duplicate             *             O(0)                             
Database.LSMTree.Simple lookups               LazyLevelling O(b T\log_T\frac{n}{B})          
Database.LSMTree        lookups               LazyLevelling O(T\log_T\frac{n}{B})            
Database.LSMTree.Simple members               LazyLevelling O(b T\log_T\frac{n}{B})          
Database.LSMTree        members               LazyLevelling O(T\log_T\frac{n}{B})            
Database.LSMTree.Simple newCursor             LazyLevelling O(T\log_T\frac{n}{B})            
Database.LSMTree        newCursor             *             O(T\log_T\frac{n}{B})            
Database.LSMTree.Simple next                  *             O(\frac{1}{P})                   
Database.LSMTree        next                  *             O(1)                             
Database.LSMTree.Simple openTableFromSnapshot *             O(\frac{n}{P})                   
Database.LSMTree        openTableFromSnapshot *             O(n)                             
Database.LSMTree.Simple rangeLookup           *             O(T\log_T\frac{n}{B}+\frac{b}{P})
Database.LSMTree        rangeLookup           *             O(T\log_T\frac{n}{B}+b)          
Database.LSMTree.Simple remainingUnionDebt    *             O(0)                             
Database.LSMTree        remainingUnionDebt    *             O(1)                             
Database.LSMTree.Simple saveSnapshot          LazyLevelling O(T\log_T\frac{n}{B})            
Database.LSMTree        saveSnapshot          *             O(T\log_T\frac{n}{B})            
Database.LSMTree.Simple supplyUnionCredits    *             O(\frac{b}{P})                   
Database.LSMTree        supplyUnionCredits    *             O(b)                             
Database.LSMTree.Simple take                  *             O(\frac{b}{P})                   
Database.LSMTree        take                  *             O(b)                             
Database.LSMTree.Simple takeWhile             *             O(\frac{b}{P})                   
Database.LSMTree        takeWhile             *             O(b)                             
Database.LSMTree.Simple union                 *             O(\frac{n}{P})                   
Database.LSMTree        union                 *             O(n)                             
Database.LSMTree.Simple withCursor            LazyLevelling O(T\log_T\frac{n}{B})            
Database.LSMTree        withCursor            *             O(T\log_T\frac{n}{B})            
Database.LSMTree.Simple withDuplicate         LazyLevelling O(T\log_T\frac{n}{B})            
Database.LSMTree        withDuplicate         *             O(0)                             
Database.LSMTree.Simple withIncrementalUnion  LazyLevelling O(T\log_T\frac{n}{B})            
Database.LSMTree        withIncrementalUnion  *             O(1)                             
Database.LSMTree.Simple withIncrementalUnions LazyLevelling O(T\log_T\frac{n}{B}+b)          
Database.LSMTree        withIncrementalUnions *             O(b)                             
Database.LSMTree.Simple withTableFromSnapshot *             O(\frac{n}{P})                   
Database.LSMTree        withTableFromSnapshot *             O(n)                             
Database.LSMTree.Simple withUnion             *             O(\frac{n}{P})                   
Database.LSMTree        withUnion             *             O(n)                             

Comparing lsm-tree.cabal to Database.LSMTree:
lsm-tree.cabal   closeCursor    LazyLevelling O(T\log_T\frac{n}{B})            
Database.LSMTree closeCursor    *             O(T\log_T\frac{n}{B})            
lsm-tree.cabal   deleteSnapshot LazyLevelling O(T\log_T\frac{n}{B})            
Database.LSMTree deleteSnapshot *             O(T\log_T\frac{n}{B})            
lsm-tree.cabal   newCursor      LazyLevelling O(T\log_T\frac{n}{B})            
Database.LSMTree newCursor      *             O(T\log_T\frac{n}{B})            
lsm-tree.cabal   next           *             O(\frac{1}{P})                   
Database.LSMTree next           *             O(1)                             
lsm-tree.cabal   openSnapshot   *             O(\frac{n}{P})                   
lsm-tree.cabal   rangeLookup    LazyLevelling O(T\log_T\frac{n}{B}+\frac{b}{P})
Database.LSMTree rangeLookup    *             O(T\log_T\frac{n}{B}+b)          
lsm-tree.cabal   saveSnapshot   LazyLevelling O(T\log_T\frac{n}{B})            
Database.LSMTree saveSnapshot   *             O(T\log_T\frac{n}{B})            
lsm-tree.cabal   union          *             O(\frac{n}{P})                   
Database.LSMTree union          *             O(n) 

@wenkokke wenkokke force-pushed the wenkokke/dump-diskio-complexities branch 4 times, most recently from ae82b72 to 879dc19 Compare May 28, 2025 12:48
@wenkokke
Copy link
Collaborator Author

The above mismatches are addressed by #741.

@wenkokke wenkokke changed the title feat: add dump-diskio-complexities feat(scripts): add lint-diskio-complexities May 28, 2025
@wenkokke wenkokke force-pushed the wenkokke/dump-diskio-complexities branch from d599e28 to 09f8d16 Compare May 29, 2025 13:43
@dcoutts dcoutts added this pull request to the merge queue May 29, 2025
Merged via the queue into main with commit da3efd0 May 29, 2025
29 checks passed
@dcoutts dcoutts deleted the wenkokke/dump-diskio-complexities branch May 29, 2025 15:44
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was this accidentally added?

Copy link
Collaborator

Choose a reason for hiding this comment

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

At least, I didn’t add it. 😉 To me, it also looks like being accidentally added. @wenkokke, do you think that it should be removed from the repository?

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.

5 participants