Skip to content
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

feat(remove): adding ability to remove key #4

Merged
merged 30 commits into from
Oct 8, 2019
Merged

Conversation

Alex-Werner
Copy link
Owner

@Alex-Werner Alex-Werner commented Sep 24, 2019

Issue being fixed or implemented

This feature bring removal ability to SBTree.
Due to the need of that feature for our early implementation. We also bring additional feature in that PR as-well as improved test coverage.

What was done

  • Feat : Allow to .getFillStatus of a leaf.
  • Feat : Added .remove for all types
  • Feat : Added .mergeWithSiblings.
  • Feat : Added .getLeft and .getRight helper for leaf
  • Feat : Allow to set fillFactor (default: 0.5)
  • BREAKING : changed format of .getAllInLeaf()
  • BREAKING : renamed .findAll() to .getAll()
  • BREAKING : addInLeaf do not require duplicated fieldName anymore.
  • BREAKING : format of find is now {identifiers:[],keys:[]}
  • Full MemoryAdapter implementation
  • FsAdapter implementation for now (notes : balancing might need fixes).
  • Feat : added waitFor utils and used in insertDocuments to ensure state is loaded.
  • Typo : this.name -> this.id for those that had a name property. Can be BREAKING.
  • Test : Added E2E tests
  • Test : Added snapshot based test (using draw output)
  • Fix : RootNode was never holding data, it will now expectedly hold identifiers and value.
  • Fix : Importing from JSON state will correctly init proper class in childs.
  • Fix : Increase benchmark timeout (this is actually not a good news)

Notes :

Result from the benchmark as ran by travis

  SBTree - Performance - Standard Benchmark within test 
Will process 5000 elements
Finished writeOp in 140.557618 ms [35572.60055445732] ops
Finished getOp in 52.806892 ms [94684.61048607064] ops
Finished findOp in 90.007302 ms [55551.04851381947] ops
    ✓ should be fast (298ms)
======== SBTree 2.0.0 - Benchmark from mocha
= Write : 35572.60055445732 op/s [5000]
= Get : 94684.61048607064 op/s [5000]
= Find : 55551.04851381947 op/s [5000]
= ======== Summary
= Total : 15000 operations
= Duration : 0.283371812 s
= Avg : 61936.08651811581 op/s
    ✓ should display result
  SBTree - Performance - Extended Benchmark within test 
Will process 5000 elements
Finished writeOp in 92.869098 ms [53839.22217054375] ops
Finished negFindOp in 17738.279193 ms [53.556491566267354] ops
Finished gtFindOp in 14480.383771 ms [134.66493919210092] ops
Finished gteFindOp in 14341.16864 ms [132.4857163104945] ops
Finished ltFindOp in 13259.215357 ms [135.75463943646693] ops
Finished lteFindOp in 14419.563288 ms [131.76543297820854] ops
Finished inFindOp in 1058.326484 ms [1574.1834161640427] ops
Finished ninFindOp in 33762.237714 ms [39.48198017239989] ops
    ✓ should be fast (109183ms)
======== SBTree 2.0.0 - Extended
= $ne : 53.556491566267354 op/s [950]
= $gt : 134.66493919210092 op/s [1950]
= $gte : 132.4857163104945 op/s [1900]
= $lt : 135.75463943646693 op/s [1800]
= $lte : 131.76543297820854 op/s [1900]
= $in : 1574.1834161640427 op/s [1666]
= $nin : 39.48198017239989 op/s [1333]
= ======== Summary
= Total : 16499 operations
= Duration : 109.152043545 s
= Avg : 151.15612556715877 op/s

    ✓ should display result
  SBTree - Performance - Multi-Trees (index/field) benchmark within test 
Will process 10000 elements
Finished writeOp in 625.098991 ms [15997.466231712411] ops
Finished getOp in 121.931356 ms [82013.35840142712] ops
Finished findOp in 5886.759769 ms [1698.7273801558115] ops

    ✓ should be fast (6712ms)
======== SBTree 2.0.0 - Multi-tree Benchmark from mocha
= Write : 15997.466231712411 op/s [10000]
= Get : 82013.35840142712 op/s [10000]
= Find : 1698.7273801558115 op/s [10000]
= Total : 30000 operations
= Duration : 6.633790116 s
= Avg : 33236.517337765115 op/s

@Alex-Werner Alex-Werner added this to In progress in SBTree - MVP Sep 25, 2019
Now root correctly hold data at starts in an identifiers array. Will make our test fails
Also added snapshot.1.1 which use fixture instead of whole insertion
also Breaking : format of find is now {identifiers, keys}.
@Alex-Werner Alex-Werner moved this from In progress to Done in SBTree - MVP Oct 8, 2019
@Alex-Werner Alex-Werner force-pushed the feat/remove branch 2 times, most recently from ae517cf to 28a4e14 Compare October 8, 2019 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
SBTree - MVP
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant