Skip to content

Replace arc-swap with hazarc#2472

Open
wyfo wants to merge 1 commit into
eclipse-zenoh:mainfrom
ZettaScaleLabs:replace-arc-swap-with-hazarc
Open

Replace arc-swap with hazarc#2472
wyfo wants to merge 1 commit into
eclipse-zenoh:mainfrom
ZettaScaleLabs:replace-arc-swap-with-hazarc

Conversation

@wyfo

@wyfo wyfo commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

Description

Replace arc-swap with hazarc

What does this PR do?

Replace arc-swap with hazarc

Why is this change needed?

hazarc has better performance characteristic, especially regarding loading of None and is more robustly tested.

Related Issues

None


🏷️ Label-Based Checklist

Based on the labels applied to this PR, please complete these additional requirements:

Labels: dependencies, internal

📦 Dependency Updates

Since this PR updates dependencies:

  • Changelog reviewed - Breaking changes in dependency identified and addressed
  • Security advisories checked - No known vulnerabilities in new version
  • License compatible - New version license is compatible with project
  • Tests pass - All tests pass with new dependency versions
  • Transitive deps reviewed - New transitive dependencies checked
  • Version pinned appropriately - Semver range is intentional and correct
  • Update scope limited - Updating one major dependency at a time when possible

Best practice: Keep dependency updates focused and test thoroughly.

🏠 Internal Change

This PR is marked as internal (not user-facing):

  • No API changes - Public APIs unchanged
  • No behavior changes - External behavior identical
  • Refactoring/maintenance - Code improvements only
  • Tests still pass - All existing tests pass without modification

Lighter review: Internal changes may have lighter review requirements.

Instructions:

  1. Check off items as you complete them (change - [ ] to - [x])
  2. The PR checklist CI will verify these are completed

This checklist updates automatically when labels change, but preserves your checked boxes.

@wyfo wyfo mentioned this pull request Mar 10, 2026
11 tasks
@wyfo wyfo requested a review from fuzzypixelz March 10, 2026 11:01
@wyfo wyfo added dependencies Pull requests that update a dependency file internal Changes not included in the changelog labels Mar 10, 2026
@codecov

codecov Bot commented Mar 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.56716% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.58%. Comparing base (9f8dff1) to head (ccba348).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
zenoh/src/net/routing/dispatcher/face.rs 57.14% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2472      +/-   ##
==========================================
- Coverage   72.60%   72.58%   -0.03%     
==========================================
  Files         390      390              
  Lines       63374    63364      -10     
==========================================
- Hits        46015    45990      -25     
- Misses      17359    17374      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wyfo wyfo force-pushed the replace-arc-swap-with-hazarc branch from ccba348 to 55db769 Compare May 12, 2026 13:57

@fuzzypixelz fuzzypixelz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think two things are worth discussing:

  1. Is there evidence to support the claim of better performance for zenoh's use case(s)?
  2. How confident are we that hazarc—being a relatively new crate—is battle-tested and proven? Admittedly, it already has one reverse dependency on crates.io. So I searched for the circumstances that led the project chose to use hazarc hoping for a independent analysis, but alas all I found was a pull request titled "Performance fix" where the author replaces RwLock with hazarc::AtomicArc without citing their reasoning.

If your answer to (1) is convincing enough (i.e. we stand to gain a lot), I'd be willing to take a risk and ignore (2) since I have good confidence in your work.

Ideally, I would need to do a deep-dive into hazarc myself to answer (2) but I am no expert on the topic and would need to spend significant time and effort to build up a good understanding of the design space.

With no peformance data, no independent analysis of hazarc's design and implementation and little time to commit to doing an analysis myself in the near future, I am not in a position to review nor merge this pull request.

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

Labels

dependencies Pull requests that update a dependency file internal Changes not included in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants