Refactors the underlying data type to optimize performance

This commit is contained in:
Quinn Henthorne
2024-12-13 17:04:46 -05:00
parent 53f3766658
commit 941758e8ea
4 changed files with 39 additions and 35 deletions

View File

@@ -1,14 +1,14 @@
Addition: 0.55 s
Subtraction: 0.548 s
Multiplication: 3.404 s
Scalar Multiplication: 0.453 s
Element Multiply: 0.347 s
Element Divide: 0.347 s
Minor Matrix: 0.44 s
Determinant: 0.251 s
Matrix of Minors: 1.044 s
Invert: 0.262 s
Transpose: 0.26 s
Normalize: 0.333 s
GET ROW: 0.683 s
GET COLUMN: 0.427 s
Addition: 0.419 s
Subtraction: 0.421 s
Multiplication: 3.297 s
Scalar Multiplication: 0.329 s
Element Multiply: 0.306 s
Element Divide: 0.302 s
Minor Matrix: 0.331 s
Determinant: 0.177 s
Matrix of Minors: 0.766 s
Invert: 0.183 s
Transpose: 0.215 s
Normalize: 0.315 s
GET ROW: 0.008 s
GET COLUMN: 0.43 s

View File

@@ -83,7 +83,7 @@ for new_timing in new_timings:
for old_timing in old_timings:
if new_timing == old_timing:
new_timing.difference = new_timing - old_timing
if new_timing.difference >= 0.03:
if abs(new_timing.difference) >= 0.03:
difference_increased += f"{new_timing.test_name}, "
def save_option():
@@ -102,7 +102,7 @@ for timing in new_timings:
print(timing.to_string_w_diff())
if len(difference_increased) > 0:
print("You increased the time it takes to run for:" + difference_increased)
print("You've made major timing changes for:" + difference_increased)
save_option()
else:
print("No times have changed outside the margin of error.")