DARMA-tasking / LB-analysis-framework

Analysis framework for exploring, testing, and comparing load balancing strategies
Other
3 stars 1 forks source link

#441: Run new performance profiler to see if there are places we can improve it #460

Closed cwschilly closed 10 months ago

cwschilly commented 11 months ago

Fixes #441

cwschilly commented 11 months ago

While some of the "optimizations" seem trivial, others are good catches. For instance, the profiler caught this duplicated code in the run() function of LBAF_app.py:

for phase_id in self.__parameters.phase_ids:
    # Create a phase and populate it
    phase = Phase(
        self.__logger, phase_id, reader=reader)
    phase.populate_from_log(phase_id)
    phases[phase_id] = phase
    phase = Phase(
        self.__logger, phase_id, reader=reader)
    phase.populate_from_log(phase_id)
    phases[phase_id] = phase

I timed the execution of the run function through multiple iterations of adding these optimizations. Averaging the times from three runs on challenging-toy-hundreds-tasks.yaml, here are the results:

Change Average run() time (s)
Original state 66.327
Change print_statistics call 52.208
Change arrangement sorting 59.030
Remove duplicated phase block 38.445
Rework qoi_request list 45.639

These are cumulative results.


Clearly some changes were more impactful than others. The timings also varied a lot, so it's not worth going by these alone. Let me know @ppebay @lifflander if you want to keep any/all of these changes. I'll update this table if I make any more revisions.

cwschilly commented 10 months ago

Thanks @ppebay , I made the requested change.