Skip to content

Commit

Permalink
Include processing speed in best order
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusWirtz committed Oct 26, 2021
1 parent 464ef92 commit 6f5f5a1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion optimuspy.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def main(instance_name: str, view_name: str, process_name: str, executions: int,
tm1.cubes.update_storage_dimension_order(cube_name, best_order)
logging.info(f"Updated dimension order for cube '{cube_name}' to {best_order}")
else:
logging.info(f"Best order for cube '{cube_name}' {best_order}")
logging.info(f"Best order for cube '{cube_name}': {best_order}")
tm1.cubes.update_storage_dimension_order(cube_name, original_dimension_order)
logging.info(
f"Restored original dimension order for cube '{cube_name}' to {original_dimension_order}")
Expand Down
13 changes: 10 additions & 3 deletions results.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,22 @@ def determine_best_result(self) -> Union[PermutationResult, None]:
min_ram, max_ram = min(ram_range), max(ram_range)

query_speed_range = [result.median_query_time() for result in self.permutation_results]
process_speed_range = [result.median_process_time(result.process_name) for result in self.permutation_results]

min_query_speed, max_query_speed = min(query_speed_range), max(query_speed_range)
min_process_execution, max_process_execution = min(process_speed_range), max(process_speed_range)

# find a good balance between speed and ram
for value in (0.01, 0.025, 0.05, 0.075, 0.1, 0.125, 0.15, 0.2, 0.25):
# find a good balance between speed and ram and process speed
for value in (0.01, 0.025, 0.05):
ram_threshold = min_ram + value * (max_ram - min_ram)
query_speed_threshold = min_query_speed + value * (max_query_speed - min_query_speed)
process_speed_threshold = min_process_execution + value * (max_process_execution - min_process_execution)

for permutation_result in self.permutation_results:
if all([permutation_result.ram_usage <= ram_threshold,
permutation_result.median_query_time() <= query_speed_threshold]):
permutation_result.median_query_time() <= query_speed_threshold,
permutation_result.median_process_time() <= process_speed_threshold]):

return permutation_result

# no dimension order falls in sweet spot
Expand Down

0 comments on commit 6f5f5a1

Please sign in to comment.