Fix inputs and add methods
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
df = pd.read_csv("benchmark.csv")
|
||||
|
||||
plt.figure(figsize=(10, 6))
|
||||
|
||||
plt.plot(df["elements"], df["hash"], marker='o', label="Hash map")
|
||||
plt.plot(df["elements"], df["array"], marker='o', label="Array")
|
||||
|
||||
# LOG SCALE
|
||||
plt.xscale("log")
|
||||
plt.yscale("log")
|
||||
|
||||
plt.xlabel("Number of elements (log scale)")
|
||||
plt.ylabel("Time (ms) (log scale)")
|
||||
plt.title("Array vs Hash Map Lookup Performance")
|
||||
|
||||
plt.grid(True, which="both", linestyle="--", alpha=0.5)
|
||||
plt.legend()
|
||||
|
||||
plt.show()
|
||||
|
||||
plt.savefig("benchmark.png", dpi=200, bbox_inches="tight")
|
||||
Reference in New Issue
Block a user