Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 47 additions & 37 deletions python/benchmarks/graph_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,66 @@

plt.figure(figsize=(10, 6))

plt.style.use('dark_background')
plt.style.use("dark_background")
fig = plt.gcf()
fig.patch.set_facecolor('#222222')
fig.patch.set_facecolor("#222222")
ax = plt.gca()
ax.set_facecolor('#222222')
ax.set_facecolor("#222222")

plt.plot(counts, insert_execution_times, marker='o', color='mediumseagreen',
linewidth=2, markersize=8, markeredgecolor='lightgreen',
markerfacecolor='mediumseagreen')
plt.plot(
counts,
insert_execution_times,
marker="o",
color="mediumseagreen",
linewidth=2,
markersize=8,
markeredgecolor="lightgreen",
markerfacecolor="mediumseagreen",
)

plt.xscale('log')
plt.yscale('log')
plt.xscale("log")
plt.yscale("log")

plt.title('Time Taken to Insert Records vs. Number of Records',
color='#DDD', pad=20)
plt.xlabel('Number of Records (log scale)', color='#DDD')
plt.ylabel('Time Taken (seconds, log scale)', color='#DDD')
plt.title("Time Taken to Insert Records vs. Number of Records", color="#DDD", pad=20)
plt.xlabel("Number of Records (log scale)", color="#DDD")
plt.ylabel("Time Taken (seconds, log scale)", color="#DDD")

plt.grid(True, which="both", linestyle='--', linewidth=0.5,
color='#444444', alpha=0.7)
plt.grid(True, which="both", linestyle="--", linewidth=0.5, color="#444444", alpha=0.7)

plt.xticks(counts, color='#DDD')
plt.yticks(color='#DDD')
plt.xticks(counts, color="#DDD")
plt.yticks(color="#DDD")

plt.tight_layout()
plt.show()

plt.style.use('dark_background')
plt.style.use("dark_background")
fig = plt.gcf()
fig.patch.set_facecolor('#222222')
fig.patch.set_facecolor("#222222")
ax = plt.gca()
ax.set_facecolor('#222222')

plt.plot(counts, update_execution_times, marker='o', color='mediumseagreen',
linewidth=2, markersize=8, markeredgecolor='lightgreen',
markerfacecolor='mediumseagreen')

plt.xscale('log')
plt.yscale('log')

plt.title('Time Taken to Update Records vs. Number of Records',
color='#DDD', pad=20)
plt.xlabel('Number of Records (log scale)', color='#DDD')
plt.ylabel('Time Taken (seconds, log scale)', color='#DDD')

plt.grid(True, which="both", linestyle='--', linewidth=0.5,
color='#444444', alpha=0.7)

plt.xticks(counts, color='#DDD')
plt.yticks(color='#DDD')
ax.set_facecolor("#222222")

plt.plot(
counts,
update_execution_times,
marker="o",
color="mediumseagreen",
linewidth=2,
markersize=8,
markeredgecolor="lightgreen",
markerfacecolor="mediumseagreen",
)

plt.xscale("log")
plt.yscale("log")

plt.title("Time Taken to Update Records vs. Number of Records", color="#DDD", pad=20)
plt.xlabel("Number of Records (log scale)", color="#DDD")
plt.ylabel("Time Taken (seconds, log scale)", color="#DDD")

plt.grid(True, which="both", linestyle="--", linewidth=0.5, color="#444444", alpha=0.7)

plt.xticks(counts, color="#DDD")
plt.yticks(color="#DDD")

plt.tight_layout()
plt.show()
4 changes: 2 additions & 2 deletions python/benchmarks/scaling_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def run_inserts(amount: int):
db = Database()
grades_table = db.create_table('Grades', 5, 0)
grades_table = db.create_table("Grades", 5, 0)
query = Query(grades_table)

for i in range(0, amount):
Expand All @@ -16,7 +16,7 @@ def run_inserts(amount: int):

def run_updates(amount: int):
db = Database()
grades_table = db.create_table('Grades', 5, 0)
grades_table = db.create_table("Grades", 5, 0)
query = Query(grades_table)

for i in range(0, amount):
Expand Down
2 changes: 1 addition & 1 deletion python/benchmarks/simple_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from lstore.query import Query

db = Database()
table = db.create_table('Count', 3, 0)
table = db.create_table("Count", 3, 0)
query = Query(table)

rec = query.insert(0, 10, 20)
Expand Down
2 changes: 1 addition & 1 deletion python/benchmarks/simple_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
print_logo()

db = Database()
grades_table = db.create_table('Grades', 5, 0)
grades_table = db.create_table("Grades", 5, 0)
query = Query(grades_table)

recs = []
Expand Down
10 changes: 6 additions & 4 deletions python/benchmarks/speedtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,17 @@
{
"Operation": operations * 2,
"Time (s)": release_times + debug_times,
"Mode": ["Release Mode"] * len(release_times) + ["Debug Mode"] * len(debug_times),
"Mode": ["Release Mode"] * len(release_times)
+ ["Debug Mode"] * len(debug_times),
}
)

df_tests = pd.DataFrame(
{
"Test": tests * 2,
"Time (s)": release_tests + debug_tests,
"Mode": ["Release Mode"] * len(release_tests) + ["Debug Mode"] * len(debug_tests),
"Mode": ["Release Mode"] * len(release_tests)
+ ["Debug Mode"] * len(debug_tests),
}
)

Expand Down Expand Up @@ -131,7 +133,7 @@
ha="right",
color="#DDD",
)
ax.tick_params(axis='y', colors='#DDD')
ax.tick_params(axis="y", colors="#DDD")
ax.legend(title="Mode")

ax.set_facecolor("#222222")
Expand Down Expand Up @@ -170,7 +172,7 @@
color="#DDD",
)
plt.xticks(range(len(tests)), tests, rotation=30, ha="right", color="#DDD")
ax.tick_params(axis='y', colors='#DDD')
ax.tick_params(axis="y", colors="#DDD")
ax.legend(title="Mode")

ax.set_facecolor("#222222")
Expand Down
2 changes: 2 additions & 0 deletions python/lstore/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Final
from .lstore import RDatabase, RTable, hello_from_rust, RTableHandle


def print_logo():
logo = r"""
______ _ _____ _
Expand All @@ -20,6 +21,7 @@ def print_logo():

print(logo)


__all__: Final[list[str]] = [
"lstore",
]