File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,17 +22,20 @@ def main():
2222 return
2323
2424 # Build encoder list including per-tx variants
25- encoders = list (ENCODERS .keys ())
26- for comp in PERTX_COMPRESSIONS :
27- encoders .append (f"rlp_pertx_{ comp } " )
25+ base_encoders = list (ENCODERS .keys ())
26+ pertx_encoders = [f"rlp_pertx_{ comp } " for comp in PERTX_COMPRESSIONS ]
27+ encoders = base_encoders + pertx_encoders
28+
29+ # Per-tx encoders only use compression=none, others use all compressors
30+ num_base = len (base_encoders ) * len (COMPRESSORS ) * len (PACKERS )
31+ num_pertx = len (pertx_encoders ) * 1 * len (PACKERS ) # only "none" compression
32+ num_combinations = num_base + num_pertx
2833
29- # Show what we're testing
30- num_combinations = len (encoders ) * len (COMPRESSORS ) * len (PACKERS )
3134 print (f"Payloads: { len (payload_files )} files" )
3235 print (f"Strategies: { num_combinations } combinations" )
33- print (f" Encodings : { encoders } " )
34- print (f" Compression: { list ( COMPRESSORS . keys ()) } " )
35- print (f" Packing: { list (PACKERS .keys ())} " )
36+ print (f" Base encodings : { base_encoders } × { len ( COMPRESSORS ) } compressions " )
37+ print (f" Per-tx encodings: { pertx_encoders } × none only " )
38+ print (f" Packing: { list (PACKERS .keys ())} " )
3639 print ()
3740
3841 # Run benchmarks
Original file line number Diff line number Diff line change @@ -106,7 +106,11 @@ def run_benchmark(
106106 tx_encoder = get_encoder (enc_name )
107107 data = tx_encoder .encode (transactions )
108108
109- for comp_name in compressors :
109+ # Per-tx encoders already compress, so only use "none" for blob compression
110+ is_pertx = enc_name .startswith ("rlp_pertx_" )
111+ comp_list = ["none" ] if is_pertx else compressors
112+
113+ for comp_name in comp_list :
110114 for pack_name in packers :
111115 blob_encoder = BlobEncoder .from_names (comp_name , pack_name )
112116 result = benchmark_single (
You can’t perform that action at this time.
0 commit comments