SkepticMystic / breadcrumbs

Add typed-links to your Obsidian notes
https://publish.obsidian.md/breadcrumbs-docs
MIT License
533 stars 36 forks source link

this code very faster #539

Open mProjectsCode opened 6 months ago

mProjectsCode commented 6 months ago

🦀 (feel free to change the name of this PR)

mProjectsCode commented 6 months ago

TODO list:

mProjectsCode commented 6 months ago

Some preliminary performance metrics. (Take with a grain of salt, as with all benchmarks.) Tested with 2564 notes in a tree shape. Each note has 1 to 3 explicit up frontmatter links. The tree is cut off at depth 10. Transitive rules:

[up] <- down
[down] <- up
[same] <- same
[uncle] <- nephew
[nephew] <- uncle
[up, down] -> same
[up, same] -> uncle

This fork:

Current Master (4.2.27) after running a few times to get JIT advantages:

This fork is about 4x faster regarding total time and about 25x faster in building implied edges.

mProjectsCode commented 6 months ago

There might be some strangeness with sorting, as bind gen frees arrays of rust objects when passed to rust. Since there is no way to pass a reference to an array, the sorting code returns an array that has to override the array passed in.

mProjectsCode commented 6 months ago

Yep, it seems i was quite tired when I made those last few commits and missed a lot of places 😅