Skip to content

docs: pre-release documentation update for v2.4.0#63

Merged
orieg merged 2 commits intomainfrom
docs/v2.4.0-pre-release-docs
Mar 3, 2026
Merged

docs: pre-release documentation update for v2.4.0#63
orieg merged 2 commits intomainfrom
docs/v2.4.0-pre-release-docs

Conversation

@orieg
Copy link
Owner

@orieg orieg commented Mar 3, 2026

Summary

Pre-release documentation refresh before tagging v2.4.0.

  • Add API.md — Complete API reference for all 10 Judy types and 49 public methods, including type compatibility matrix
  • Update README.md — Document all 10 types (adding Hash, Adaptive, Packed), replace stale Todo section with concise Roadmap, add Expanded API section with link to API.md
  • Update BENCHMARK.md — Version bump to 2.4.0, add Hash/Adaptive types to Quick Decision Guide and memoryUsage() table
  • Remove OPTIMIZATION_PROPOSAL.md — Internal planning document, not end-user release material
  • Update package.xml — Add API.md to file list, remove OPTIMIZATION_PROPOSAL.md, fix 11 stale md5sum values

Validation

  • Full Docker validation: pecl packagepecl install Judy-2.4.0.tgz → extension loads → 176/176 tests pass
  • Version consistency verified across php_judy.h, package.xml, tests/001.phpt
  • All md5sum values in package.xml verified against actual file checksums
  • Package contents verified: API.md present, OPTIMIZATION_PROPOSAL.md absent (224 files)

Test plan

  • Review rendered markdown for API.md, README.md, BENCHMARK.md
  • Verify CI passes
  • Confirm package.xml file list is complete and correct

- Add API.md with complete API reference for all 10 types and 49 methods
- Update README.md: document all 10 types (4 new: Hash, Adaptive, Packed),
  replace stale Todo section with concise Roadmap, add Expanded API section
- Update BENCHMARK.md: version 2.4.0, add Hash/Adaptive types to decision
  guide and memoryUsage table
- Remove OPTIMIZATION_PROPOSAL.md (internal planning doc, not release material)
- Update package.xml: add API.md, remove OPTIMIZATION_PROPOSAL.md, fix 11
  stale md5sum values
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on a pre-release documentation refresh for version 2.4.0 of the PHP Judy extension. It introduces a new, detailed API reference, updates existing user-facing documentation to reflect recent feature additions like new Judy array types, and cleans up internal-only documents from the public release. The changes aim to provide clearer and more complete information for users of the extension.

Highlights

  • New API Reference: A comprehensive API.md document has been added, detailing all 10 Judy types and 49 public methods, including a type compatibility matrix.
  • Documentation Updates: The README.md has been significantly updated to include documentation for the new Hash and Adaptive Judy types, replace the old 'Todo' section with a concise 'Roadmap', and link to the new API.md. BENCHMARK.md has also been updated to reflect the v2.4.0 release and incorporate the new types.
  • File Restructuring: The internal OPTIMIZATION_PROPOSAL.md document has been removed, streamlining the public-facing documentation.
  • Package Metadata Refresh: The package.xml file has been updated with correct md5sum values for various source and documentation files, and its file list now includes API.md while excluding OPTIMIZATION_PROPOSAL.md.
Changelog
  • API.md
    • Added a complete API reference for all 10 Judy types and 49 public methods, including a type compatibility matrix.
  • BENCHMARK.md
    • Updated PHP Judy extension version to 2.4.0.
    • Clarified use cases for Judy, specifically adding string key random access with Hash or Adaptive types.
    • Refined recommendations for PHP arrays when dealing with random access patterns on integer keys.
    • Expanded the memoryUsage() return values table to include Hash and Adaptive types.
    • Updated the 'Last Updated' date to March 2026.
  • OPTIMIZATION_PROPOSAL.md
    • Removed the internal OPTIMIZATION_PROPOSAL.md document as it is not end-user release material.
  • README.md
    • Updated the table of contents to reflect new sections and removed 'Todo'.
    • Added API.md to the directory contents list.
    • Expanded the description of Judy array types from 6 to 10, introducing Hash-Based and Adaptive/SSO types.
    • Detailed the Judy::INT_TO_PACKED type, including its use cases and comparison with INT_TO_MIXED.
    • Added descriptions for Judy::STRING_TO_INT_HASH, Judy::STRING_TO_MIXED_HASH, Judy::STRING_TO_INT_ADAPTIVE, and Judy::STRING_TO_MIXED_ADAPTIVE.
    • Updated the 'Key Characteristics' section to reflect new random access performance for Hash types and string lookup recommendations.
    • Updated the 'Atomic Increment' section to include STRING_TO_INT_HASH.
    • Replaced the 'Todo' section with a concise 'Roadmap' outlining future development.
    • Added an 'Expanded API' section with a link to the new API.md.
    • Updated the 'Support' section to include a link to the new API.md.
  • package.xml
    • Updated md5sum values for config.m4, config.w32, judy_arrayaccess.c, judy_handlers.c, judy_iterator.c, judy_iterator.h, php_judy.c, php_judy.h, README.md, BENCHMARK.md, and Dockerfile.
    • Added API.md to the file list.
    • Removed OPTIMIZATION_PROPOSAL.md from the file list.
Activity
  • Full Docker validation was performed, with all 176 tests passing.
  • Version consistency was verified across php_judy.h, package.xml, and tests/001.phpt.
  • All md5sum values in package.xml were verified against actual file checksums.
  • Package contents were verified, confirming API.md is present and OPTIMIZATION_PROPOSAL.md is absent.
  • The author has outlined a test plan including reviewing rendered markdown, verifying CI passes, and confirming package.xml file list completeness.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Mar 3, 2026

Test Results

PHP Platform Arch TS Tests Pass Fail Skip Duration
8.1 Linux x64 - 176 176 0 0 1.6s
8.2 Linux x64 - 176 176 0 0 1.8s
8.3 Linux x64 - 176 176 0 0 1.8s
8.4 Linux x64 - 176 176 0 0 2.1s
8.5 Linux x64 - 176 176 0 0 2.1s
8.1 Windows x64 nts 176 176 0 0 8.3s
8.2 Windows x64 nts 176 176 0 0 8.7s
8.3 Windows x64 nts 176 176 0 0 8.4s
8.4 Windows x64 nts 176 176 0 0 8.3s
8.5 Windows x64 nts 176 176 0 0 9.4s
Total 1760 1760 0 0

Benchmark Results

500,000 elements, 7 iterations (median), Judy 2.4.0

Run Status

Platform PHP 8.1 PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
Linux
Windows

Memory Efficiency (Linux, PHP 8.5)

Type Judy PHP array Savings
Bitset 160 B 8.0 MB 52454.9x less
Int to Int 160 B 8.0 MB 52454.9x less
Int to Mixed 7.6 MB 8.0 MB ~1.0x
Int to Packed 13.3 MB 8.0 MB 0.6x
String to Int 64.2 KB 20.0 MB 319.2x less
String to Mixed 7.7 MB 20.0 MB 2.6x less
String to Int (Hash) 64.2 KB 20.0 MB 319.2x less
String to Mixed (Hash) 7.7 MB 20.0 MB 2.6x less
String to Int (Adaptive) 64.2 KB 20.0 MB 319.2x less
String to Mixed (Adaptive) 7.7 MB 20.0 MB 2.6x less

API Speedups (Linux, PHP 8.5)

Speedup = PHP time / Judy time. Bold = Judy faster.

Operation Judy PHP Speedup
putAll() 25.9 ms 35.4 ms 1.4x
fromArray() 25.9 ms 35.4 ms 1.4x
toArray() 26.0 ms 39.5 ms 1.5x
getAll() 1.5 ms 2.6 ms 1.7x
keys() 11.8 ms 25.8 ms 2.2x
values() 13.0 ms 25.7 ms 2.0x
sumValues() 8.1 ms 19.9 ms 2.5x
populationCount() 0.00 ms 21.3 ms 213248x
deleteRange() 52.6 ms 70.6 ms 1.3x
equals() 14.6 ms 52.9 ms 3.6x
union() Bitset 37.3 ms 4.7 ms 0.1x
intersect() Bitset 16.7 ms 5.8 ms 0.3x
diff() Bitset 16.8 ms 3.2 ms 0.2x
xor() Bitset 33.8 ms 11.9 ms 0.4x
mergeWith() Int→Int 69.8 ms 77.6 ms 1.1x
mergeWith() Str→Int 291.6 ms 285.0 ms ~1.0x
forEach() Int→Int 27.8 ms 22.3 ms 0.8x
filter() Int→Int 56.5 ms 43.3 ms 0.8x
map() Int→Int 59.3 ms 55.5 ms 0.9x
forEach() Str→Int 74.5 ms 65.9 ms 0.9x
filter() Str→Int 149.7 ms 123.9 ms 0.8x
map() Str→Int 173.7 ms 170.7 ms ~1.0x

Core Types (Linux, PHP 8.5)

Speedup = PHP time / Judy time. Bold = Judy faster.

Type Op Judy PHP array Speedup
Bitset Write 20.2 ms 7.0 ms 0.3x
Bitset Read 11.4 ms 3.8 ms 0.3x
Bitset Iter 18.4 ms 3.1 ms 0.2x
Bitset Free 0.01 ms 0.35 ms 59.7x
Int to Int Write 29.5 ms 7.3 ms 0.2x
Int to Int Read 13.4 ms 3.9 ms 0.3x
Int to Int Iter 19.8 ms 3.1 ms 0.2x
Int to Int Free 0.48 ms 0.32 ms 0.7x
Int to Mixed Write 39.1 ms 11.8 ms 0.3x
Int to Mixed Read 17.0 ms 8.0 ms 0.5x
Int to Mixed Iter 21.4 ms 3.8 ms 0.2x
Int to Mixed Free 15.0 ms 4.2 ms 0.3x
String to Int Write 102.2 ms 16.6 ms 0.2x
String to Int Read 41.3 ms 7.9 ms 0.2x
String to Int Iter 64.1 ms 4.6 ms 0.1x
String to Int Free 22.4 ms 1.2 ms 0.1x
String to Int (Adaptive) Write 169.2 ms 17.5 ms 0.1x
String to Int (Adaptive) Read 27.2 ms 8.2 ms 0.3x
String to Int (Adaptive) Iter 79.5 ms 4.6 ms 0.1x
String to Int (Adaptive) Free 49.0 ms 1.3 ms 0.0x
All types detail

Core Types (Linux, PHP 8.5) — All

Speedup = PHP time / Judy time. Bold = Judy faster.

Type Op Judy PHP array Speedup
Bitset Write 20.2 ms 7.0 ms 0.3x
Bitset Read 11.4 ms 3.8 ms 0.3x
Bitset Iter 18.4 ms 3.1 ms 0.2x
Bitset Free 0.01 ms 0.35 ms 59.7x
Int to Int Write 29.5 ms 7.3 ms 0.2x
Int to Int Read 13.4 ms 3.9 ms 0.3x
Int to Int Iter 19.8 ms 3.1 ms 0.2x
Int to Int Free 0.48 ms 0.32 ms 0.7x
Int to Mixed Write 39.1 ms 11.8 ms 0.3x
Int to Mixed Read 17.0 ms 8.0 ms 0.5x
Int to Mixed Iter 21.4 ms 3.8 ms 0.2x
Int to Mixed Free 15.0 ms 4.2 ms 0.3x
Int to Packed Write 51.3 ms 10.2 ms 0.2x
Int to Packed Read 33.9 ms 6.1 ms 0.2x
Int to Packed Iter 39.4 ms 4.0 ms 0.1x
Int to Packed Free 9.6 ms 4.4 ms 0.5x
String to Int Write 102.2 ms 16.6 ms 0.2x
String to Int Read 41.3 ms 7.9 ms 0.2x
String to Int Iter 64.1 ms 4.6 ms 0.1x
String to Int Free 22.4 ms 1.2 ms 0.1x
String to Mixed Write 127.7 ms 19.8 ms 0.2x
String to Mixed Read 45.4 ms 10.3 ms 0.2x
String to Mixed Iter 74.3 ms 6.0 ms 0.1x
String to Mixed Free 76.3 ms 6.7 ms 0.1x
String to Int (Hash) Write 183.5 ms 17.9 ms 0.1x
String to Int (Hash) Read 27.7 ms 8.0 ms 0.3x
String to Int (Hash) Iter 80.2 ms 4.6 ms 0.1x
String to Int (Hash) Free 49.0 ms 1.4 ms 0.0x
String to Mixed (Hash) Write 276.1 ms 21.3 ms 0.1x
String to Mixed (Hash) Read 31.4 ms 10.4 ms 0.3x
String to Mixed (Hash) Iter 105.5 ms 6.6 ms 0.1x
String to Mixed (Hash) Free 141.5 ms 7.5 ms 0.1x
String to Int (Adaptive) Write 169.2 ms 17.5 ms 0.1x
String to Int (Adaptive) Read 27.2 ms 8.2 ms 0.3x
String to Int (Adaptive) Iter 79.5 ms 4.6 ms 0.1x
String to Int (Adaptive) Free 49.0 ms 1.3 ms 0.0x
String to Mixed (Adaptive) Write 279.0 ms 20.8 ms 0.1x
String to Mixed (Adaptive) Read 30.6 ms 10.7 ms 0.3x
String to Mixed (Adaptive) Iter 105.2 ms 6.5 ms 0.1x
String to Mixed (Adaptive) Free 144.4 ms 7.2 ms 0.1x
Cross-version detail (Linux)

Core Types — Linux

Each cell: Judy ms (speedup vs PHP array).

Type Op PHP 8.1 PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
Bitset Write 19.9 ms (0.4x) 19.7 ms (0.3x) 19.9 ms (0.4x) 19.7 ms (0.4x) 20.2 ms (0.3x)
Bitset Read 12.0 ms (0.3x) 12.4 ms (0.3x) 11.4 ms (0.3x) 11.4 ms (0.3x) 11.4 ms (0.3x)
Int to Int Write 29.5 ms (0.3x) 29.2 ms (0.2x) 29.1 ms (0.2x) 29.6 ms (0.3x) 29.5 ms (0.2x)
Int to Int Read 13.8 ms (0.3x) 13.5 ms (0.3x) 13.5 ms (0.3x) 13.4 ms (0.3x) 13.4 ms (0.3x)
Int to Mixed Write 39.0 ms (0.3x) 37.9 ms (0.3x) 42.6 ms (0.2x) 39.2 ms (0.3x) 39.1 ms (0.3x)
Int to Mixed Read 16.9 ms (0.3x) 16.7 ms (0.3x) 16.3 ms (0.3x) 16.9 ms (0.4x) 17.0 ms (0.5x)
Int to Packed Write 55.1 ms (0.2x) 52.0 ms (0.2x) 51.8 ms (0.2x) 51.4 ms (0.2x) 51.3 ms (0.2x)
Int to Packed Read 34.2 ms (0.2x) 34.7 ms (0.2x) 33.3 ms (0.2x) 33.3 ms (0.2x) 33.9 ms (0.2x)
String to Int Write 102.4 ms (0.2x) 103.8 ms (0.2x) 103.1 ms (0.2x) 104.8 ms (0.2x) 102.2 ms (0.2x)
String to Int Read 41.5 ms (0.2x) 41.2 ms (0.2x) 40.8 ms (0.2x) 41.6 ms (0.2x) 41.3 ms (0.2x)
String to Mixed Write 127.6 ms (0.2x) 125.0 ms (0.2x) 123.6 ms (0.2x) 128.1 ms (0.2x) 127.7 ms (0.2x)
String to Mixed Read 45.0 ms (0.2x) 44.4 ms (0.2x) 44.2 ms (0.2x) 45.4 ms (0.2x) 45.4 ms (0.2x)
String to Int (Hash) Write 184.6 ms (0.1x) 181.2 ms (0.1x) 171.6 ms (0.1x) 185.9 ms (0.1x) 183.5 ms (0.1x)
String to Int (Hash) Read 27.9 ms (0.3x) 27.8 ms (0.3x) 27.1 ms (0.3x) 27.8 ms (0.3x) 27.7 ms (0.3x)
String to Mixed (Hash) Write 268.9 ms (0.1x) 260.8 ms (0.1x) 250.9 ms (0.1x) 262.8 ms (0.1x) 276.1 ms (0.1x)
String to Mixed (Hash) Read 30.4 ms (0.3x) 29.6 ms (0.3x) 29.4 ms (0.3x) 29.8 ms (0.3x) 31.4 ms (0.3x)
String to Int (Adaptive) Write 167.9 ms (0.1x) 162.8 ms (0.1x) 155.5 ms (0.1x) 165.8 ms (0.1x) 169.2 ms (0.1x)
String to Int (Adaptive) Read 27.5 ms (0.3x) 26.9 ms (0.3x) 26.4 ms (0.3x) 26.6 ms (0.3x) 27.2 ms (0.3x)
String to Mixed (Adaptive) Write 274.3 ms (0.1x) 265.4 ms (0.1x) 248.9 ms (0.1x) 269.6 ms (0.1x) 279.0 ms (0.1x)
String to Mixed (Adaptive) Read 29.3 ms (0.3x) 29.1 ms (0.3x) 28.5 ms (0.3x) 29.2 ms (0.3x) 30.6 ms (0.3x)

API — Linux

Operation PHP 8.1 PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
putAll() 25.8 ms (1.3x) 25.9 ms (1.3x) 25.9 ms (1.4x) 25.9 ms (1.3x) 25.9 ms (1.4x)
fromArray() 25.9 ms (1.3x) 26.0 ms (1.3x) 25.7 ms (1.4x) 26.0 ms (1.3x) 25.9 ms (1.4x)
toArray() 26.0 ms (1.5x) 25.8 ms (1.5x) 24.5 ms (1.5x) 25.3 ms (1.5x) 26.0 ms (1.5x)
getAll() 1.4 ms (1.7x) 1.5 ms (1.6x) 1.5 ms (1.6x) 1.5 ms (1.6x) 1.5 ms (1.7x)
keys() 14.0 ms (1.9x) 12.0 ms (2.1x) 11.6 ms (2.2x) 11.9 ms (2.2x) 11.8 ms (2.2x)
values() 14.9 ms (1.8x) 12.7 ms (2.0x) 11.8 ms (2.1x) 12.6 ms (2.1x) 13.0 ms (2.0x)
sumValues() 8.6 ms (2.4x) 8.0 ms (2.5x) 7.7 ms (2.9x) 8.1 ms (2.5x) 8.1 ms (2.5x)
populationCount() 0.00 ms (214105x) 0.00 ms (205726x) 0.00 ms (217815x) 0.00 ms (211721x) 0.00 ms (213248x)
deleteRange() 51.7 ms (1.3x) 51.4 ms (1.3x) 51.4 ms (1.3x) 51.7 ms (1.3x) 52.6 ms (1.3x)
equals() 14.2 ms (3.6x) 13.8 ms (3.6x) 13.7 ms (3.8x) 14.6 ms (3.4x) 14.6 ms (3.6x)
union() Bitset 37.2 ms (0.2x) 37.4 ms (0.1x) 37.7 ms (0.1x) 37.7 ms (0.1x) 37.3 ms (0.1x)
intersect() Bitset 16.8 ms (0.3x) 16.7 ms (0.3x) 16.9 ms (0.3x) 16.8 ms (0.3x) 16.7 ms (0.3x)
diff() Bitset 16.7 ms (0.2x) 16.7 ms (0.2x) 16.8 ms (0.2x) 16.7 ms (0.2x) 16.8 ms (0.2x)
xor() Bitset 33.8 ms (0.5x) 33.9 ms (0.4x) 33.8 ms (0.4x) 34.0 ms (0.3x) 33.8 ms (0.4x)
mergeWith() Int→Int 68.7 ms (1.1x) 67.8 ms (1.1x) 67.7 ms (1.1x) 68.4 ms (1.1x) 69.8 ms (1.1x)
mergeWith() Str→Int 287.0 ms (~1.0x) 285.8 ms (~1.0x) 284.0 ms (~1.0x) 288.9 ms (~1.0x) 291.6 ms (~1.0x)
forEach() Int→Int 27.2 ms (0.9x) 26.9 ms (0.9x) 29.1 ms (0.8x) 28.1 ms (0.8x) 27.8 ms (0.8x)
filter() Int→Int 55.5 ms (0.8x) 54.1 ms (0.8x) 53.7 ms (0.8x) 51.7 ms (0.8x) 56.5 ms (0.8x)
map() Int→Int 57.8 ms (0.9x) 56.0 ms (~1.0x) 56.3 ms (~1.0x) 50.8 ms (~1.0x) 59.3 ms (0.9x)
forEach() Str→Int 71.7 ms (0.9x) 73.0 ms (0.9x) 71.2 ms (0.9x) 70.5 ms (0.9x) 74.5 ms (0.9x)
filter() Str→Int 148.8 ms (0.8x) 146.2 ms (0.8x) 146.6 ms (0.8x) 147.5 ms (0.8x) 149.7 ms (0.8x)
map() Str→Int 171.0 ms (~1.0x) 173.1 ms (~1.0x) 174.0 ms (~1.0x) 173.4 ms (~1.0x) 173.7 ms (~1.0x)
Cross-version detail (Windows)

Core Types — Windows

Each cell: Judy ms (speedup vs PHP array).

Type Op PHP 8.1 PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
Bitset Write 101.8 ms (0.1x) 97.6 ms (0.2x) 97.8 ms (0.1x) 102.1 ms (0.1x) 99.9 ms (0.1x)
Bitset Read 18.9 ms (0.4x) 26.8 ms (0.4x) 21.2 ms (0.4x) 19.3 ms (0.4x) 20.3 ms (0.4x)
Int to Int Write 76.4 ms (0.2x) 87.4 ms (0.1x) 77.7 ms (0.2x) 76.0 ms (0.2x) 80.0 ms (0.2x)
Int to Int Read 24.5 ms (0.3x) 33.9 ms (0.3x) 25.5 ms (0.3x) 24.5 ms (0.3x) 26.0 ms (0.3x)
Int to Mixed Write 93.5 ms (0.2x) 101.5 ms (0.2x) 93.2 ms (0.2x) 100.9 ms (0.2x) 103.7 ms (0.2x)
Int to Mixed Read 29.5 ms (0.4x) 31.1 ms (0.4x) 27.7 ms (0.4x) 28.0 ms (0.4x) 28.2 ms (0.3x)
Int to Packed Write 113.5 ms (0.2x) 144.5 ms (0.2x) 110.9 ms (0.2x) 121.5 ms (0.1x) 121.5 ms (0.1x)
Int to Packed Read 57.1 ms (0.2x) 81.3 ms (0.1x) 56.9 ms (0.2x) 58.2 ms (0.2x) 59.2 ms (0.2x)
String to Int Write 236.1 ms (0.1x) 235.0 ms (0.1x) 237.5 ms (0.1x) 231.7 ms (0.1x) 236.4 ms (0.1x)
String to Int Read 80.0 ms (0.1x) 83.9 ms (0.1x) 82.6 ms (0.2x) 75.7 ms (0.2x) 81.5 ms (0.1x)
String to Mixed Write 276.7 ms (0.1x) 275.9 ms (0.1x) 281.5 ms (0.1x) 279.7 ms (0.1x) 286.4 ms (0.1x)
String to Mixed Read 82.3 ms (0.2x) 87.7 ms (0.2x) 82.9 ms (0.2x) 79.9 ms (0.2x) 84.4 ms (0.2x)
String to Int (Hash) Write 414.3 ms (0.1x) 410.6 ms (0.1x) 417.3 ms (0.1x) 409.2 ms (0.1x) 422.1 ms (0.1x)
String to Int (Hash) Read 63.1 ms (0.2x) 69.1 ms (0.2x) 63.3 ms (0.2x) 62.3 ms (0.2x) 64.4 ms (0.2x)
String to Mixed (Hash) Write 562.9 ms (0.0x) 562.1 ms (0.1x) 568.5 ms (0.1x) 563.8 ms (0.1x) 575.1 ms (0.0x)
String to Mixed (Hash) Read 66.2 ms (0.2x) 65.4 ms (0.2x) 67.2 ms (0.2x) 64.9 ms (0.2x) 65.3 ms (0.2x)
String to Int (Adaptive) Write 370.6 ms (0.1x) 386.6 ms (0.1x) 373.2 ms (0.1x) 368.3 ms (0.1x) 369.8 ms (0.1x)
String to Int (Adaptive) Read 62.0 ms (0.2x) 60.7 ms (0.2x) 61.2 ms (0.2x) 60.1 ms (0.2x) 61.7 ms (0.2x)
String to Mixed (Adaptive) Write 581.1 ms (0.0x) 566.4 ms (0.1x) 585.6 ms (0.1x) 568.7 ms (0.1x) 586.9 ms (0.0x)
String to Mixed (Adaptive) Read 65.7 ms (0.2x) 65.5 ms (0.2x) 65.8 ms (0.2x) 64.0 ms (0.2x) 64.2 ms (0.2x)

API — Windows

Operation PHP 8.1 PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
putAll() 73.8 ms (1.2x) 75.0 ms (1.2x) 74.4 ms (1.2x) 73.8 ms (1.2x) 83.6 ms (1.3x)
fromArray() 74.6 ms (1.2x) 74.3 ms (1.2x) 74.3 ms (1.2x) 73.5 ms (1.2x) 78.5 ms (1.4x)
toArray() 82.1 ms (1.3x) 80.5 ms (1.3x) 80.3 ms (1.3x) 80.1 ms (1.3x) 86.9 ms (1.2x)
getAll() 2.5 ms (1.6x) 2.4 ms (1.7x) 2.4 ms (1.7x) 2.7 ms (1.5x) 2.9 ms (1.5x)
keys() 26.3 ms (1.8x) 22.6 ms (1.8x) 22.6 ms (1.8x) 22.5 ms (1.8x) 24.2 ms (1.9x)
values() 27.0 ms (1.7x) 23.0 ms (1.8x) 22.9 ms (1.8x) 23.2 ms (1.8x) 26.4 ms (1.7x)
sumValues() 17.5 ms (1.9x) 17.8 ms (1.9x) 17.9 ms (1.9x) 17.3 ms (1.9x) 19.9 ms (2.1x)
populationCount() 0.00 ms (341185x) 0.00 ms (343829x) 0.00 ms (356816x) 0.00 ms (339919x) 0.00 ms (363641x)
deleteRange() 141.2 ms (1.2x) 143.3 ms (1.2x) 141.4 ms (1.2x) 139.3 ms (1.2x) 161.8 ms (1.2x)
equals() 32.2 ms (2.7x) 32.3 ms (2.7x) 32.1 ms (2.7x) 31.3 ms (2.7x) 36.1 ms (2.8x)
union() Bitset 209.5 ms (0.1x) 170.7 ms (0.1x) 171.8 ms (0.1x) 176.0 ms (0.1x) 182.6 ms (0.1x)
intersect() Bitset 77.4 ms (0.1x) 77.4 ms (0.1x) 68.0 ms (0.1x) 71.2 ms (0.1x) 69.7 ms (0.1x)
diff() Bitset 69.0 ms (0.1x) 64.5 ms (0.1x) 64.7 ms (0.1x) 69.7 ms (0.1x) 68.1 ms (0.1x)
xor() Bitset 141.3 ms (0.2x) 134.1 ms (0.1x) 133.5 ms (0.1x) 141.7 ms (0.1x) 142.3 ms (0.1x)
mergeWith() Int→Int 168.9 ms (~1.0x) 167.7 ms (1.1x) 168.0 ms (1.1x) 166.8 ms (1.1x) 172.6 ms (1.3x)
mergeWith() Str→Int 622.1 ms (~1.0x) 623.6 ms (~1.0x) 624.7 ms (~1.0x) 623.7 ms (~1.0x) 627.5 ms (~1.0x)
forEach() Int→Int 39.0 ms (0.9x) 38.8 ms (~1.0x) 42.1 ms (0.9x) 40.4 ms (0.9x) 47.4 ms (0.8x)
filter() Int→Int 90.6 ms (0.9x) 95.9 ms (0.8x) 89.7 ms (0.9x) 90.3 ms (0.9x) 94.5 ms (0.8x)
map() Int→Int 109.5 ms (~1.0x) 115.0 ms (~1.0x) 109.1 ms (1.1x) 114.7 ms (~1.0x) 116.8 ms (0.9x)
forEach() Str→Int 127.3 ms (0.9x) 127.7 ms (0.9x) 128.2 ms (0.9x) 134.8 ms (0.9x) 159.1 ms (0.8x)
filter() Str→Int 282.8 ms (0.8x) 279.8 ms (0.8x) 282.7 ms (0.8x) 282.0 ms (0.8x) 286.3 ms (0.8x)
map() Str→Int 352.3 ms (~1.0x) 346.2 ms (~1.0x) 353.7 ms (~1.0x) 351.7 ms (~1.0x) 441.9 ms (0.8x)
Windows results (PHP 8.5)

Memory Efficiency (Windows, PHP 8.5)

Type Judy PHP array Savings
Bitset 160 B 10.0 MB 65536.5x less
Int to Int 160 B 10.0 MB 65536.5x less
Int to Mixed 7.6 MB 10.0 MB 1.3x less
Int to Packed 13.3 MB 10.0 MB 0.8x
String to Int 64.2 KB 20.0 MB 319.2x less
String to Mixed 7.7 MB 20.0 MB 2.6x less
String to Int (Hash) 64.2 KB 20.0 MB 319.2x less
String to Mixed (Hash) 7.7 MB 20.0 MB 2.6x less
String to Int (Adaptive) 64.2 KB 20.0 MB 319.2x less
String to Mixed (Adaptive) 7.7 MB 20.0 MB 2.6x less

API Speedups (Windows, PHP 8.5)

Speedup = PHP time / Judy time. Bold = Judy faster.

Operation Judy PHP Speedup
putAll() 83.6 ms 107.1 ms 1.3x
fromArray() 78.5 ms 107.1 ms 1.4x
toArray() 86.9 ms 106.5 ms 1.2x
getAll() 2.9 ms 4.3 ms 1.5x
keys() 24.2 ms 45.0 ms 1.9x
values() 26.4 ms 44.9 ms 1.7x
sumValues() 19.9 ms 41.6 ms 2.1x
populationCount() 0.00 ms 36.4 ms 363641x
deleteRange() 161.8 ms 191.7 ms 1.2x
equals() 36.1 ms 99.5 ms 2.8x
union() Bitset 182.6 ms 13.3 ms 0.1x
intersect() Bitset 69.7 ms 8.0 ms 0.1x
diff() Bitset 68.1 ms 4.6 ms 0.1x
xor() Bitset 142.3 ms 19.8 ms 0.1x
mergeWith() Int→Int 172.6 ms 217.4 ms 1.3x
mergeWith() Str→Int 627.5 ms 624.6 ms ~1.0x
forEach() Int→Int 47.4 ms 37.4 ms 0.8x
filter() Int→Int 94.5 ms 79.3 ms 0.8x
map() Int→Int 116.8 ms 110.8 ms 0.9x
forEach() Str→Int 159.1 ms 122.7 ms 0.8x
filter() Str→Int 286.3 ms 241.0 ms 0.8x
map() Str→Int 441.9 ms 353.4 ms 0.8x

Core Types (Windows, PHP 8.5)

Speedup = PHP time / Judy time. Bold = Judy faster.

Type Op Judy PHP array Speedup
Bitset Write 99.9 ms 12.1 ms 0.1x
Bitset Read 20.3 ms 8.6 ms 0.4x
Bitset Iter 28.7 ms 7.3 ms 0.3x
Bitset Free 0.01 ms 0.55 ms 44.2x
Int to Int Write 80.0 ms 12.1 ms 0.2x
Int to Int Read 26.0 ms 8.3 ms 0.3x
Int to Int Iter 32.0 ms 7.3 ms 0.2x
Int to Int Free 1.1 ms 0.54 ms 0.5x
Int to Mixed Write 103.7 ms 16.0 ms 0.2x
Int to Mixed Read 28.2 ms 9.7 ms 0.3x
Int to Mixed Iter 34.1 ms 7.7 ms 0.2x
Int to Mixed Free 34.4 ms 5.0 ms 0.1x
String to Int Write 236.4 ms 25.2 ms 0.1x
String to Int Read 81.5 ms 11.9 ms 0.1x
String to Int Iter 113.9 ms 8.5 ms 0.1x
String to Int Free 43.4 ms 1.8 ms 0.0x
String to Int (Adaptive) Write 369.8 ms 25.1 ms 0.1x
String to Int (Adaptive) Read 61.7 ms 11.9 ms 0.2x
String to Int (Adaptive) Iter 176.0 ms 8.4 ms 0.0x
String to Int (Adaptive) Free 98.7 ms 1.9 ms 0.0x
All types detail

Core Types (Windows, PHP 8.5) — All

Speedup = PHP time / Judy time. Bold = Judy faster.

Type Op Judy PHP array Speedup
Bitset Write 99.9 ms 12.1 ms 0.1x
Bitset Read 20.3 ms 8.6 ms 0.4x
Bitset Iter 28.7 ms 7.3 ms 0.3x
Bitset Free 0.01 ms 0.55 ms 44.2x
Int to Int Write 80.0 ms 12.1 ms 0.2x
Int to Int Read 26.0 ms 8.3 ms 0.3x
Int to Int Iter 32.0 ms 7.3 ms 0.2x
Int to Int Free 1.1 ms 0.54 ms 0.5x
Int to Mixed Write 103.7 ms 16.0 ms 0.2x
Int to Mixed Read 28.2 ms 9.7 ms 0.3x
Int to Mixed Iter 34.1 ms 7.7 ms 0.2x
Int to Mixed Free 34.4 ms 5.0 ms 0.1x
Int to Packed Write 121.5 ms 16.5 ms 0.1x
Int to Packed Read 59.2 ms 10.5 ms 0.2x
Int to Packed Iter 64.5 ms 7.6 ms 0.1x
Int to Packed Free 28.2 ms 4.8 ms 0.2x
String to Int Write 236.4 ms 25.2 ms 0.1x
String to Int Read 81.5 ms 11.9 ms 0.1x
String to Int Iter 113.9 ms 8.5 ms 0.1x
String to Int Free 43.4 ms 1.8 ms 0.0x
String to Mixed Write 286.4 ms 28.5 ms 0.1x
String to Mixed Read 84.4 ms 14.4 ms 0.2x
String to Mixed Iter 127.2 ms 9.3 ms 0.1x
String to Mixed Free 145.9 ms 9.4 ms 0.1x
String to Int (Hash) Write 422.1 ms 25.1 ms 0.1x
String to Int (Hash) Read 64.4 ms 12.1 ms 0.2x
String to Int (Hash) Iter 178.0 ms 8.1 ms 0.0x
String to Int (Hash) Free 98.4 ms 1.8 ms 0.0x
String to Mixed (Hash) Write 575.1 ms 28.3 ms 0.0x
String to Mixed (Hash) Read 65.3 ms 14.5 ms 0.2x
String to Mixed (Hash) Iter 207.4 ms 9.5 ms 0.0x
String to Mixed (Hash) Free 294.1 ms 8.6 ms 0.0x
String to Int (Adaptive) Write 369.8 ms 25.1 ms 0.1x
String to Int (Adaptive) Read 61.7 ms 11.9 ms 0.2x
String to Int (Adaptive) Iter 176.0 ms 8.4 ms 0.0x
String to Int (Adaptive) Free 98.7 ms 1.9 ms 0.0x
String to Mixed (Adaptive) Write 586.9 ms 28.4 ms 0.0x
String to Mixed (Adaptive) Read 64.2 ms 14.7 ms 0.2x
String to Mixed (Adaptive) Iter 214.6 ms 10.1 ms 0.0x
String to Mixed (Adaptive) Free 332.7 ms 9.3 ms 0.0x

Release Comparison (2.3.0 → 2.4.0)

Baseline: v2.3.0 via pie install on same CI runner. Comparing Linux PHP 8.5. Threshold: ±10% (entries < 2 ms ignored).

Summary: 5 faster, ⚠️ 1 regressions, 14 unchanged, 50 new

Benchmark Baseline Current Delta Status
core.bitset.free 0.01 ms 0.01 ms 0.0% ~same
core.bitset.iter 91.4 ms 18.4 ms -79.9% FASTER
core.bitset.read 11.2 ms 11.4 ms +1.7% ~same
core.bitset.write 19.4 ms 20.2 ms +4.4% ~same
core.int_to_int.free 0.63 ms 0.48 ms 0.0% ~same
core.int_to_int.iter 90.5 ms 19.8 ms -78.1% FASTER
core.int_to_int.read 13.0 ms 13.4 ms +3.0% ~same
core.int_to_int.write 24.1 ms 29.5 ms +22.4% ⚠️ SLOWER
core.int_to_mixed.free 15.9 ms 15.0 ms -5.2% ~same
core.int_to_mixed.iter 91.5 ms 21.4 ms -76.6% FASTER
core.int_to_mixed.read 16.5 ms 17.0 ms +3.1% ~same
core.int_to_mixed.write 41.7 ms 39.1 ms -6.3% ~same
core.string_to_int.free 22.2 ms 22.4 ms +1.2% ~same
core.string_to_int.iter 169.9 ms 64.1 ms -62.3% FASTER
core.string_to_int.read 41.3 ms 41.3 ms -0.1% ~same
core.string_to_int.write 103.0 ms 102.2 ms -0.8% ~same
core.string_to_mixed.free 78.1 ms 76.3 ms -2.3% ~same
core.string_to_mixed.iter 184.7 ms 74.3 ms -59.8% FASTER
core.string_to_mixed.read 44.7 ms 45.4 ms +1.4% ~same
core.string_to_mixed.write 130.6 ms 127.7 ms -2.2% ~same

Memory Comparison

Memory: ⚠️ 3 regressions, 2 unchanged

Type Baseline Current Delta Status
Bitset 128 B 160 B +25.0% ⚠️ WORSE
Int to Int 128 B 160 B +25.0% ⚠️ WORSE
Int to Mixed 7.6 MB 7.6 MB 0.0% ~same
String to Int 128 B 64.2 KB +51225.0% ⚠️ WORSE
String to Mixed 7.6 MB 7.7 MB +0.8% ~same
50 new benchmarks (not in baseline)
Benchmark Current
adv.filter.int_to_int 56.5 ms
adv.filter.string_to_int 149.7 ms
adv.forEach.int_to_int 27.8 ms
adv.forEach.string_to_int 74.5 ms
adv.map.int_to_int 59.3 ms
adv.map.string_to_int 173.7 ms
api.deleteRange.int_to_int 52.6 ms
api.equals.int_to_int 14.6 ms
api.fromArray.int_to_int 25.9 ms
api.getAll.int_to_int 1.5 ms
api.increment.int_to_int 28.4 ms
api.keys.int_to_int 11.8 ms
api.mergeWith.int_to_int 69.8 ms
api.mergeWith.string_to_int 291.6 ms
api.populationCount.int_to_int 0.00 ms
api.putAll.int_to_int 25.9 ms
api.setop.diff.bitset 16.8 ms
api.setop.diff.int_to_int 20.7 ms
api.setop.diff.string_to_int 134.9 ms
api.setop.intersect.bitset 16.7 ms
api.setop.intersect.int_to_int 21.6 ms
api.setop.intersect.string_to_int 136.9 ms
api.setop.union.bitset 37.3 ms
api.setop.union.int_to_int 54.0 ms
api.setop.union.string_to_int 366.9 ms
api.setop.xor.bitset 33.8 ms
api.setop.xor.int_to_int 43.2 ms
api.sumValues.int_to_int 8.1 ms
api.toArray.int_to_int 26.0 ms
api.values.int_to_int 13.0 ms
core.int_to_packed.free 9.6 ms
core.int_to_packed.iter 39.4 ms
core.int_to_packed.read 33.9 ms
core.int_to_packed.write 51.3 ms
core.string_to_int_adaptive.free 49.0 ms
core.string_to_int_adaptive.iter 79.5 ms
core.string_to_int_adaptive.read 27.2 ms
core.string_to_int_adaptive.write 169.2 ms
core.string_to_int_hash.free 49.0 ms
core.string_to_int_hash.iter 80.2 ms
core.string_to_int_hash.read 27.7 ms
core.string_to_int_hash.write 183.5 ms
core.string_to_mixed_adaptive.free 144.4 ms
core.string_to_mixed_adaptive.iter 105.2 ms
core.string_to_mixed_adaptive.read 30.6 ms
core.string_to_mixed_adaptive.write 279.0 ms
core.string_to_mixed_hash.free 141.5 ms
core.string_to_mixed_hash.iter 105.5 ms
core.string_to_mixed_hash.read 31.4 ms
core.string_to_mixed_hash.write 276.1 ms
Full benchmark output

Linux — PHP 8.5

══════════════════════════════════════════════════════════════════════════════════════════
  php-judy Benchmark Suite — 500,000 elements, 7 iterations (median)
  PHP 8.5.3 | Judy ext 2.4.0 | Linux x86_64
  Suite: all
══════════════════════════════════════════════════════════════════════════════════════════

── Core: Integer-Keyed Types ────────────────────────────────────────────────

  Type                         Write(ms)      Read(ms)      Iter(ms)      Free(ms)          Heap
  ────────────────────────  ────────────  ────────────  ────────────  ────────────  ────────────
  BITSET                           20.22         11.43         18.38          0.01         160 B
    PHP array                       6.96          3.84          3.11          0.35        8.0 MB
  INT_TO_INT                       29.54         13.41         19.84          0.48         160 B
    PHP array                       7.26          3.86          3.12          0.32        8.0 MB
  INT_TO_MIXED                     39.10         16.97         21.43         15.03        7.6 MB
    PHP array                      11.81          8.03          3.82          4.21        8.0 MB
  INT_TO_PACKED                    51.32         33.93         39.39          9.63       13.3 MB
    PHP array                      10.16          6.10          4.02          4.37        8.0 MB

── Core: String-Keyed Types ────────────────────────────────────────────────

  Type                         Write(ms)      Read(ms)      Iter(ms)      Free(ms)          Heap
  ────────────────────────  ────────────  ────────────  ────────────  ────────────  ────────────
  STRING_TO_INT                   102.18         41.30         64.10         22.41       64.2 KB
    PHP array                      16.63          7.90          4.62          1.18       20.0 MB
  STRING_TO_MIXED                 127.68         45.37         74.27         76.29        7.7 MB
    PHP array                      19.81         10.29          6.05          6.66       20.0 MB
  STR_TO_INT_HASH                 183.48         27.69         80.25         49.04       64.2 KB
    PHP array                      17.93          8.00          4.60          1.41       20.0 MB
  STR_TO_MIX_HASH                 276.14         31.38        105.46        141.46        7.7 MB
    PHP array                      21.26         10.45          6.60          7.53       20.0 MB
  STR_INT_ADAPTIVE                169.15         27.23         79.47         48.95       64.2 KB
    PHP array                      17.50          8.17          4.58          1.26       20.0 MB
  STR_MIX_ADAPTIVE                278.97         30.60        105.16        144.40        7.7 MB
    PHP array                      20.81         10.65          6.48          7.23       20.0 MB

── API: Batch Operations (INT_TO_INT) ────────────────────────────────────────

  Operation                           Judy(ms)       PHP(ms)     Speedup
  ──────────────────────────────  ────────────  ────────────  ──────────
  putAll()                               25.91         35.43        1.4x
  fromArray()                            25.88         35.43        1.4x
  toArray()                              25.99         39.52        1.5x
  getAll(50100 keys)                      1.48          2.57        1.7x
  increment(500000 ops/1000 keys)         28.39         10.12        0.4x

── API: Native Methods (keys, values, sum, popCount, deleteRange, equals) ────

  Operation                           Judy(ms)       PHP(ms)     Speedup
  ──────────────────────────────  ────────────  ────────────  ──────────
  keys() INT_TO_INT                      11.81         25.83        2.2x
  values() INT_TO_INT                    13.02         25.73        2.0x
  sumValues() INT_TO_INT                  8.06         19.87        2.5x
  populationCount() INT_TO_INT            0.00         21.32   300349.3x
  deleteRange() INT_TO_INT mid50%         52.64         70.61        1.3x
  equals() INT_TO_INT                    14.57         52.91        3.6x

── API: Set Operations (BITSET, 50% overlap) ────────────────────────────────

  Operation                           Judy(ms)       PHP(ms)     Speedup
  ──────────────────────────────  ────────────  ────────────  ──────────
  union() BITSET                         37.35          4.73        0.1x
  intersect() BITSET                     16.74          5.77        0.3x
  diff() BITSET                          16.76          3.16        0.2x
  xor() BITSET                           33.78         11.90        0.4x
  union() INT_TO_INT                     53.98         95.48        1.8x
  intersect() INT_TO_INT                 21.61         45.60        2.1x
  diff() INT_TO_INT                      20.73         48.04        2.3x
  xor() INT_TO_INT                       43.20         96.52        2.2x
  union() STRING_TO_INT                 366.87        354.73        1.0x
  intersect() STRING_TO_INT             136.94        155.11        1.1x
  diff() STRING_TO_INT                  134.93        152.88        1.1x
  mergeWith() INT_TO_INT                 69.77         77.62        1.1x
  mergeWith() STRING_TO_INT             291.58        285.03        1.0x

── Advanced: C-Level forEach/filter/map ──────────────────────────────────────

  Operation                        C-level(ms)       PHP(ms)     Speedup
  ──────────────────────────────  ────────────  ────────────  ──────────
  forEach() INT_TO_INT                   27.76         22.26        0.8x
  forEach() STRING_TO_INT                74.52         65.87        0.9x
  filter() INT_TO_INT (50% pass)         56.47         43.25        0.8x
  filter() STRING_TO_INT (50% pass)        149.67        123.91        0.8x
  map() INT_TO_INT (*2)                  59.31         55.52        0.9x
  map() STRING_TO_INT (*2)              173.70        170.66        1.0x

── Advanced: Adaptive SSO — short keys (<8 bytes) via JudyL ─────────────────

  Operation                   STR_TO_INT    STR_INT_HASH   STR_INT_ADPTV    Best ratio
  ──────────────────────  ──────────────  ──────────────  ──────────────  ────────────
  insert (short keys)          77.05 ms      134.97 ms      117.67 ms       1.8x
  read (random access)         23.31 ms       19.13 ms       25.48 ms       1.2x
  foreach (iterate all)        50.79 ms      104.71 ms      101.08 ms       2.1x

── Advanced: Adaptive SSO — long keys (>=8 bytes) fallback to JudyHS ────────

  Operation                   STR_TO_INT    STR_INT_HASH   STR_INT_ADPTV    Best ratio
  ──────────────────────  ──────────────  ──────────────  ──────────────  ────────────
  insert (long keys)          130.47 ms      230.10 ms      206.84 ms       1.8x
  read (random access)         56.49 ms       44.06 ms       42.88 ms       1.3x
  foreach (iterate all)        98.70 ms      113.88 ms      113.79 ms       1.2x

══════════════════════════════════════════════════════════════════════════════════════════
  Benchmark complete — 2026-03-03 03:56:14
  All timings: median of 7 iterations via hrtime(true), 1 warmup run
══════════════════════════════════════════════════════════════════════════════════════════

  JSON results written to: bench.json

Windows — PHP 8.5

══════════════════════════════════════════════════════════════════════════════════════════
  php-judy Benchmark Suite — 500,000 elements, 7 iterations (median)
  PHP 8.5.3 | Judy ext 2.4.0 | WINNT AMD64
  Suite: all
══════════════════════════════════════════════════════════════════════════════════════════

── Core: Integer-Keyed Types ────────────────────────────────────────────────

  Type                         Write(ms)      Read(ms)      Iter(ms)      Free(ms)          Heap
  ────────────────────────  ────────────  ────────────  ────────────  ────────────  ────────────
  BITSET                           99.89         20.32         28.68          0.01         160 B
    PHP array                      12.06          8.56          7.27          0.55       10.0 MB
  INT_TO_INT                       80.00         26.00         32.03          1.09         160 B
    PHP array                      12.13          8.32          7.31          0.54       10.0 MB
  INT_TO_MIXED                    103.68         28.24         34.14         34.42        7.6 MB
    PHP array                      16.01          9.70          7.68          5.05       10.0 MB
  INT_TO_PACKED                   121.53         59.20         64.52         28.20       13.3 MB
    PHP array                      16.49         10.47          7.61          4.83       10.0 MB

── Core: String-Keyed Types ────────────────────────────────────────────────

  Type                         Write(ms)      Read(ms)      Iter(ms)      Free(ms)          Heap
  ────────────────────────  ────────────  ────────────  ────────────  ────────────  ────────────
  STRING_TO_INT                   236.38         81.48        113.90         43.37       64.2 KB
    PHP array                      25.22         11.91          8.51          1.84       20.0 MB
  STRING_TO_MIXED                 286.42         84.45        127.22        145.87        7.7 MB
    PHP array                      28.54         14.36          9.27          9.39       20.0 MB
  STR_TO_INT_HASH                 422.07         64.45        177.99         98.40       64.2 KB
    PHP array                      25.13         12.08          8.06          1.83       20.0 MB
  STR_TO_MIX_HASH                 575.07         65.28        207.41        294.10        7.7 MB
    PHP array                      28.29         14.54          9.55          8.61       20.0 MB
  STR_INT_ADAPTIVE                369.83         61.71        176.04         98.71       64.2 KB
    PHP array                      25.14         11.90          8.43          1.90       20.0 MB
  STR_MIX_ADAPTIVE                586.86         64.18        214.60        332.72        7.7 MB
    PHP array                      28.36         14.72         10.07          9.34       20.0 MB

── API: Batch Operations (INT_TO_INT) ────────────────────────────────────────

  Operation                           Judy(ms)       PHP(ms)     Speedup
  ──────────────────────────────  ────────────  ────────────  ──────────
  putAll()                               83.56        107.10        1.3x
  fromArray()                            78.46        107.10        1.4x
  toArray()                              86.89        106.49        1.2x
  getAll(50100 keys)                      2.87          4.27        1.5x
  increment(500000 ops/1000 keys)         60.17         26.34        0.4x

── API: Native Methods (keys, values, sum, popCount, deleteRange, equals) ────

  Operation                           Judy(ms)       PHP(ms)     Speedup
  ──────────────────────────────  ────────────  ────────────  ──────────
  keys() INT_TO_INT                      24.25         44.96        1.9x
  values() INT_TO_INT                    26.43         44.92        1.7x
  sumValues() INT_TO_INT                 19.90         41.59        2.1x
  populationCount() INT_TO_INT            0.00         36.36   363641.0x
  deleteRange() INT_TO_INT mid50%        161.84        191.68        1.2x
  equals() INT_TO_INT                    36.07         99.48        2.8x

── API: Set Operations (BITSET, 50% overlap) ────────────────────────────────

  Operation                           Judy(ms)       PHP(ms)     Speedup
  ──────────────────────────────  ────────────  ────────────  ──────────
  union() BITSET                        182.60         13.33        0.1x
  intersect() BITSET                     69.70          8.04        0.1x
  diff() BITSET                          68.06          4.60        0.1x
  xor() BITSET                          142.30         19.76        0.1x
  union() INT_TO_INT                    161.94        236.89        1.5x
  intersect() INT_TO_INT                 68.48        101.58        1.5x
  diff() INT_TO_INT                      64.18        108.81        1.7x
  xor() INT_TO_INT                      123.33        219.38        1.8x
  union() STRING_TO_INT                 774.80        899.70        1.2x
  intersect() STRING_TO_INT             301.42        328.73        1.1x
  diff() STRING_TO_INT                  287.78        313.64        1.1x
  mergeWith() INT_TO_INT                172.65        217.36        1.3x
  mergeWith() STRING_TO_INT             627.53        624.64        1.0x

── Advanced: C-Level forEach/filter/map ──────────────────────────────────────

  Operation                        C-level(ms)       PHP(ms)     Speedup
  ──────────────────────────────  ────────────  ────────────  ──────────
  forEach() INT_TO_INT                   47.45         37.44        0.8x
  forEach() STRING_TO_INT               159.05        122.70        0.8x
  filter() INT_TO_INT (50% pass)         94.47         79.32        0.8x
  filter() STRING_TO_INT (50% pass)        286.27        241.03        0.8x
  map() INT_TO_INT (*2)                 116.83        110.85        0.9x
  map() STRING_TO_INT (*2)              441.92        353.43        0.8x

── Advanced: Adaptive SSO — short keys (<8 bytes) via JudyL ─────────────────

  Operation                   STR_TO_INT    STR_INT_HASH   STR_INT_ADPTV    Best ratio
  ──────────────────────  ──────────────  ──────────────  ──────────────  ────────────
  insert (short keys)         176.16 ms      323.97 ms      275.93 ms       1.8x
  read (random access)         30.86 ms       32.14 ms       29.58 ms       1.1x
  foreach (iterate all)        87.12 ms      171.67 ms      158.97 ms       2.0x

── Advanced: Adaptive SSO — long keys (>=8 bytes) fallback to JudyHS ────────

  Operation                   STR_TO_INT    STR_INT_HASH   STR_INT_ADPTV    Best ratio
  ──────────────────────  ──────────────  ──────────────  ──────────────  ────────────
  insert (long keys)          303.81 ms      536.79 ms      471.56 ms       1.8x
  read (random access)         58.69 ms       51.53 ms       52.59 ms       1.1x
  foreach (iterate all)       185.72 ms      268.53 ms      268.73 ms       1.4x

══════════════════════════════════════════════════════════════════════════════════════════
  Benchmark complete — 2026-03-03 03:58:45
  All timings: median of 7 iterations via hrtime(true), 1 warmup run
══════════════════════════════════════════════════════════════════════════════════════════

  JSON results written to: bench.json

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request provides a comprehensive documentation update for the v2.4.0 release. It introduces a new API.md file, updates the README.md and BENCHMARK.md to reflect the new Judy types, and prepares the package.xml for the release. The documentation changes are thorough and greatly improve clarity for developers. I have one suggestion to enhance the consistency of a table in API.md.

Address Gemini Code Assist review: use STR_INT and STR_MIXED column
headers consistently with the other abbreviated string-keyed types.
@orieg orieg merged commit af0035b into main Mar 3, 2026
13 checks passed
@orieg orieg deleted the docs/v2.4.0-pre-release-docs branch March 3, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant