Skip to content

Performance should be dependent on infected persons #1115

Closed

Description

@xsaschako

Motivation / Current Behaviour

Currently it doesnt make a huge difference, if a lot of people are infectious for the runtime.
But it should, as we do alot of unneccessary work.

Enhancement description

We need to just do it for a cell/location with a transmission risk. Currently we do this for every location.

Additional context

Checklist

  • Attached labels, especially loc:: or model:: labels.
  • Linked to project

Activity

  1. self-assigned this
    on Aug 22, 2024
  2. xsaschako commented on Aug 22, 2024

    @xsaschako
    MemberAuthor

    On paper branch: when caching exposure rate flag location as infecitous.
    On main: probablysame

  3. xsaschako commented on Aug 22, 2024

    @xsaschako
    MemberAuthor

    first tests on main show a 20% performance gain

  4. moved this from Product Backlog 📕 to Done (Sprint) 🎉 in MEmilio: Agent-Based-Model Developmenton May 8, 2025
  5. xsaschako commented on May 8, 2025

    @xsaschako
    MemberAuthor

    As we already return early, if there is no infectious person (random event with sum =0) we are already sipping the computational heavy stuff (RNG)

    I also couldn't find an improvement, although i was certain i saw one earlier, but to no avail i didn't find it anymore.

    The Benchmark was tested for 20 days, at the end of the 20 days almost everyone was infected(inf_state = 0, sum = 7234 at the end (so at least 85% infected)

    Before benchmark:

    ---------------------------------------------------------------------------
    Benchmark                                 Time             CPU   Iterations
    ---------------------------------------------------------------------------
    abm_benchmark/abm_benchmark_50k        2137 ms         2134 ms            1
    abm_benchmark/abm_benchmark_100k       4424 ms         4419 ms            1
    

    Benchmark with early return for interaction (no interaction at all):

    ---------------------------------------------------------------------------
    Benchmark                                 Time             CPU   Iterations
    ---------------------------------------------------------------------------
    abm_benchmark/abm_benchmark_50k        1482 ms         1481 ms            1
    abm_benchmark/abm_benchmark_100k       3334 ms         3331 ms            1
    

    Benchmark with no infectious persons and no early return:

    ---------------------------------------------------------------------------
    Benchmark                                 Time             CPU   Iterations
    ---------------------------------------------------------------------------
    abm_benchmark/abm_benchmark_50k        1545 ms         1545 ms            1
    abm_benchmark/abm_benchmark_100k       3323 ms         3323 ms            1
    
  6. added theissue type on May 16, 2025
  7. xsaschako commented on May 16, 2025

    @xsaschako
    MemberAuthor

    I tested it again, it dosnt make a difference

  8. moved this from Done (Sprint) 🎉 to Review 🕵️‍♂️ in MEmilio: Agent-Based-Model Developmenton May 19, 2025
  9. moved this from Review 🕵️‍♂️ to Done (Sprint) 🎉 in MEmilio: Agent-Based-Model Developmenton May 19, 2025
  10. moved this from Done (Sprint) 🎉 to Done (Total) 💯 in MEmilio: Agent-Based-Model Developmenton May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

class::improvementCleanup that doesn't affect functionalityclass::performancePerformance related issuesgood first issueGood for newcomersmodel::abmThis issue concerns any kind of agent-based model.

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions