GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Performance: utilizes custom collections/maps for the hot paths · Issue #3965 · ArcadeData/arcadedb

Performance: utilizes custom collections/maps for the hot paths #3965

New issue
Copy link
New issue
Copy link
Closed
Feature
Closed
Performance: utilizes custom collections/maps for the hot paths#3965
Feature
Copy link
Assignees
lvca
Labels
performance
Milestone
26.4.2

Description

@lvca
lvca
opened on Apr 23, 2026
Issue body actions

Using specific collections/maps in hot paths can potentially saves RAM, reduce CPU and Garbage Collection pressure. We already have enormous results with the RidHashSet.

Activity

  1. lvca
    self-assigned this
    on Apr 23, 2026
  2. lvca
    added this to the 26.4.1 milestone on Apr 23, 2026
  3. lvca
    added the
    Feature
    issue type on Apr 23, 2026
  4. lvca commented on Apr 23, 2026

    @lvca
    lvca
    on Apr 23, 2026
    MemberAuthor
    More actions

    First partial results

    Benchmark results (single host, 5 iterations, best-of)

    === LONG SET: 100k vertex keys (GraphBatch.allKeys shape) ===
    HashSet build= 3.86 ms contains= 0.60 ms mem= 5.9 MB
    ConcurrentHashMap.keySet build= 5.67 ms contains= 0.78 ms mem= 6.0 MB
    LongHashSet build= 1.43 ms contains= 0.40 ms mem= 2.0 MB

    === INT SET: 200 file-ids x 100k builds (TransactionContext shape) ===
    HashSet contains=22.71 ms ~11,742 bytes/instance
    IntHashSet contains=11.49 ms ~ 2,153 bytes/instance

    === INT SET: 64 bucket-ids x 100k builds (OpenCypher validBuckets shape) ===
    HashSet contains= 8.76 ms ~3,714 bytes/instance
    IntHashSet contains= 3.66 ms ~ 566 bytes/instance

    ┌────────────────────────┬─────────────────────────────────────────┬───────────────────────────────────────┐
    │        Workload        │                  Speed                  │                Memory                 │
    ├────────────────────────┼─────────────────────────────────────────┼───────────────────────────────────────┤
    │ 100k Long (GraphBatch) │ 2.7x faster build, 1.5x faster contains │ 3x less (5.9 MB → 2.0 MB)             │
    ├────────────────────────┼─────────────────────────────────────────┼───────────────────────────────────────┤
    │ 200 Int (commit shape) │ 2x faster contains                      │ 5.4x less (11.7 KB → 2.1 KB/instance) │
    ├────────────────────────┼─────────────────────────────────────────┼───────────────────────────────────────┤
    │ 64 Int (OLAP shape)    │ 2.4x faster contains                    │ 6.6x less (3.7 KB → 566 B/instance)   │
    └────────────────────────┴─────────────────────────────────────────┴───────────────────────────────────────┘
    

    The per-instance memory ratios match the analytical estimate (~10x for int, ~7x for long, partly diluted by the load-factor headroom + table sentinel-fill cost). The speed wins on contains() come from skipping autobox + equals() cast.

    For a workload that does 1 commit/sec creating a 200-fileId set, the GC delta alone is ~10 KB/sec saved + ~200 short-lived Integer allocations avoided per commit - meaningful at thousands of TPS.

  5. lvca
    added
    performance
    on Apr 23, 2026
  6. lvca
    added a commit that references this issue on Apr 23, 2026

    perf: usage of custom collections/maps in hot paths

    0aa8995
  7. lvca commented on Apr 23, 2026

    @lvca
    lvca
    on Apr 23, 2026
    MemberAuthor
    More actions

    Benchmark — measured impact

    === LONG-KEYED MAP: 100k vertex keys -> RID (GraphBatch.deferredOutHead shape) ===
    HashMap<Long, V> build= 3.05 ms contains= 0.51 ms mem= 6.3 MB
    ConcurrentHashMap<Long, V> build= 5.33 ms contains= 0.74 ms mem= 6.3 MB
    LongObjectHashMap build= 1.65 ms contains= 0.44 ms mem= 3.0 MB

    vs the previous baseline (ConcurrentHashMap<Long, V> was what deferredOutHead was using):

    ┌────────────────────┬─────────────────────────────────┐
    │       Metric       │        Speedup / Savings        │
    ├────────────────────┼─────────────────────────────────┤
    │ Build (100K puts)  │ 3.2x faster (5.33 ms → 1.65 ms) │
    ├────────────────────┼─────────────────────────────────┤
    │ Get (100K lookups) │ 1.7x faster (0.74 ms → 0.44 ms) │
    ├────────────────────┼─────────────────────────────────┤
    │ Memory             │ 2.1x less (6.3 MB → 3.0 MB)     │
    └────────────────────┴─────────────────────────────────┘
    

    At a typical bulk-load flush with both maps populated to 100K entries: ~6.6 MB heap saved + ~7 ms build time saved + ~0.6 ms read time saved per flush iteration. GC pressure also drops substantially (no more Long boxing on every put/get).

  8. lvca
    added a commit that references this issue on Apr 23, 2026

    perf: used custom maps in hot paths

    830e38e
  9. lvca
    closed this as completedon Apr 23, 2026
  10. mergify
    added a commit that references this issue on May 3, 2026

    chore(deps): bump org.postgresql:postgresql from 42.7.10 to 42.7.11 […

    03c204f
  11. robfrank
    added 2 commits that reference this issue on May 12, 2026

    perf: usage of custom collections/maps in hot paths

    4464fa9

    perf: used custom maps in hot paths

    3b7a4f1
  12. tae898
    added 3 commits that reference this issue on Jun 28, 2026

    perf: usage of custom collections/maps in hot paths

    2828fda

    perf: used custom maps in hot paths

    449c046

    chore(deps): bump org.postgresql:postgresql from 42.7.10 to 42.7.11 […

    8a485d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @lvca
    lvca

Labels

performance

Type

Feature

Projects

No projects

    Milestone

    • 26.4.2

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.