Skip to content

chore: strip out duplicate implementations of fixed and variable length keys #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 11, 2025

Conversation

TomAFrench
Copy link
Member

…th keys

Description

Problem*

Resolves

Summary*

I realised while reviewing #82 that we've got half of the library being duplicated for fixed-length and variable length keys. This PR strips out all of these so that the fixed-length methods just delegate to the variable length methods.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@github-project-automation github-project-automation bot moved this to 👀 To Triage in Noir Libraries Aug 11, 2025
@TomAFrench TomAFrench changed the title chore: strip out duplicate implementations of fixed and variable leng… chore: strip out duplicate implementations of fixed and variable length keys Aug 11, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

ACIR Opcodes

Benchmark suite Current: 19832cd Previous: 3a46322 Ratio
get_array_JSON16kb_Bench.json/main 42557 acir_opcodes 42557 acir_opcodes 1
get_array_JSON512b_Bench.json/main 2365 acir_opcodes 2365 acir_opcodes 1
get_keys_at_root_JSON16kb_Bench.json/main 3349896 acir_opcodes 3349896 acir_opcodes 1
get_keys_at_root_JSON512b_Bench.json/main 3334024 acir_opcodes 3334024 acir_opcodes 1
get_literal_JSON16kb_Bench.json/main 17711 acir_opcodes 17711 acir_opcodes 1
get_literal_JSON512b_Bench.json/main 1839 acir_opcodes 1839 acir_opcodes 1
get_number_JSON16kb_Bench.json/main 17838 acir_opcodes 17838 acir_opcodes 1
get_number_JSON512b_Bench.json/main 1966 acir_opcodes 1966 acir_opcodes 1
get_object_JSON16kb_Bench.json/main 42557 acir_opcodes 42557 acir_opcodes 1
get_object_JSON512b_Bench.json/main 2365 acir_opcodes 2365 acir_opcodes 1
get_string_JSON16kb_Bench.json/main 42695 acir_opcodes 42695 acir_opcodes 1
get_string_JSON512b_Bench.json/main 26823 acir_opcodes 26823 acir_opcodes 1
get_value_JSON16kb_Bench.json/main 20188 acir_opcodes 20188 acir_opcodes 1
get_value_JSON512b_Bench.json/main 4316 acir_opcodes 4316 acir_opcodes 1
key_exists_JSON16kb_Bench.json/main 18077 acir_opcodes 18077 acir_opcodes 1
key_exists_JSON512b_Bench.json/main 2205 acir_opcodes 2205 acir_opcodes 1
parse_json_from_string_JSON16kb_Bench.json/main 1098668 acir_opcodes 1098668 acir_opcodes 1
parse_json_from_string_JSON512b_Bench.json/main 38179 acir_opcodes 38179 acir_opcodes 1

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Circuit Size

Benchmark suite Current: 19832cd Previous: 3a46322 Ratio
get_array_JSON16kb_Bench.json/main 54968 circuit_size 54968 circuit_size 1
get_array_JSON512b_Bench.json/main 5848 circuit_size 5848 circuit_size 1
get_keys_at_root_JSON16kb_Bench.json/main 3380422 circuit_size 3380422 circuit_size 1
get_keys_at_root_JSON512b_Bench.json/main 3354628 circuit_size 3354628 circuit_size 1
get_literal_JSON16kb_Bench.json/main 32183 circuit_size 32183 circuit_size 1
get_literal_JSON512b_Bench.json/main 6389 circuit_size 6389 circuit_size 1
get_number_JSON16kb_Bench.json/main 32612 circuit_size 32612 circuit_size 1
get_number_JSON512b_Bench.json/main 6883 circuit_size 6883 circuit_size 1
get_object_JSON16kb_Bench.json/main 54968 circuit_size 54968 circuit_size 1
get_object_JSON512b_Bench.json/main 5848 circuit_size 5848 circuit_size 1
get_string_JSON16kb_Bench.json/main 252831 circuit_size 252831 circuit_size 1
get_string_JSON512b_Bench.json/main 227999 circuit_size 227999 circuit_size 1
get_value_JSON16kb_Bench.json/main 35344 circuit_size 35344 circuit_size 1
get_value_JSON512b_Bench.json/main 9550 circuit_size 9550 circuit_size 1
key_exists_JSON16kb_Bench.json/main 31277 circuit_size 31277 circuit_size 1
key_exists_JSON512b_Bench.json/main 9452 circuit_size 9452 circuit_size 1
parse_json_from_string_JSON16kb_Bench.json/main 1473490 circuit_size 1473490 circuit_size 1
parse_json_from_string_JSON512b_Bench.json/main 68763 circuit_size 68763 circuit_size 1

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Brillig Bytecode Size

Benchmark suite Current: 19832cd Previous: 3a46322 Ratio
get_array_JSON16kb_Bench 18479 opcodes 18475 opcodes 1.00
get_array_JSON512b_Bench 2607 opcodes 2603 opcodes 1.00
get_keys_at_root_JSON16kb_Bench 43657 opcodes 43657 opcodes 1
get_keys_at_root_JSON512b_Bench 27784 opcodes 27784 opcodes 1
get_literal_JSON16kb_Bench 22319 opcodes 22316 opcodes 1.00
get_literal_JSON512b_Bench 6446 opcodes 6443 opcodes 1.00
get_number_JSON16kb_Bench 22628 opcodes 22625 opcodes 1.00
get_number_JSON512b_Bench 6755 opcodes 6752 opcodes 1.00
get_object_JSON16kb_Bench 18478 opcodes 18475 opcodes 1.00
get_object_JSON512b_Bench 2606 opcodes 2603 opcodes 1.00
get_string_JSON16kb_Bench 24433 opcodes 24430 opcodes 1.00
get_string_JSON512b_Bench 8560 opcodes 8557 opcodes 1.00
get_value_JSON16kb_Bench 23483 opcodes 23480 opcodes 1.00
get_value_JSON512b_Bench 7610 opcodes 7607 opcodes 1.00
key_exists_JSON16kb_Bench 18129 opcodes 18129 opcodes 1
key_exists_JSON512b_Bench 2257 opcodes 2257 opcodes 1
parse_json_from_string_JSON16kb_Bench 16913 opcodes 16913 opcodes 1
parse_json_from_string_JSON512b_Bench 16903 opcodes 16903 opcodes 1

This comment was automatically generated by workflow using github-action-benchmark.

@TomAFrench TomAFrench requested a review from jialinli98 August 11, 2025 10:07
@TomAFrench TomAFrench merged commit 33bf554 into main Aug 11, 2025
17 checks passed
@github-project-automation github-project-automation bot moved this from 👀 To Triage to ✅ Done in Noir Libraries Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

1 participant