Skip to content

Instantly share code, notes, and snippets.

@25077667
Created February 4, 2024 13:00
Show Gist options
  • Save 25077667/e7894cf9bf558613ffc900c88f98214f to your computer and use it in GitHub Desktop.
Save 25077667/e7894cf9bf558613ffc900c88f98214f to your computer and use it in GitHub Desktop.
perfect-forwarding-is-faster-than-c-pointer
import subprocess
import re
import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
import json
import datetime
import os
def execute_command(command, regex, iterations):
c_style_times = []
perfect_forward_times = []
for _ in range(iterations):
print(f"\rProgress: {(_+1)/iterations*100:.2f}%", end="")
try:
output = subprocess.check_output(command, shell=True, text=True)
times = regex.findall(output)
for method, time in times:
if method == "C-style pointer":
c_style_times.append(float(time))
elif method == "perfect forwarding":
perfect_forward_times.append(float(time))
except subprocess.CalledProcessError as e:
print(f"\nAn error occurred: {e}")
return c_style_times, perfect_forward_times
def remove_outliers(data):
# it might be divided by zero
try:
q1, q3 = np.percentile(data, [25, 75])
except:
return data
iqr = q3 - q1
lower_bound = q1 - 1.5 * iqr
upper_bound = q3 + 1.5 * iqr
return [x for x in data if x >= lower_bound and x <= upper_bound]
def plot_data(
c_style_times, perfect_forward_times, other_info, title_suffix="", filtered=False
):
if filtered:
c_style_times = remove_outliers(c_style_times)
perfect_forward_times = remove_outliers(perfect_forward_times)
# Ensure there's enough data to calculate statistics
if len(c_style_times) > 1 and len(perfect_forward_times) > 1:
c_style_std = np.std(c_style_times)
perfect_forward_std = np.std(perfect_forward_times)
_, p_value = stats.ttest_ind(c_style_times, perfect_forward_times)
c_style_mean = np.mean(c_style_times)
perfect_forward_mean = np.mean(perfect_forward_times)
else:
c_style_std = perfect_forward_std = c_style_mean = perfect_forward_mean = (
p_value
) = np.nan
plt.figure(figsize=(10, 6))
plt.scatter(
range(len(c_style_times)),
c_style_times,
label=f"C-style Pointer {title_suffix} (std: {c_style_std:.2f} mean: {c_style_mean:.2f})",
color="blue",
s=10,
)
plt.scatter(
range(len(perfect_forward_times)),
perfect_forward_times,
label=f"Perfect Forwarding {title_suffix} (std: {perfect_forward_std:.2f} mean: {perfect_forward_mean:.2f}",
color="red",
s=10,
)
plt.title(f"Performance Comparison {title_suffix} (p-value: {p_value:.2e})")
plt.xlabel("Iteration")
plt.ylabel("Time Taken (ms)")
plt.text(
0.01,
0.01,
"\n".join(f"{k}: {v}" for k, v in other_info.items()),
horizontalalignment="left",
verticalalignment="bottom",
transform=plt.gca().transAxes,
)
plt.legend()
plt.show()
def save_data(c_style_times, perfect_forward_times, other_info):
data = {
"c_style_times": c_style_times,
"perfect_forward_times": perfect_forward_times,
"other_info": other_info,
}
file_name = (
f"benchmark_data_{datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}.json"
)
with open(file_name, "w") as f:
json.dump(data, f)
print(f"Data saved to {file_name}")
OTHER_INFO = {
"gcc": "13.2.1",
"linux": "6.7.3-arch1-1",
"CPU": "11th Gen Intel i5-1135G7 (8) @ 4.200GHz",
"Memory": "39963MiB DDR4 @ 3200MHz",
}
def main():
iterations = 1068
command = "./out"
time_regex = re.compile(
r"Time taken by function with (C-style pointer|perfect forwarding): (\d+) ns"
)
c_style_times, perfect_forward_times = execute_command(
command, time_regex, iterations
)
save_data(c_style_times, perfect_forward_times, OTHER_INFO)
# Process and plot data
plot_data(
c_style_times,
perfect_forward_times,
OTHER_INFO,
title_suffix="(Raw Data)",
filtered=False,
)
plot_data(
c_style_times,
perfect_forward_times,
{
"gcc": "13.2.1",
"linux": "6.7.3-arch1-1",
"CPU": "11th Gen Intel i5-1135G7 (8) @ 4.200GHz",
"Memory": "39963MiB DDR4 @ 3200MHz",
},
title_suffix="(Filtered Data)",
filtered=True,
)
if __name__ == "__main__":
main()
{"c_style_times": [8.55714, 8.55478, 8.57727, 8.65903, 8.6704, 8.54861, 8.44606, 8.66407, 8.56334, 8.63905, 8.47039, 8.5543, 8.65336, 8.59208, 8.6567, 8.53091, 8.52176, 8.44906, 8.53398, 8.60868, 8.52228, 8.64462, 8.56965, 8.52775, 8.44922, 8.58534, 8.54417, 8.4891, 8.50014, 8.66902, 8.47471, 8.49518, 8.60546, 8.46395, 8.54482, 8.58292, 8.49284, 8.54525, 8.4626, 8.57407, 8.64437, 8.43242, 8.49544, 8.57997, 8.44197, 8.50497, 8.68088, 8.43468, 8.56731, 8.45776, 8.47791, 8.59538, 8.50013, 8.5174, 8.80305, 8.58153, 8.66221, 8.81172, 8.53553, 8.80076, 9.05736, 8.77705, 11.1217, 11.2334, 8.74339, 8.47194, 9.29259, 10.2578, 8.56299, 8.47237, 11.0347, 8.61717, 8.44792, 10.4096, 9.42009, 8.48127, 10.852, 9.50377, 8.61092, 10.7952, 8.83684, 8.80457, 11.0992, 8.60031, 10.4032, 8.48538, 8.54943, 9.52399, 8.63603, 9.89228, 8.60416, 8.77557, 10.6615, 8.56982, 8.77424, 8.62876, 10.9214, 8.63834, 8.72893, 10.9772, 8.59833, 8.91819, 8.68062, 8.65823, 8.65362, 8.6251, 8.83617, 8.91892, 8.80958, 8.69443, 8.8406, 8.76892, 8.70019, 8.6748, 8.61828, 8.81979, 8.6433, 8.69076, 8.97629, 8.62301, 8.62957, 8.84147, 8.49298, 8.5675, 8.81112, 8.5683, 8.40546, 8.62974, 8.50316, 8.50799, 8.63932, 8.45684, 8.5059, 8.58132, 8.54096, 8.67009, 8.66371, 8.49302, 8.55515, 8.47342, 8.48019, 8.62814, 8.43614, 8.51591, 8.51135, 8.45776, 9.47886, 8.91948, 8.86708, 8.5411, 8.6777, 8.97172, 8.66462, 8.53583, 8.61561, 8.60737, 8.73871, 8.94763, 8.73859, 8.74121, 8.71613, 8.88566, 8.64656, 8.61, 8.84887, 8.74237, 8.75844, 8.56658, 8.94253, 8.7042, 8.5601, 8.72135, 8.60344, 8.50534, 8.6537, 8.59683, 8.82925, 8.6537, 8.47666, 8.67573, 8.5322, 8.51888, 8.60206, 8.52081, 8.67725, 8.67931, 8.68455, 8.5749, 8.61101, 8.74938, 8.74959, 8.95418, 8.69253, 8.54404, 8.64981, 8.69031, 8.86088, 8.58551, 8.50858, 8.59194, 8.53138, 8.59072, 8.70497, 9.08057, 8.75572, 8.89066, 8.66347, 8.72059, 8.68282, 8.57105, 8.83578, 8.79448, 8.51902, 8.439, 8.64387, 8.52071, 8.48758, 8.41266, 8.93576, 8.5388, 8.54828, 8.4851, 9.30219, 9.73893, 8.91752, 8.98295, 8.80314, 8.5023, 8.49983, 8.47627, 8.48503, 8.81043, 8.42023, 8.41654, 8.51077, 8.60316, 8.56953, 8.48699, 8.60543, 8.44974, 8.46863, 8.48304, 8.62542, 8.56553, 8.68079, 8.87799, 9.28644, 8.70204, 8.78088, 9.15159, 9.26231, 8.88738, 8.79792, 8.78909, 8.9684, 8.9032, 8.67378, 8.61376, 8.61519, 8.67337, 8.72611, 8.63966, 8.57654, 8.55866, 8.62624, 8.60963, 8.81982, 8.57615, 8.54085, 8.67894, 8.68549, 8.65483, 8.8483, 8.63185, 8.6426, 8.63726, 8.55375, 8.63581, 8.64326, 8.70711, 8.70599, 8.67903, 8.59928, 8.78828, 8.82789, 8.75992, 8.79517, 8.58261, 8.43082, 8.49119, 8.41032, 8.40672, 8.45042, 8.39454, 8.41068, 8.38561, 8.4355, 8.4888, 8.48972, 8.5045, 8.63467, 8.94649, 8.70606, 8.7409, 8.642, 8.58935, 8.81133, 8.77203, 8.66397, 8.58213, 8.57922, 8.76202, 8.83053, 8.75326, 8.5889, 8.59114, 8.68689, 8.81815, 8.65716, 8.63251, 8.61055, 8.46391, 8.82738, 8.87062, 8.48583, 8.42287, 8.46692, 8.41422, 8.46006, 8.43275, 8.40658, 8.48369, 8.40442, 8.44544, 8.48084, 8.44253, 8.40213, 8.40209, 8.43027, 8.46378, 8.40739, 8.47687, 8.55179, 8.59879, 8.52904, 8.63621, 8.7031, 8.64243, 8.59368, 8.62104, 8.7178, 8.78862, 8.67428, 8.58072, 8.4537, 8.48514, 8.59077, 8.48245, 8.47259, 8.63809, 8.86987, 8.57704, 8.70353, 8.74873, 8.54329, 8.534, 8.51628, 8.51567, 8.50063, 8.45084, 8.6068, 8.45619, 8.6636, 8.68468, 8.65478, 8.48355, 8.46816, 8.48573, 8.57983, 8.84661, 8.64634, 8.59855, 8.46295, 8.56029, 8.84653, 8.52375, 8.47872, 8.53656, 8.54237, 8.48608, 8.76528, 8.53007, 8.59055, 8.47087, 8.45672, 8.54596, 8.49283, 8.47298, 8.62415, 8.4906, 8.5198, 8.66561, 8.4904, 8.59607, 8.65893, 8.71912, 8.71395, 8.64414, 8.62569, 8.57171, 8.54032, 8.59233, 9.53281, 8.72541, 8.54474, 8.64384, 8.53346, 8.62669, 8.68465, 8.57881, 8.56273, 8.50175, 8.64619, 8.74695, 8.7193, 8.75662, 8.92575, 8.5447, 8.76318, 8.63638, 8.61166, 8.83309, 8.6839, 8.57569, 8.61151, 8.66904, 8.75774, 8.71048, 8.55934, 8.62141, 8.74912, 8.53918, 8.64073, 8.61579, 8.62873, 8.65922, 8.66128, 8.71721, 8.52394, 8.65925, 8.67497, 8.8159, 9.2055, 8.62499, 8.65902, 8.76191, 8.68393, 8.67852, 8.64891, 8.58628, 8.73061, 8.5993, 8.49716, 8.76254, 8.54226, 8.59823, 8.6766, 8.52943, 8.64038, 8.72855, 8.69482, 8.73434, 8.70233, 8.64191, 9.11572, 8.73827, 8.61763, 8.83657, 8.57328, 8.51841, 8.84086, 8.60179, 8.53132, 8.76758, 8.57999, 8.57105, 8.74068, 8.50871, 8.60628, 8.59782, 8.48846, 8.64915, 8.57344, 8.58485, 8.67948, 8.57799, 8.47347, 9.034, 8.49748, 8.58905, 8.68204, 8.5881, 8.92116, 8.75923, 8.53608, 8.88418, 8.64899, 8.54739, 8.7964, 8.66028, 8.59706, 8.98234, 8.52089, 8.47198, 8.74065, 8.59325, 8.55492, 8.66614, 8.55426, 8.72164, 8.65758, 8.79576, 8.42475, 8.47114, 8.76947, 8.58622, 8.46965, 8.55792, 8.57242, 8.54182, 8.46407, 8.58345, 8.4723, 8.48032, 8.48208, 8.50647, 8.64566, 8.43685, 8.54594, 8.56443, 8.48578, 8.44712, 8.58242, 8.50685, 8.52262, 8.53065, 8.51862, 8.67209, 8.58857, 8.62716, 8.50395, 8.4517, 8.71137, 8.54266, 8.44498, 8.47585, 8.48723, 8.49438, 8.67021, 8.5183, 8.52027, 8.67484, 8.53479, 8.58328, 8.5084, 8.52888, 8.51265, 8.4607, 8.578, 8.67847, 8.40712, 8.5778, 8.56384, 8.55167, 8.54455, 8.67647, 8.42638, 8.51677, 8.45375, 8.43456, 8.81649, 8.48393, 8.46795, 8.6365, 8.54587, 8.50023, 8.61596, 8.43375, 8.62054, 8.43107, 8.44996, 8.70499, 8.40369, 8.40945, 8.72057, 8.43673, 8.54047, 8.60417, 8.50233, 8.67636, 8.41733, 8.6232, 8.7146, 9.50517, 8.50526, 8.64343, 8.45535, 8.48112, 8.69472, 8.47433, 8.49994, 8.68025, 8.43652, 8.64614, 8.39847, 8.47323, 8.63373, 8.44119, 8.47655, 8.57985, 8.4645, 8.41216, 8.47857, 8.66513, 8.49641, 8.50401, 8.60109, 8.67658, 8.61666, 8.51452, 8.57822, 8.57618, 8.56721, 8.56209, 8.53321, 8.41047, 8.52121, 8.60639, 8.60364, 8.49761, 8.49422, 8.60611, 8.56458, 8.75743, 8.55747, 8.44826, 8.51536, 8.54104, 8.65836, 8.62384, 8.59604, 8.46099, 8.70797, 9.19518, 8.51002, 8.5567, 8.56728, 8.62432, 8.54534, 8.50621, 8.52121, 8.5873, 8.7333, 8.68119, 8.57483, 8.45669, 8.60392, 8.57596, 8.43685, 8.4241, 8.49097, 8.5434, 8.51832, 8.52324, 8.65903, 8.47352, 8.47457, 8.63599, 8.44873, 8.52388, 8.54867, 8.42005, 8.87491, 8.40378, 8.4052, 8.70038, 8.43861, 8.53782, 8.60995, 8.44358, 8.69892, 8.63606, 8.47287, 8.50566, 8.43136, 8.41566, 8.74462, 8.42904, 8.43595, 8.69674, 8.51029, 8.48932, 8.61556, 8.51279, 8.59342, 8.43811, 8.45036, 8.70197, 8.45127, 8.42521, 8.60241, 8.45272, 8.46181, 8.64139, 8.42401, 8.62447, 8.46417, 8.4229, 8.68912, 8.42972, 8.47007, 8.65248, 8.4566, 8.46594, 8.61215, 8.43403, 8.82366, 8.45585, 8.47681, 8.68695, 8.57453, 8.59593, 8.6428, 8.42782, 8.52706, 8.57771, 8.50617, 8.61241, 8.48319, 8.51233, 8.69802, 8.46787, 8.52449, 8.6153, 8.41998, 8.57482, 8.5701, 8.47571, 8.64948, 8.50805, 8.41131, 8.6367, 8.4813, 8.55103, 8.79494, 8.52102, 8.58733, 8.44727, 8.44357, 8.67233, 8.50666, 8.47639, 8.63412, 8.42468, 8.49238, 8.55857, 8.5145, 8.55123, 8.59842, 8.4092, 8.58004, 8.52969, 8.48486, 8.66667, 8.4223, 8.52419, 8.61013, 8.43624, 8.61155, 8.59398, 8.4081, 8.65416, 8.60128, 8.46311, 8.70336, 8.48146, 8.53127, 8.59231, 8.42045, 8.54719, 8.56392, 8.54693, 8.54148, 8.49424, 8.49516, 8.69172, 8.42901, 8.47229, 8.66005, 8.42956, 8.55764, 8.56793, 8.55292, 8.48395, 8.44648, 8.7309, 8.83819, 8.42852, 8.48206, 8.72452, 8.49005, 8.45095, 8.70774, 8.50175, 8.50779, 8.59091, 8.44269, 8.72803, 8.427, 8.44373, 8.62573, 8.4195, 8.47737, 8.61173, 8.44791, 8.5118, 8.61565, 8.5034, 8.69839, 8.45661, 8.46797, 8.67208, 8.39297, 8.49073, 8.58878, 8.55468, 8.47551, 8.60625, 8.40345, 8.50679, 8.44285, 8.50108, 8.71716, 8.44047, 8.44206, 8.58451, 8.40355, 8.42545, 8.64337, 8.40671, 8.52252, 8.43018, 8.52719, 8.70728, 8.44666, 8.46047, 8.69833, 8.49269, 8.47712, 8.60073, 8.46579, 8.53016, 8.46908, 8.46509, 8.67761, 8.41717, 8.43084, 8.65257, 8.51245, 8.53836, 8.61082, 8.49474, 8.52769, 8.60297, 8.44305, 8.81048, 8.45004, 8.46979, 8.69997, 8.4406, 8.66674, 8.59959, 8.4616, 8.49073, 8.55258, 8.41118, 8.68078, 8.44279, 8.49189, 8.65365, 8.46454, 8.51842, 8.64855, 8.45411, 8.54237, 8.51422, 8.40182, 8.70681, 8.45458, 8.55562, 8.63994, 8.45549, 8.53492, 8.79769, 8.47274, 8.47219, 8.91428, 8.42436, 8.77149, 8.39885, 8.41799, 8.71647, 8.42198, 8.5646, 8.77065, 8.49345, 8.51544, 8.61538, 8.46178, 8.77981, 8.43728, 8.47122, 8.60997, 8.42281, 8.49241, 8.65324, 8.49314, 8.4669, 8.58568, 8.49519, 8.70291, 8.43553, 8.4498, 8.60375, 8.40964, 8.43818, 8.681, 8.47904, 8.50438, 8.66573, 8.46871, 8.59579, 8.42105, 8.43325, 8.76905, 8.41595, 8.5031, 8.55538, 8.40538, 8.49711, 8.66353, 8.45556, 8.64425, 8.4176, 8.50348, 8.64284, 8.45118, 8.5466, 8.63558, 8.48264, 8.45203, 8.57822, 8.44855, 8.56225, 8.40751, 8.44991, 8.72377, 8.49196, 8.48828, 8.73022, 8.44565, 8.44863, 8.62943, 8.43925, 8.51395, 8.40234, 8.49217, 8.70714, 8.45973, 8.44791, 8.65688, 8.53339, 8.48801, 8.74399, 8.46745, 8.61572, 8.45059, 8.43753, 8.71369, 8.41886, 8.4263, 8.65936, 8.43028, 8.54212, 8.44792, 8.4703, 8.67384, 8.49827, 8.41777, 8.68778, 8.41164, 8.54782, 8.56207, 8.41447, 8.68475, 8.49269, 8.51281, 8.68205, 8.46692, 8.55348, 8.63356, 8.39805, 8.54476, 8.55176, 8.4417, 8.54799, 8.45267, 8.47466, 8.61556, 8.50437, 8.61432, 8.58214, 8.45023, 8.5604, 8.41708, 8.46725, 8.7041, 8.39537, 8.4168, 8.63301, 8.43727, 8.60492, 8.58904, 8.45819, 8.52778, 8.49366, 8.58022, 8.62618, 8.4131, 8.4799, 8.58623, 8.41818, 8.48239, 8.61932, 8.44354, 8.56854, 8.49926, 8.53553, 8.64567, 8.41655, 8.50896, 8.5739, 8.42089, 8.56726, 8.5492, 8.46506, 8.70742, 8.48632, 9.16607, 8.75447, 8.41979, 8.43652, 8.66425, 8.491, 8.51595, 8.62081, 8.45034, 8.51592], "perfect_forward_times": [8.62597, 8.58836, 8.62551, 8.56155, 8.51687, 8.53924, 8.64542, 8.56053, 8.51973, 8.48227, 8.66736, 8.55391, 8.95897, 8.55002, 8.49823, 8.42986, 8.60853, 8.47909, 8.40885, 8.47075, 8.46651, 9.23451, 8.44534, 8.51513, 8.50264, 8.55009, 8.54686, 8.71507, 8.43106, 8.51248, 8.56326, 8.44548, 8.63064, 8.56301, 8.43245, 8.50175, 8.47524, 8.56166, 8.60806, 8.40726, 8.48468, 8.57706, 8.50446, 8.56184, 8.54595, 8.46738, 8.54066, 8.48571, 8.56616, 8.70003, 8.44334, 8.47635, 8.62244, 8.47968, 8.75057, 8.59984, 8.45321, 8.62278, 8.87651, 8.57586, 11.5126, 8.6611, 8.75758, 8.41742, 10.7173, 8.56838, 8.50822, 9.18439, 10.1589, 8.50351, 8.71231, 11.0613, 8.53704, 8.47084, 10.1001, 8.57578, 8.64198, 10.0408, 8.60395, 8.68608, 11.1, 8.50128, 8.80595, 10.8038, 8.89764, 9.27464, 8.61053, 9.84751, 8.55161, 8.68502, 10.9631, 8.49436, 8.92846, 8.59992, 8.63449, 8.6041, 8.67739, 11.0819, 8.58627, 8.71679, 11.1822, 8.79359, 8.69823, 8.67309, 8.8243, 8.5694, 8.68238, 8.69694, 8.71251, 8.84185, 8.68652, 8.61855, 8.53477, 8.74798, 8.58229, 8.59386, 8.63785, 8.57546, 8.60795, 8.62893, 8.55153, 8.51746, 8.83382, 8.50095, 8.47437, 8.83052, 8.41742, 8.60984, 8.57982, 8.39877, 8.44967, 8.59511, 8.51069, 8.74887, 8.48271, 8.47027, 8.58272, 8.40691, 8.49932, 8.5519, 8.37762, 8.4944, 8.55596, 8.45798, 8.50704, 8.56878, 9.19103, 8.55844, 8.80668, 8.60433, 8.65221, 8.49828, 8.50429, 8.55259, 8.58283, 8.52185, 8.45153, 8.52066, 9.0343, 8.72138, 8.62326, 8.61066, 8.85397, 8.60789, 8.7917, 8.51375, 8.51361, 8.70826, 8.58044, 8.68949, 8.73786, 8.55098, 8.71789, 8.57717, 8.63945, 8.66947, 8.55498, 8.56912, 8.46601, 8.47709, 8.60034, 8.54294, 8.55537, 8.51261, 8.69051, 9.0082, 8.81885, 8.92077, 8.83418, 8.78706, 8.59612, 8.63858, 8.79538, 8.59379, 8.82933, 8.57071, 8.67023, 8.6136, 8.5144, 8.58225, 8.76245, 8.52071, 8.53371, 8.97163, 8.8479, 8.62066, 8.5945, 8.74183, 8.75011, 8.88407, 8.56422, 8.47341, 8.56413, 8.60354, 8.49061, 8.44092, 8.40397, 8.43681, 8.44012, 8.43811, 8.53891, 8.45899, 9.95286, 9.3485, 8.53453, 9.14101, 8.66345, 8.51451, 8.47123, 8.44991, 8.38502, 8.43056, 8.5265, 8.42439, 8.40442, 8.51664, 8.47212, 8.39343, 8.59503, 8.43238, 8.49717, 8.46943, 8.46627, 8.55346, 8.46602, 8.60324, 8.82475, 8.86613, 9.09968, 9.1484, 9.35819, 9.05652, 8.98932, 9.05114, 8.5192, 8.7271, 8.83537, 8.67589, 8.68321, 8.55645, 8.54842, 8.65567, 8.61212, 8.60629, 8.65736, 8.5657, 8.54743, 8.68938, 8.64091, 8.56684, 8.71856, 8.57027, 8.81307, 8.83028, 8.60625, 8.53478, 8.61985, 8.63568, 8.68297, 8.73732, 8.54471, 8.69787, 8.69035, 8.63523, 8.6019, 8.59663, 8.66733, 8.7534, 8.39526, 8.40616, 8.46859, 8.45561, 8.36808, 8.3593, 8.388, 8.42415, 8.40178, 8.54421, 8.47888, 8.59524, 8.89898, 8.61866, 8.6055, 8.66427, 8.69735, 8.70779, 8.53922, 8.55423, 8.68431, 8.50114, 8.77867, 8.5383, 8.63336, 8.65232, 8.709, 8.64433, 8.55075, 8.43764, 8.63737, 8.44001, 8.48861, 8.49985, 8.7053, 8.49232, 8.53231, 8.38768, 8.41228, 8.39004, 8.42692, 8.48333, 8.39946, 8.40111, 8.42202, 8.42556, 8.40829, 8.37896, 8.39182, 8.44757, 8.42068, 8.37825, 8.54198, 8.44363, 8.52362, 8.56261, 8.44981, 8.66218, 8.69643, 8.50448, 8.70225, 8.62096, 8.6515, 9.32718, 8.49211, 8.43795, 8.55196, 8.47028, 8.48358, 8.58823, 8.59653, 8.60549, 8.68062, 8.72921, 8.6234, 8.57102, 8.63757, 8.56407, 8.44736, 8.46335, 8.53694, 8.43108, 8.44483, 8.52084, 8.58492, 8.45638, 8.41829, 8.49002, 8.50903, 8.46495, 8.59409, 8.76854, 8.55773, 8.66395, 8.66016, 8.65982, 8.44815, 8.5484, 8.43615, 8.47485, 8.49597, 8.45219, 8.51826, 8.45236, 8.48059, 8.54792, 8.4093, 8.44884, 8.52348, 8.7387, 8.46312, 8.44809, 8.60829, 8.56278, 8.85646, 8.45182, 8.56422, 8.67288, 8.49825, 8.56126, 8.48523, 8.49682, 8.72808, 10.2591, 8.58304, 8.71386, 8.70907, 8.65446, 8.54354, 8.60677, 8.64929, 8.6447, 8.7443, 8.65122, 8.65471, 8.5687, 8.73508, 8.6182, 8.70965, 8.73756, 8.64416, 8.61625, 8.61617, 8.52312, 8.56105, 8.68472, 8.67882, 8.5582, 8.61729, 8.61917, 8.70247, 8.60608, 8.62259, 8.67404, 8.62033, 8.69491, 8.6068, 8.59604, 8.64544, 8.69491, 8.68863, 8.6543, 8.66012, 8.59369, 8.78131, 8.70466, 8.57412, 8.47357, 8.53715, 8.58279, 8.66908, 8.69315, 8.55302, 8.67646, 8.57953, 8.60981, 8.58598, 8.48221, 8.48979, 8.61198, 8.49912, 8.57778, 8.58482, 8.51431, 8.69606, 8.52629, 8.58899, 8.8023, 8.56078, 8.55433, 8.69021, 8.50282, 8.6272, 8.64679, 8.56393, 8.54322, 8.63844, 8.58784, 8.5578, 8.69923, 8.60481, 8.64451, 8.4197, 8.49826, 8.65709, 8.53846, 8.4459, 8.66199, 8.49482, 8.54046, 8.72147, 8.50557, 8.71321, 8.59186, 8.59958, 8.7428, 8.70293, 8.64978, 8.84338, 8.59953, 8.50608, 8.81099, 8.62262, 8.55507, 8.66254, 8.51557, 8.60834, 8.82476, 8.60964, 8.62999, 8.65346, 8.4924, 8.49966, 8.47408, 8.46826, 8.64507, 8.57321, 8.49489, 8.52433, 8.46293, 8.41833, 8.51665, 8.46317, 8.38858, 8.48799, 8.50835, 8.57104, 8.43379, 8.50091, 8.51659, 8.42941, 8.40022, 8.53983, 8.51981, 8.45044, 8.52729, 8.45972, 8.53829, 8.41409, 8.41826, 8.6116, 8.4773, 8.60656, 8.50078, 8.60106, 8.48718, 8.53766, 8.50131, 8.54785, 8.43575, 8.37693, 8.50274, 8.45029, 8.67006, 8.46715, 8.47238, 8.44224, 8.42644, 8.47832, 8.54069, 8.46894, 8.53458, 8.48324, 8.48521, 8.44086, 8.52457, 8.42553, 8.4727, 8.4205, 8.42752, 8.66902, 8.4272, 8.46122, 8.69315, 8.41758, 8.43141, 8.64705, 8.41887, 8.47841, 8.48113, 8.42623, 8.76241, 8.43661, 8.42918, 8.59439, 8.46125, 8.5384, 8.56583, 8.4864, 8.52346, 8.49674, 8.4186, 8.527, 8.43792, 8.47558, 9.39363, 8.58527, 8.52752, 8.58911, 8.47182, 8.49265, 8.62767, 8.42636, 8.60563, 8.37664, 8.3921, 8.61349, 8.40073, 8.51161, 8.57948, 8.4315, 8.47392, 8.54745, 8.55618, 8.56371, 8.48498, 8.61186, 8.59633, 8.48818, 8.43031, 8.53475, 8.53857, 8.60942, 8.5061, 8.45342, 8.5356, 8.50296, 8.62339, 8.54227, 8.51024, 8.53367, 8.67263, 8.584, 8.59905, 8.5743, 8.51857, 8.59829, 8.54595, 8.59893, 8.56775, 8.4549, 8.52413, 9.19242, 8.47497, 8.44357, 8.90446, 8.62639, 8.65717, 8.5737, 8.50066, 8.54047, 8.53055, 8.64003, 8.50014, 8.43821, 8.44869, 8.47327, 8.65115, 8.52993, 8.44496, 8.55999, 8.50836, 8.42161, 8.45427, 8.65559, 8.37608, 8.4896, 8.59816, 8.40236, 8.49428, 8.36912, 8.42419, 8.73429, 8.47335, 8.45999, 8.63467, 8.39947, 8.46225, 8.57452, 8.44097, 8.56513, 8.51992, 8.47738, 8.61729, 8.53802, 8.43783, 8.69707, 8.40367, 8.45911, 8.64565, 8.40723, 8.487, 8.64152, 8.50782, 8.47851, 8.61291, 8.44997, 8.70589, 8.37667, 8.42965, 8.62633, 8.41778, 8.48291, 8.57917, 8.49479, 8.51894, 8.44434, 8.42097, 8.62423, 8.40486, 8.43023, 8.60733, 8.41817, 8.47368, 8.55646, 8.47016, 8.49689, 8.47139, 8.42317, 8.59162, 8.37999, 8.46424, 8.64631, 8.49014, 8.49466, 8.56409, 8.38802, 8.46124, 8.47496, 8.40779, 8.64818, 8.37531, 8.45379, 8.62966, 8.44578, 8.53526, 8.52522, 8.40623, 8.45292, 8.50964, 8.47217, 8.67029, 8.3733, 8.58685, 8.56884, 8.4194, 9.05331, 8.56195, 8.47118, 8.64548, 8.41323, 8.40615, 8.68087, 8.48189, 8.45327, 8.6638, 8.42884, 8.54297, 8.61348, 8.45869, 8.60776, 8.38053, 8.41629, 8.64508, 8.46133, 8.54462, 8.67023, 8.44914, 8.57206, 8.57986, 8.44829, 8.51565, 8.39293, 8.42181, 8.62679, 8.43005, 8.52857, 8.59367, 8.40293, 8.58995, 8.54419, 8.43841, 8.50509, 8.4564, 8.40463, 8.66545, 8.418, 8.43248, 8.66802, 8.42909, 8.45083, 8.5435, 8.41605, 8.47149, 8.46468, 8.46253, 8.67142, 8.41394, 8.42033, 8.82236, 8.40757, 8.39982, 8.56842, 8.4216, 8.48174, 8.60641, 8.45357, 8.54985, 8.42942, 8.491, 8.64064, 8.40134, 8.47004, 8.55283, 8.42981, 8.53709, 8.5463, 8.39309, 8.67224, 8.46815, 8.43616, 8.64316, 8.37303, 8.48458, 8.57457, 8.4286, 8.46261, 8.91797, 8.52616, 8.57252, 8.48428, 8.41073, 8.68795, 8.37642, 8.39166, 8.63168, 8.40956, 8.51595, 8.53065, 8.45679, 8.50502, 8.46475, 8.42334, 8.66135, 8.38071, 8.4027, 8.5692, 8.71338, 8.54094, 8.57982, 8.46109, 8.45536, 8.5577, 8.42026, 8.66196, 8.51855, 8.42981, 8.75907, 8.39763, 8.61675, 8.88137, 8.45895, 8.51456, 8.3992, 8.39838, 8.60195, 8.38116, 8.43308, 8.62759, 8.42551, 8.45324, 8.61487, 8.48303, 8.51729, 8.47634, 8.50425, 8.62041, 8.40247, 8.4355, 8.67477, 8.4475, 8.45643, 8.5524, 8.43061, 8.56067, 8.45932, 8.40081, 8.62292, 8.39089, 8.42768, 8.67289, 8.39954, 8.47344, 8.53026, 8.40924, 8.54918, 8.47627, 8.38068, 8.59336, 8.37851, 8.48498, 8.76988, 8.39652, 8.48522, 8.56243, 8.40248, 8.4572, 8.68204, 8.47882, 8.50801, 8.49299, 8.44594, 8.65118, 8.41832, 8.50312, 8.62841, 8.41423, 8.5198, 8.56605, 8.38649, 8.57261, 8.37869, 8.42587, 8.64493, 8.43243, 8.45398, 8.57654, 8.47385, 8.59445, 8.61697, 8.37602, 8.55588, 8.41059, 8.45505, 8.66272, 8.4004, 8.54155, 8.58493, 8.45329, 8.49143, 8.53758, 8.45412, 8.56527, 8.42114, 8.47085, 8.6229, 8.43482, 8.48214, 8.94934, 8.45196, 8.44903, 8.63906, 8.42247, 8.54579, 8.50595, 8.46877, 8.70659, 8.43694, 8.3958, 8.56231, 8.44893, 8.51525, 8.58281, 8.46684, 8.45772, 8.47848, 8.45681, 8.63896, 8.41803, 8.49558, 8.70286, 8.40489, 8.47903, 8.6244, 8.45265, 8.49863, 8.50134, 8.43064, 8.64634, 8.44986, 8.48364, 8.65839, 8.41467, 8.50683, 8.42563, 8.37562, 8.63445, 8.37488, 8.41373, 8.58507, 8.46128, 8.50161, 8.5516, 8.43004, 8.58217, 8.36887, 8.42627, 8.63417, 8.41469, 8.86495, 8.60798, 8.4793, 8.53841, 8.54278, 8.52679, 8.57011, 8.46136, 8.45747, 8.75373, 8.47907, 8.48657, 8.53649, 8.40944, 8.44454, 8.44753, 8.39827, 8.81137, 8.42173, 8.48921, 8.57813, 8.39787, 8.55382, 8.51782, 8.44395, 8.45605, 8.48516, 8.40592, 8.69281, 8.45114, 8.49018, 8.58434, 8.38882, 8.52758, 8.54375, 8.40099, 8.53757, 8.41416, 8.42411, 8.60445, 8.4341, 8.53542, 8.59632, 8.44946, 8.49792, 8.5585, 8.41622, 8.51384, 8.4764, 8.46339, 8.57548, 8.45719, 8.3824, 8.54759, 8.39329, 8.51154, 8.54219, 8.41986, 8.47649, 8.44737, 8.42985], "other_info": {"gcc": "13.2.1", "linux": "6.7.3-arch1-1", "CPU": "11th Gen Intel i5-1135G7 (8) @ 4.200GHz", "Memory": "39963MiB DDR4 @ 3200MHz"}}
{"c_style_times": [90.0, 73.0, 115.0, 54.0, 131.0, 105.0, 89.0, 119.0, 98.0, 69.0, 43.0, 79.0, 89.0, 81.0, 89.0, 74.0, 102.0, 65.0, 72.0, 83.0, 78.0, 67.0, 73.0, 73.0, 56.0, 57.0, 56.0, 53.0, 67.0, 57.0, 73.0, 84.0, 60.0, 60.0, 50.0, 49.0, 65.0, 65.0, 90.0, 58.0, 68.0, 45.0, 72.0, 57.0, 74.0, 74.0, 61.0, 42.0, 76.0, 84.0, 78.0, 67.0, 79.0, 59.0, 66.0, 64.0, 57.0, 64.0, 63.0, 62.0, 86.0, 67.0, 60.0, 74.0, 293.0, 70.0, 76.0, 56.0, 39.0, 79.0, 61.0, 61.0, 59.0, 164.0, 62.0, 80.0, 75.0, 80.0, 55.0, 66.0, 169.0, 55.0, 54.0, 65.0, 60.0, 61.0, 163.0, 55.0, 151.0, 53.0, 50.0, 78.0, 67.0, 69.0, 75.0, 60.0, 171.0, 89.0, 89.0, 79.0, 104.0, 90.0, 74.0, 68.0, 117.0, 58.0, 70.0, 56.0, 100.0, 106.0, 55.0, 55.0, 84.0, 89.0, 66.0, 83.0, 69.0, 71.0, 47.0, 73.0, 103.0, 70.0, 91.0, 48.0, 71.0, 93.0, 68.0, 74.0, 106.0, 95.0, 85.0, 89.0, 58.0, 85.0, 57.0, 75.0, 78.0, 87.0, 101.0, 88.0, 65.0, 79.0, 83.0, 106.0, 88.0, 91.0, 91.0, 68.0, 105.0, 75.0, 64.0, 87.0, 68.0, 106.0, 110.0, 69.0, 86.0, 81.0, 53.0, 78.0, 106.0, 57.0, 71.0, 105.0, 90.0, 87.0, 90.0, 76.0, 81.0, 67.0, 63.0, 62.0, 88.0, 71.0, 77.0, 58.0, 98.0, 55.0, 61.0, 80.0, 67.0, 83.0, 87.0, 75.0, 65.0, 87.0, 75.0, 106.0, 87.0, 60.0, 93.0, 100.0, 116.0, 87.0, 76.0, 79.0, 65.0, 63.0, 104.0, 72.0, 84.0, 64.0, 98.0, 76.0, 85.0, 61.0, 84.0, 68.0, 86.0, 99.0, 95.0, 93.0, 115.0, 71.0, 49.0, 79.0, 86.0, 67.0, 100.0, 106.0, 61.0, 63.0, 92.0, 67.0, 95.0, 93.0, 96.0, 78.0, 84.0, 54.0, 66.0, 81.0, 86.0, 74.0, 99.0, 86.0, 91.0, 82.0, 91.0, 83.0, 76.0, 98.0, 63.0, 97.0, 107.0, 79.0, 75.0, 68.0, 88.0, 58.0, 89.0, 103.0, 54.0, 98.0, 88.0, 58.0, 112.0, 84.0, 72.0, 59.0, 96.0, 89.0, 64.0, 59.0, 95.0, 107.0, 84.0, 84.0, 77.0, 90.0, 89.0, 67.0, 77.0, 108.0, 61.0, 77.0, 62.0, 80.0, 86.0, 66.0, 77.0, 112.0, 61.0, 67.0, 88.0, 135.0, 80.0, 99.0, 48.0, 53.0, 50.0, 40.0, 60.0, 56.0, 56.0, 74.0, 150.0, 68.0, 75.0, 67.0, 66.0, 53.0, 70.0, 47.0, 64.0, 75.0, 58.0, 50.0, 70.0, 44.0, 95.0, 71.0, 137.0, 63.0, 61.0, 68.0, 71.0, 111.0, 52.0, 49.0, 132.0, 52.0, 71.0, 89.0, 54.0, 54.0, 80.0, 94.0, 65.0, 71.0, 57.0, 80.0, 48.0, 64.0, 71.0, 56.0, 78.0, 71.0, 64.0, 70.0, 60.0, 44.0, 71.0, 50.0, 66.0, 54.0, 57.0, 77.0, 61.0, 79.0, 74.0, 69.0, 77.0, 69.0, 134.0, 168.0, 58.0, 75.0, 64.0, 56.0, 64.0, 78.0, 220.0, 131.0, 156.0, 57.0, 75.0, 63.0, 225.0, 63.0, 53.0, 53.0, 59.0, 50.0, 159.0, 84.0, 61.0, 51.0, 94.0, 102.0, 56.0, 97.0, 93.0, 67.0, 98.0, 138.0, 92.0, 80.0, 111.0, 107.0, 69.0, 57.0, 72.0, 76.0, 70.0, 104.0, 101.0, 78.0, 91.0, 57.0, 73.0, 68.0, 77.0, 83.0, 68.0, 64.0, 94.0, 63.0, 107.0, 59.0, 77.0, 76.0, 74.0, 67.0, 46.0, 92.0, 67.0, 88.0, 90.0, 107.0, 90.0, 74.0, 102.0, 83.0, 88.0, 68.0, 85.0, 119.0, 75.0, 83.0, 83.0, 77.0, 106.0, 107.0, 91.0, 64.0, 121.0, 67.0, 80.0, 82.0, 82.0, 104.0, 100.0, 72.0, 56.0, 70.0, 79.0, 67.0, 114.0, 58.0, 89.0, 56.0, 86.0, 50.0, 80.0, 111.0, 110.0, 98.0, 62.0, 75.0, 98.0, 93.0, 97.0, 89.0, 72.0, 58.0, 66.0, 89.0, 74.0, 64.0, 84.0, 68.0, 110.0, 65.0, 74.0, 81.0, 63.0, 94.0, 82.0, 67.0, 82.0, 65.0, 92.0, 73.0, 90.0, 84.0, 78.0, 90.0, 65.0, 78.0, 95.0, 93.0, 87.0, 77.0, 55.0, 99.0, 110.0, 64.0, 86.0, 62.0, 111.0, 69.0, 58.0, 73.0, 54.0, 83.0, 83.0, 70.0, 59.0, 101.0, 83.0, 61.0, 80.0, 77.0, 112.0, 81.0, 61.0, 96.0, 96.0, 75.0, 99.0, 64.0, 106.0, 66.0, 94.0, 90.0, 87.0, 99.0, 89.0, 66.0, 81.0, 95.0, 91.0, 80.0, 94.0, 75.0, 105.0, 65.0, 82.0, 106.0, 84.0, 63.0, 92.0, 74.0, 99.0, 85.0, 92.0, 76.0, 96.0, 93.0, 113.0, 73.0, 193.0, 58.0, 65.0, 60.0, 51.0, 49.0, 76.0, 52.0, 184.0, 59.0, 70.0, 70.0, 52.0, 47.0, 99.0, 67.0, 58.0, 64.0, 87.0, 49.0, 65.0, 68.0, 67.0, 89.0, 78.0, 60.0, 74.0, 61.0, 61.0, 78.0, 52.0, 55.0, 65.0, 80.0, 67.0, 44.0, 76.0, 52.0, 54.0, 51.0, 69.0, 70.0, 134.0, 55.0, 66.0, 54.0, 54.0, 74.0, 73.0, 65.0, 64.0, 58.0, 71.0, 75.0, 46.0, 55.0, 48.0, 32.0, 46.0, 47.0, 58.0, 72.0, 64.0, 48.0, 60.0, 57.0, 55.0, 73.0, 72.0, 61.0, 70.0, 209.0, 59.0, 62.0, 88.0, 60.0, 83.0, 63.0, 64.0, 58.0, 63.0, 66.0, 42.0, 57.0, 64.0, 44.0, 69.0, 54.0, 59.0, 77.0, 62.0, 221.0, 64.0, 59.0, 79.0, 71.0, 134.0, 57.0, 57.0, 69.0, 60.0, 59.0, 57.0, 81.0, 52.0, 58.0, 61.0, 75.0, 58.0, 71.0, 57.0, 64.0, 53.0, 66.0, 67.0, 63.0, 41.0, 104.0, 52.0, 54.0, 62.0, 85.0, 57.0, 147.0, 47.0, 156.0, 55.0, 52.0, 57.0, 91.0, 46.0, 44.0, 62.0, 82.0, 46.0, 63.0, 88.0, 53.0, 54.0, 51.0, 58.0, 67.0, 53.0, 53.0, 69.0, 90.0, 114.0, 57.0, 102.0, 85.0, 62.0, 109.0, 95.0, 73.0, 66.0, 119.0, 134.0, 74.0, 89.0, 113.0, 88.0, 84.0, 79.0, 116.0, 96.0, 91.0, 88.0, 70.0, 107.0, 56.0, 56.0, 73.0, 102.0, 83.0, 100.0, 87.0, 77.0, 84.0, 40.0, 62.0, 90.0, 64.0, 45.0, 45.0, 73.0, 83.0, 52.0, 57.0, 78.0, 69.0, 44.0, 42.0, 63.0, 61.0, 56.0, 67.0, 61.0, 81.0, 53.0, 59.0, 59.0, 57.0, 82.0, 53.0, 65.0, 43.0, 32.0, 62.0, 48.0, 41.0, 38.0, 74.0, 76.0, 29.0, 64.0, 54.0, 59.0, 55.0, 69.0, 65.0, 60.0, 69.0, 79.0, 48.0, 56.0, 60.0, 42.0, 75.0, 57.0, 76.0, 51.0, 54.0, 67.0, 64.0, 55.0, 61.0, 70.0, 57.0, 73.0, 58.0, 74.0, 65.0, 72.0, 71.0, 80.0, 77.0, 66.0, 47.0, 58.0, 81.0, 65.0, 77.0, 81.0, 77.0, 71.0, 87.0, 42.0, 81.0, 82.0, 67.0, 58.0, 64.0, 67.0, 63.0, 76.0, 49.0, 69.0, 71.0, 63.0, 79.0, 54.0, 65.0, 43.0, 40.0, 89.0, 65.0, 84.0, 57.0, 53.0, 68.0, 61.0, 83.0, 90.0, 70.0, 84.0, 53.0, 69.0, 60.0, 53.0, 56.0, 66.0, 47.0, 75.0, 67.0, 69.0, 53.0, 83.0, 75.0, 55.0, 39.0, 54.0, 69.0, 59.0, 56.0, 61.0, 72.0, 55.0, 54.0, 63.0, 58.0, 65.0, 59.0, 56.0, 83.0, 59.0, 48.0, 69.0, 69.0, 50.0, 59.0, 54.0, 52.0, 52.0, 75.0, 61.0, 61.0, 55.0, 64.0, 66.0, 51.0, 76.0, 39.0, 35.0, 59.0, 64.0, 72.0, 67.0, 39.0, 62.0, 52.0, 65.0, 51.0, 50.0, 77.0, 56.0, 70.0, 86.0, 53.0, 57.0, 77.0, 48.0, 42.0, 64.0, 63.0, 56.0, 48.0, 54.0, 82.0, 57.0, 74.0, 61.0, 47.0, 63.0, 48.0, 54.0, 63.0, 66.0, 63.0, 53.0, 50.0, 70.0, 60.0, 53.0, 56.0, 61.0, 49.0, 61.0, 52.0, 62.0, 60.0, 51.0, 52.0, 90.0, 46.0, 47.0, 62.0, 62.0, 60.0, 49.0, 61.0, 41.0, 53.0, 60.0, 53.0, 58.0, 73.0, 49.0, 77.0, 64.0, 52.0, 55.0, 63.0, 70.0, 84.0, 55.0, 52.0, 68.0, 79.0, 54.0, 77.0, 73.0, 55.0, 49.0, 71.0, 52.0, 68.0, 70.0, 56.0, 45.0, 32.0, 63.0, 33.0, 69.0, 51.0, 74.0, 58.0, 64.0, 55.0, 46.0, 57.0, 62.0, 56.0, 55.0, 76.0, 70.0, 57.0, 39.0, 55.0, 56.0, 62.0, 52.0, 60.0, 55.0, 50.0, 75.0, 78.0, 53.0, 59.0, 82.0, 74.0, 63.0, 55.0, 69.0, 63.0, 59.0, 54.0, 68.0, 164.0, 53.0, 51.0, 78.0, 64.0, 50.0, 60.0, 53.0, 61.0, 64.0, 52.0, 45.0, 70.0, 50.0, 57.0, 53.0, 75.0, 71.0, 39.0, 71.0, 51.0, 58.0, 78.0, 49.0, 47.0, 42.0, 79.0, 67.0, 60.0, 51.0, 53.0, 53.0, 47.0, 56.0, 63.0, 53.0, 69.0, 51.0, 56.0, 78.0, 75.0, 50.0, 71.0, 68.0, 66.0, 41.0, 60.0, 54.0, 52.0, 62.0, 46.0, 282.0, 49.0, 72.0, 61.0, 49.0, 56.0, 44.0, 73.0], "perfect_forward_times": [42.0, 39.0, 37.0, 35.0, 42.0, 35.0, 37.0, 41.0, 45.0, 41.0, 30.0, 41.0, 28.0, 36.0, 36.0, 30.0, 31.0, 42.0, 29.0, 36.0, 31.0, 27.0, 31.0, 27.0, 30.0, 26.0, 25.0, 27.0, 37.0, 35.0, 26.0, 26.0, 30.0, 26.0, 34.0, 25.0, 27.0, 28.0, 27.0, 27.0, 26.0, 20.0, 39.0, 32.0, 28.0, 21.0, 28.0, 29.0, 37.0, 30.0, 35.0, 35.0, 26.0, 28.0, 31.0, 28.0, 26.0, 26.0, 29.0, 28.0, 29.0, 28.0, 27.0, 28.0, 27.0, 27.0, 34.0, 36.0, 32.0, 28.0, 33.0, 33.0, 34.0, 36.0, 33.0, 27.0, 33.0, 37.0, 31.0, 26.0, 25.0, 36.0, 24.0, 31.0, 29.0, 29.0, 29.0, 31.0, 24.0, 31.0, 30.0, 30.0, 30.0, 35.0, 31.0, 27.0, 26.0, 35.0, 39.0, 45.0, 35.0, 43.0, 33.0, 36.0, 41.0, 27.0, 46.0, 40.0, 38.0, 41.0, 41.0, 37.0, 40.0, 42.0, 29.0, 35.0, 31.0, 28.0, 28.0, 28.0, 34.0, 47.0, 28.0, 33.0, 41.0, 37.0, 37.0, 30.0, 39.0, 36.0, 31.0, 39.0, 39.0, 36.0, 42.0, 36.0, 38.0, 32.0, 41.0, 43.0, 36.0, 39.0, 38.0, 36.0, 36.0, 36.0, 40.0, 39.0, 39.0, 39.0, 36.0, 38.0, 38.0, 40.0, 41.0, 34.0, 39.0, 39.0, 34.0, 34.0, 41.0, 39.0, 40.0, 44.0, 30.0, 37.0, 39.0, 37.0, 35.0, 31.0, 39.0, 38.0, 37.0, 35.0, 36.0, 38.0, 47.0, 39.0, 40.0, 39.0, 44.0, 35.0, 42.0, 35.0, 39.0, 36.0, 42.0, 43.0, 36.0, 38.0, 41.0, 36.0, 39.0, 39.0, 36.0, 40.0, 39.0, 35.0, 39.0, 41.0, 37.0, 39.0, 40.0, 36.0, 41.0, 40.0, 34.0, 34.0, 38.0, 38.0, 40.0, 38.0, 49.0, 36.0, 40.0, 36.0, 40.0, 38.0, 37.0, 38.0, 44.0, 40.0, 40.0, 27.0, 42.0, 38.0, 39.0, 35.0, 37.0, 29.0, 36.0, 28.0, 28.0, 37.0, 39.0, 40.0, 34.0, 31.0, 34.0, 33.0, 36.0, 37.0, 30.0, 43.0, 37.0, 39.0, 39.0, 37.0, 42.0, 42.0, 41.0, 46.0, 32.0, 40.0, 31.0, 38.0, 43.0, 42.0, 38.0, 33.0, 41.0, 42.0, 46.0, 26.0, 39.0, 40.0, 41.0, 29.0, 28.0, 46.0, 39.0, 39.0, 33.0, 42.0, 39.0, 36.0, 28.0, 39.0, 29.0, 40.0, 32.0, 38.0, 30.0, 42.0, 45.0, 29.0, 29.0, 33.0, 30.0, 28.0, 30.0, 35.0, 28.0, 32.0, 30.0, 34.0, 32.0, 32.0, 31.0, 25.0, 30.0, 27.0, 29.0, 27.0, 26.0, 26.0, 26.0, 34.0, 26.0, 31.0, 38.0, 33.0, 34.0, 29.0, 28.0, 18.0, 34.0, 54.0, 31.0, 30.0, 31.0, 32.0, 26.0, 28.0, 27.0, 28.0, 30.0, 30.0, 29.0, 26.0, 25.0, 31.0, 29.0, 26.0, 27.0, 32.0, 27.0, 31.0, 27.0, 28.0, 29.0, 28.0, 33.0, 28.0, 29.0, 34.0, 30.0, 33.0, 37.0, 42.0, 30.0, 36.0, 32.0, 25.0, 33.0, 30.0, 30.0, 28.0, 29.0, 32.0, 30.0, 37.0, 28.0, 28.0, 25.0, 30.0, 30.0, 31.0, 27.0, 28.0, 31.0, 32.0, 28.0, 27.0, 28.0, 34.0, 35.0, 26.0, 39.0, 39.0, 29.0, 39.0, 28.0, 36.0, 35.0, 37.0, 39.0, 39.0, 41.0, 41.0, 53.0, 33.0, 40.0, 28.0, 31.0, 38.0, 37.0, 29.0, 35.0, 37.0, 28.0, 39.0, 44.0, 37.0, 48.0, 31.0, 39.0, 39.0, 40.0, 29.0, 30.0, 40.0, 40.0, 43.0, 33.0, 40.0, 29.0, 39.0, 41.0, 39.0, 37.0, 39.0, 31.0, 30.0, 39.0, 40.0, 40.0, 42.0, 39.0, 39.0, 40.0, 39.0, 39.0, 32.0, 46.0, 41.0, 46.0, 35.0, 35.0, 36.0, 37.0, 48.0, 40.0, 37.0, 31.0, 44.0, 39.0, 39.0, 37.0, 38.0, 43.0, 37.0, 34.0, 36.0, 43.0, 37.0, 41.0, 40.0, 40.0, 51.0, 30.0, 38.0, 39.0, 38.0, 28.0, 38.0, 39.0, 38.0, 27.0, 44.0, 40.0, 38.0, 39.0, 43.0, 43.0, 30.0, 33.0, 42.0, 36.0, 42.0, 41.0, 34.0, 38.0, 38.0, 39.0, 42.0, 37.0, 37.0, 37.0, 33.0, 38.0, 37.0, 46.0, 35.0, 46.0, 42.0, 47.0, 44.0, 39.0, 38.0, 33.0, 46.0, 39.0, 34.0, 45.0, 37.0, 33.0, 36.0, 36.0, 39.0, 36.0, 31.0, 37.0, 38.0, 45.0, 37.0, 38.0, 33.0, 32.0, 37.0, 37.0, 39.0, 37.0, 43.0, 50.0, 36.0, 39.0, 38.0, 39.0, 36.0, 44.0, 30.0, 41.0, 41.0, 40.0, 30.0, 39.0, 35.0, 38.0, 40.0, 40.0, 42.0, 41.0, 31.0, 37.0, 40.0, 40.0, 29.0, 42.0, 37.0, 32.0, 31.0, 28.0, 30.0, 29.0, 29.0, 28.0, 28.0, 30.0, 28.0, 26.0, 27.0, 24.0, 31.0, 26.0, 29.0, 32.0, 28.0, 35.0, 19.0, 41.0, 27.0, 27.0, 28.0, 24.0, 35.0, 32.0, 29.0, 40.0, 31.0, 26.0, 28.0, 27.0, 35.0, 25.0, 29.0, 31.0, 36.0, 27.0, 35.0, 30.0, 31.0, 29.0, 26.0, 26.0, 26.0, 27.0, 25.0, 28.0, 29.0, 30.0, 26.0, 27.0, 25.0, 27.0, 26.0, 30.0, 26.0, 34.0, 33.0, 28.0, 28.0, 34.0, 33.0, 39.0, 39.0, 33.0, 36.0, 29.0, 34.0, 30.0, 37.0, 30.0, 31.0, 30.0, 31.0, 33.0, 30.0, 34.0, 25.0, 31.0, 29.0, 32.0, 31.0, 36.0, 32.0, 32.0, 32.0, 27.0, 28.0, 27.0, 27.0, 29.0, 31.0, 25.0, 28.0, 31.0, 28.0, 27.0, 26.0, 28.0, 28.0, 32.0, 29.0, 28.0, 31.0, 28.0, 28.0, 28.0, 25.0, 27.0, 32.0, 44.0, 26.0, 26.0, 29.0, 26.0, 26.0, 30.0, 27.0, 25.0, 42.0, 36.0, 39.0, 38.0, 31.0, 27.0, 27.0, 30.0, 31.0, 31.0, 26.0, 26.0, 23.0, 30.0, 28.0, 31.0, 32.0, 37.0, 25.0, 25.0, 30.0, 31.0, 25.0, 27.0, 26.0, 37.0, 48.0, 40.0, 36.0, 36.0, 40.0, 38.0, 41.0, 38.0, 32.0, 40.0, 39.0, 31.0, 42.0, 45.0, 39.0, 42.0, 30.0, 34.0, 41.0, 31.0, 45.0, 32.0, 38.0, 45.0, 40.0, 42.0, 38.0, 36.0, 42.0, 40.0, 42.0, 46.0, 38.0, 29.0, 26.0, 28.0, 26.0, 27.0, 26.0, 25.0, 27.0, 24.0, 23.0, 26.0, 24.0, 26.0, 24.0, 23.0, 25.0, 23.0, 24.0, 26.0, 40.0, 28.0, 25.0, 24.0, 25.0, 26.0, 25.0, 24.0, 25.0, 25.0, 23.0, 24.0, 27.0, 30.0, 24.0, 25.0, 25.0, 25.0, 24.0, 26.0, 25.0, 24.0, 24.0, 24.0, 27.0, 26.0, 23.0, 27.0, 36.0, 28.0, 27.0, 27.0, 25.0, 25.0, 28.0, 27.0, 28.0, 29.0, 23.0, 24.0, 24.0, 26.0, 23.0, 41.0, 24.0, 42.0, 26.0, 28.0, 25.0, 35.0, 24.0, 39.0, 37.0, 36.0, 27.0, 28.0, 38.0, 29.0, 34.0, 39.0, 36.0, 34.0, 37.0, 30.0, 35.0, 42.0, 40.0, 42.0, 38.0, 38.0, 34.0, 32.0, 28.0, 29.0, 26.0, 26.0, 28.0, 39.0, 41.0, 28.0, 44.0, 28.0, 28.0, 26.0, 39.0, 35.0, 34.0, 45.0, 36.0, 28.0, 30.0, 26.0, 29.0, 28.0, 29.0, 29.0, 29.0, 25.0, 28.0, 28.0, 26.0, 26.0, 28.0, 25.0, 27.0, 26.0, 25.0, 26.0, 24.0, 25.0, 25.0, 26.0, 38.0, 26.0, 25.0, 23.0, 24.0, 20.0, 26.0, 26.0, 24.0, 25.0, 24.0, 26.0, 26.0, 31.0, 27.0, 28.0, 22.0, 25.0, 28.0, 26.0, 24.0, 26.0, 25.0, 27.0, 26.0, 25.0, 28.0, 28.0, 25.0, 24.0, 27.0, 25.0, 27.0, 26.0, 24.0, 24.0, 24.0, 28.0, 26.0, 26.0, 25.0, 26.0, 25.0, 25.0, 24.0, 25.0, 27.0, 26.0, 25.0, 27.0, 28.0, 27.0, 24.0, 24.0, 24.0, 25.0, 24.0, 24.0, 24.0, 24.0, 26.0, 27.0, 25.0, 23.0, 25.0, 25.0, 24.0, 26.0, 25.0, 25.0, 27.0, 24.0, 26.0, 25.0, 28.0, 25.0, 25.0, 29.0, 26.0, 25.0, 25.0, 28.0, 26.0, 26.0, 23.0, 26.0, 27.0, 26.0, 26.0, 26.0, 27.0, 26.0, 26.0, 25.0, 26.0, 23.0, 26.0, 27.0, 26.0, 27.0, 23.0, 24.0, 29.0, 23.0, 25.0, 29.0, 26.0, 27.0, 27.0, 27.0, 26.0, 25.0, 23.0, 24.0, 26.0, 25.0, 24.0, 24.0, 25.0, 26.0, 24.0, 24.0, 23.0, 24.0, 26.0, 24.0, 24.0, 27.0, 24.0, 25.0, 25.0, 25.0, 25.0, 26.0, 24.0, 26.0, 25.0, 27.0, 24.0, 25.0, 27.0, 25.0, 25.0, 26.0, 23.0, 25.0, 25.0, 24.0, 29.0, 26.0, 26.0, 25.0, 25.0, 24.0, 25.0, 27.0, 25.0, 26.0, 24.0, 23.0, 26.0, 31.0, 25.0, 23.0, 25.0, 24.0, 24.0, 25.0, 24.0, 26.0, 28.0, 25.0, 25.0, 26.0, 24.0, 25.0, 26.0, 26.0, 25.0, 24.0, 26.0, 26.0, 26.0, 25.0, 27.0, 26.0, 25.0, 26.0, 26.0, 22.0, 25.0, 24.0, 26.0, 25.0, 24.0, 25.0, 24.0, 26.0, 27.0, 26.0, 25.0, 23.0, 30.0, 24.0, 24.0, 25.0, 24.0], "other_info": {"gcc": "13.2.1", "linux": "6.7.3-arch1-1", "CPU": "11th Gen Intel i5-1135G7 (8) @ 4.200GHz", "Memory": "39963MiB DDR4 @ 3200MHz"}}
#include <iostream>
#include <utility>
#include <vector>
#include <chrono>
#include <limits>
class HeavyObject
{
public:
HeavyObject()
{
// 4 pages of data
// data.resize(4 * 4096);
}
HeavyObject(const HeavyObject &)
{
}
HeavyObject(HeavyObject &&) noexcept
{
}
~HeavyObject()
{
}
// Some meaningful methods here
void processData()
{
// Process data...
}
private:
std::vector<int> data;
};
void processWithPointer(HeavyObject *obj)
{
obj->processData();
// More operations...
}
template <typename T>
void processWithPerfectForwarding(T &&obj)
{
std::forward<T>(obj).processData();
// More operations...
}
int main()
{
constexpr auto iterations = std::numeric_limits<int>::max(); // Number of iterations for the measurement
// Measure time for C-style pointer
auto start1 = std::chrono::high_resolution_clock::now();
for (int i = 0; i < iterations; ++i)
{
HeavyObject obj;
processWithPointer(&obj);
}
auto finish1 = std::chrono::high_resolution_clock::now();
// Measure time for perfect forwarding
auto start2 = std::chrono::high_resolution_clock::now();
for (int i = 0; i < iterations; ++i)
{
HeavyObject obj;
processWithPerfectForwarding(std::move(obj));
}
auto finish2 = std::chrono::high_resolution_clock::now();
std::chrono::duration<double, std::nano> elapsed1 = finish1 - start1;
std::chrono::duration<double, std::nano> elapsed2 = finish2 - start2;
std::cout << "Time taken by function with C-style pointer: " << elapsed1.count() << " ns\n";
std::cout << "Time taken by function with perfect forwarding: " << elapsed2.count() << " ns\n";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment