Skip to content

Commit

Permalink
feat!: Add snippet u64::trailing_zeros
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Remove snippet `u64::index_of_last_nonzero_bit`, which
more or less computes the same thing as `trailing_zeros`, but is less
efficient, less general since it fails on input “0”, and uses an
uncommon name.
  • Loading branch information
jan-ferdinand committed Jan 7, 2025
1 parent 1b1a18e commit a376c4a
Show file tree
Hide file tree
Showing 8 changed files with 178 additions and 289 deletions.

This file was deleted.

24 changes: 24 additions & 0 deletions tasm-lib/benchmarks/tasmlib_arithmetic_u64_trailing_zeros.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[
{
"name": "tasmlib_arithmetic_u64_trailing_zeros",
"benchmark_result": {
"clock_cycle_count": 29,
"hash_table_height": 42,
"u32_table_height": 83,
"op_stack_table_height": 17,
"ram_table_height": 0
},
"case": "CommonCase"
},
{
"name": "tasmlib_arithmetic_u64_trailing_zeros",
"benchmark_result": {
"clock_cycle_count": 30,
"hash_table_height": 42,
"u32_table_height": 99,
"op_stack_table_height": 19,
"ram_table_height": 0
},
"case": "WorstCase"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
{
"name": "tasmlib_mmr_calculate_new_peaks_from_append",
"benchmark_result": {
"clock_cycle_count": 3569,
"hash_table_height": 390,
"u32_table_height": 197,
"clock_cycle_count": 3560,
"hash_table_height": 378,
"u32_table_height": 131,
"op_stack_table_height": 3438,
"ram_table_height": 942
},
Expand All @@ -13,10 +13,10 @@
{
"name": "tasmlib_mmr_calculate_new_peaks_from_append",
"benchmark_result": {
"clock_cycle_count": 7035,
"hash_table_height": 576,
"u32_table_height": 165,
"op_stack_table_height": 6806,
"clock_cycle_count": 7014,
"hash_table_height": 564,
"u32_table_height": 130,
"op_stack_table_height": 6798,
"ram_table_height": 1872
},
"case": "WorstCase"
Expand Down
2 changes: 1 addition & 1 deletion tasm-lib/src/arithmetic/u64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ pub mod div_mod;
pub mod double_pow2;
pub mod eq;
pub mod incr;
pub mod index_of_last_nonzero_bit;
pub mod leading_zeros;
pub mod log_2_floor;
pub mod lt;
Expand All @@ -21,6 +20,7 @@ pub mod safe_mul;
pub mod shift_left;
pub mod shift_right;
pub mod sub;
pub mod trailing_zeros;
pub mod wrapping_mul;
pub mod wrapping_sub;
pub mod xor;
254 changes: 0 additions & 254 deletions tasm-lib/src/arithmetic/u64/index_of_last_nonzero_bit.rs

This file was deleted.

Loading

0 comments on commit a376c4a

Please sign in to comment.