@@ -9,34 +9,45 @@ use crate::{
9
9
treepp:: * ,
10
10
} ;
11
11
12
+ use super :: arithmetics:: u29x9:: u29x9_mul_karazuba;
13
+
12
14
#[ test]
13
15
#[ ignore = "performance debugging" ]
14
16
fn debug_mul_performance_comparison ( ) {
15
- let naive_script_narrow = U254 :: OP_MUL ( ) ;
16
- let windowed_script_narrow = U254Windowed :: OP_MUL ( ) ;
17
+ let naive_script_overflowing = U254 :: OP_MUL ( ) ;
18
+ let windowed_script_overflowing = U254Windowed :: OP_MUL ( ) ;
17
19
18
- let naive_script_wide = U254 :: OP_WIDENINGMUL :: < U508 > ( ) ;
19
- let windowed_script_wide = U254Windowed :: OP_WIDENINGMUL :: < U508 > ( ) ;
20
- let cmpeq_script_wide = U255Cmpeq :: OP_WIDENINGMUL :: < U510 > ( ) ;
20
+ let naive_script_widening = U254 :: OP_WIDENINGMUL :: < U508 > ( ) ;
21
+ let windowed_script_widening = U254Windowed :: OP_WIDENINGMUL :: < U508 > ( ) ;
22
+ let cmpeq_script_widening = U255Cmpeq :: OP_WIDENINGMUL :: < U510 > ( ) ;
23
+ let u29x9_karatsuba_script_widening = u29x9_mul_karazuba ( 0 , 1 ) ;
21
24
22
25
// Create the table
23
26
let mut table = Table :: new ( ) ;
24
27
25
28
// Add the headers
26
- table. add_row ( row ! [ "Variant " , "Naive (BitVM) " , "Cmpeq" , "Windowed (Ours) "] ) ;
29
+ table. add_row ( row ! [ "Approach " , "Overflowing " , "Widening " ] ) ;
27
30
28
31
// Add the data
29
32
table. add_row ( row ! [
30
- "Narrow" ,
31
- naive_script_narrow. len( ) ,
33
+ "Cmpeq" ,
34
+ "-" ,
35
+ cmpeq_script_widening. len( ) ,
36
+ ] ) ;
37
+ table. add_row ( row ! [
38
+ "BitVM bigint" ,
39
+ naive_script_overflowing. len( ) ,
40
+ naive_script_widening. len( ) ,
41
+ ] ) ;
42
+ table. add_row ( row ! [
43
+ "BitVM Karatsuba" ,
32
44
"-" ,
33
- windowed_script_narrow . len( )
45
+ u29x9_karatsuba_script_widening . len( ) ,
34
46
] ) ;
35
47
table. add_row ( row ! [
36
- "Wide" ,
37
- naive_script_wide. len( ) ,
38
- cmpeq_script_wide. len( ) ,
39
- windowed_script_wide. len( )
48
+ "Our w-width method" ,
49
+ windowed_script_overflowing. len( ) ,
50
+ windowed_script_widening. len( ) ,
40
51
] ) ;
41
52
42
53
// Print the table
0 commit comments