Show HN: ChaosTree – A zero-dependency Java tree library (AVL,RBT,B-Tree,B+Tree)

What is ChaosTree?

ChaosTree is a zero-dependency Java Sorted Set/Map library built around multiple tree implementations.

It provides implementations of:

  • AVL Tree

  • Red-Black Tree

  • B-Tree

  • B+Tree

    I have not made my custom API as it implements NavigableSet, NavigableMap, SequencedSet and SequencedMap. My Custome API are:


  • buildFromSorted(Iterator> it, float factor)

  • importFlatMatrix(Object[][] blast, float factor)

  • Object[][] exportFlatMatrix()

    I started ChaosTree because I wanted to explore how far I could learn DS structure, It started as frst release of 7 tree of Set type with Custome API, As i got engrossed into it I moved to Map, During phase of switching from Set to Map there was drastic change and knowledge upgrade where I pushed my Tree limit from jdk11+ support to jdk21+ where paid close attention to dependency-free and memory layout, allocation,JVM behavior, and real-world performance.

    Some of the things I experimented with:


  • Different node layouts and metadata footprints

  • CRTP/F-bounded polymorphism for tree implementations

  • Parent-pointer vs parentless nodes

  • Array-based N-ary tree nodes

  • B-Tree/B+Tree degree selection

  • JMH benchmarking and JFR profiling

  • Differential/randomized testing against java.util.TreeMap/TreeSet

    After this rough and tough It also passes these test:

    -Guava Testlib compatibility testing


  • -jqwik property-based testing
    -Randomized differential testing against reference collections
    -White-box structural validation of tree nodes
    -Direct validation of B-Tree/B+Tree structural invariants
    -Exception and iterator-contract testing
    -Serialization and cloning tests
    -Nary Tree uses custom jqwick test of API validation as well.

    Tail latency behavior is not shown here because it get's truncated into a simple text which made the dat read wrong:https://chaos-vy.github.io/ChaosTree/utils/JMH-Report.html
    I have also ran benchmark with official JDK TreeMapUpdate to my N-ary tree.

    GitHub:
    https://github.com/Chaos-vy/ChaosTree
    https://chaos-vy.github.io/ChaosTree/

    I'd especially like feedback on the API design, implementation choices, benchmark methodology. I am currently trying to truncate useless and complex branches for performnace tuning.




    Comments URL: https://news.ycombinator.com/item?id=49694404


    Points: 7


    # Comments: 9

    guid

    https://news.ycombinator.com/item?id=49694404

    source_url

    https://github.com/Chaos-vy/ChaosTree

    author_name

    chaos_vy

    id: 6739
    uid: 7PLy9
    insdate: 2026-09-14 14:05:32
    title: Show HN: ChaosTree – A zero-dependency Java tree library (AVL,RBT,B-Tree,B+Tree)
    additional:

    What is ChaosTree?

    ChaosTree is a zero-dependency Java Sorted Set/Map library built around multiple tree implementations.

    It provides implementations of:

  • AVL Tree

  • Red-Black Tree

  • B-Tree

  • B+Tree

    I have not made my custom API as it implements NavigableSet, NavigableMap, SequencedSet and SequencedMap. My Custome API are:


  • buildFromSorted(Iterator> it, float factor)

  • importFlatMatrix(Object[][] blast, float factor)

  • Object[][] exportFlatMatrix()

    I started ChaosTree because I wanted to explore how far I could learn DS structure, It started as frst release of 7 tree of Set type with Custome API, As i got engrossed into it I moved to Map, During phase of switching from Set to Map there was drastic change and knowledge upgrade where I pushed my Tree limit from jdk11+ support to jdk21+ where paid close attention to dependency-free and memory layout, allocation,JVM behavior, and real-world performance.

    Some of the things I experimented with:


  • Different node layouts and metadata footprints

  • CRTP/F-bounded polymorphism for tree implementations

  • Parent-pointer vs parentless nodes

  • Array-based N-ary tree nodes

  • B-Tree/B+Tree degree selection

  • JMH benchmarking and JFR profiling

  • Differential/randomized testing against java.util.TreeMap/TreeSet

    After this rough and tough It also passes these test:

    -Guava Testlib compatibility testing


  • -jqwik property-based testing
    -Randomized differential testing against reference collections
    -White-box structural validation of tree nodes
    -Direct validation of B-Tree/B+Tree structural invariants
    -Exception and iterator-contract testing
    -Serialization and cloning tests
    -Nary Tree uses custom jqwick test of API validation as well.

    Tail latency behavior is not shown here because it get's truncated into a simple text which made the dat read wrong:https://chaos-vy.github.io/ChaosTree/utils/JMH-Report.html
    I have also ran benchmark with official JDK TreeMapUpdate to my N-ary tree.

    GitHub:
    https://github.com/Chaos-vy/ChaosTree
    https://chaos-vy.github.io/ChaosTree/

    I'd especially like feedback on the API design, implementation choices, benchmark methodology. I am currently trying to truncate useless and complex branches for performnace tuning.




    Comments URL: https://news.ycombinator.com/item?id=49694404


    Points: 7


    # Comments: 9


    category: Hacker News
    md5:
    guid: https://news.ycombinator.com/item?id=49694404
    source_url: https://github.com/Chaos-vy/ChaosTree
    updated:
    image:
    author_name: chaos_vy
    author_link:
    Add Comment
    Type in a Nick Name here
     
    AI Testing

    Autonomous AI API, a cutting-edge platform that leverages advanced AI technologies to enable self-modification and self-repair of its core files. This innovative site utilizes machine learning algorithms to detect and correct errors, ensuring maximum uptime and performance. With its autonomous capabilities, the AI API can adapt to changing requirements, learn from user interactions, and continuously improve its functionality.
    Page Views

    This page has been viewed 5 times.

    Search HNews
    Search HNews by entering your search text above.
    Category List HNews