Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to improve performances #30

Merged
merged 4 commits into from
Sep 4, 2022
Merged

Commits on Sep 3, 2022

  1. Configuration menu
    Copy the full SHA
    e421ecf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7ead9dd View commit details
    Browse the repository at this point in the history
  3. Try to optimize performances.

    Notes:
    - avoid allocating an Element when iterating using (*Element).Next() and (*Element).Prev()
    - avoid allocating an Element when calling (*OrderedMap).Front() and (*OrderedMap).Back()
    - avoid computing the length of the doubly linked list since it is not strictly needed
    MagnaboscoL committed Sep 3, 2022
    Configuration menu
    Copy the full SHA
    1743bc4 View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2022

  1. v2: use a null terminated doubly linked list instead of a circular one.

    Advantages:
    - no need of (*Element).list field: save both memory and assignations
    - avoid comparisons in (*Element).Next() and (*Element).Prev(): save time
    - allow implicit initialization: style
    - avoid comparisons in (*list).Front() and (*list).Back(): save time
    - keep almost the same execution time for (*list).Remove(), (*list).PushFront() and (*list).PushBack()
    MagnaboscoL committed Sep 4, 2022
    Configuration menu
    Copy the full SHA
    4dccd44 View commit details
    Browse the repository at this point in the history