Repository: tardis-sn/tardis
Issue category: Performance Issue

No need to need benchmarks for different values of length for generate_rpacket_last_interaction_tracker_list.
@officialasishkumar Currently the said benchmark runs for different values of length, which is not required.
The related code:
https://github.com/tardis-sn/tardis/blob/e1aa88723a6836e8a25cc1afb24b578b1b78651f/benchmarks/transport_montecarlo_packet_trackers.py#L33-L38

My question, was this intended? if not can you please remove that since it can increase the runtime of benchmark workflow.



Functions to edit:
benchmarks/opacities_opacity.py:BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation
benchmarks/transport_montecarlo_packet_trackers.py:BenchmarkTransportMontecarloPacketTrackers.setup
benchmarks/transport_montecarlo_packet_trackers.py:BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe
benchmarks/transport_montecarlo_packet_trackers.py:BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list
benchmarks/transport_montecarlo_packet_trackers.py:BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list

Patch:
diff --git a/benchmarks/opacities_opacity.py b/benchmarks/opacities_opacity.py
index 5352ceccc89..7589632aabd 100644
--- a/benchmarks/opacities_opacity.py
+++ b/benchmarks/opacities_opacity.py
@@ -28,7 +28,7 @@ def time_photoabsorption_opacity_calculation(self):
         )
 
     def time_pair_creation_opacity_calculation(self):
-        energy = 255.9
+        energy = 1240
         ejecta_density = 100000.009
         iron_group_fraction = 0.5
         calculate_opacity.pair_creation_opacity_calculation(
diff --git a/benchmarks/transport_montecarlo_packet_trackers.py b/benchmarks/transport_montecarlo_packet_trackers.py
index e4207d23892..26739847bc6 100644
--- a/benchmarks/transport_montecarlo_packet_trackers.py
+++ b/benchmarks/transport_montecarlo_packet_trackers.py
@@ -9,7 +9,6 @@
 from tardis.transport.montecarlo import packet_trackers
 
 
-@parameterize({"num_packets": [10, 100], "length": [10, 50]})
 class BenchmarkTransportMontecarloPacketTrackers(BenchmarkBase):
     """
     Class to benchmark the numba R packet function.
@@ -18,21 +17,17 @@ class BenchmarkTransportMontecarloPacketTrackers(BenchmarkBase):
     repeat = 2
 
     @functools.cache
-    def setup(self, num_packets, length):
+    def setup(self):
         sim = self.simulation_rpacket_tracking_enabled
         self.TransportState = sim.transport.transport_state
 
-    def time_rpacket_trackers_to_dataframe(self, num_packets, length):
+    def time_rpacket_trackers_to_dataframe(self):
         packet_trackers.rpacket_trackers_to_dataframe(
             self.TransportState.rpacket_tracker
         )
 
-    def time_generate_rpacket_tracker_list(self, num_packets, length):
-        packet_trackers.generate_rpacket_tracker_list(num_packets, length)
+    def time_generate_rpacket_tracker_list(self):
+        packet_trackers.generate_rpacket_tracker_list(50, 10)
 
-    def time_generate_rpacket_last_interaction_tracker_list(
-        self, num_packets, length
-    ):
-        packet_trackers.generate_rpacket_last_interaction_tracker_list(
-            num_packets
-        )
+    def time_generate_rpacket_last_interaction_tracker_list(self):
+        packet_trackers.generate_rpacket_last_interaction_tracker_list(50)