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

Improve field count typical case performance #120

Merged
merged 38 commits into from
Oct 9, 2024

Commits on Jan 18, 2023

  1. Improve field count typical case performance

    The tightest upper bound one can specify on the number of fields in a
    struct is `sizeof(type) * CHAR_BIT`. So this was previously used when
    performing a binary search for the field count. This upper bound is
    extremely loose when considering a typical large struct, which is more
    likely to contain a relatively small number of relatively large fields
    rather than the other way around. The binary search range being multiple
    orders of magnitude larger than necessary wouldn't have been a
    significant issue if each test was cheap, but they're not. Testing a
    field count of N costs O(N) memory and time. As a result, the initial
    few steps of the binary search may be prohibitively expensive.
    
    The primary optimization introduced by these changes is to use unbounded
    binary search, a.k.a. exponential search, instead of the typically
    loosely bounded binary search. This produces a tight upper bound (within
    2x) on the field count to then perform the binary search with.
    
    As an upside of this change, the compiler-specific limit placed on the
    upper bound on the field count to stay within compiler limits could be
    removed.
    runer112 authored Jan 18, 2023
    Configuration menu
    Copy the full SHA
    6312e37 View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2023

  1. Configuration menu
    Copy the full SHA
    aac7c36 View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2023

  1. Don't test in parallel

    In the last CI run, 15 tasks failed with a compiler is out of heap space error.
    With the jobs running in parallel, it's hard to determine which tasks failed due
    to their own excessive memory usage and which were well-behaved, but a victim of
    running when another task consumed all the available memory.
    runer112 authored Jan 24, 2023
    Configuration menu
    Copy the full SHA
    57bbe0c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    096445f View commit details
    Browse the repository at this point in the history
  3. Restore parallel testing

    runer112 authored Jan 24, 2023
    Configuration menu
    Copy the full SHA
    de5d6f4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    28bd7f5 View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2023

  1. Add more field count tests

    runer112 authored Feb 10, 2023
    Configuration menu
    Copy the full SHA
    e80f7aa View commit details
    Browse the repository at this point in the history
  2. Oops

    runer112 authored Feb 10, 2023
    Configuration menu
    Copy the full SHA
    ca3ca70 View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2023

  1. Prevent unbounded field count test growth

    This could happen for a type with a constructor accepting a parameter
    pack.
    
    This also prevents unbounded growth in case something goes wrong with
    the logic and something should have already stopped (or never started).
    runer112 authored Feb 11, 2023
    Configuration menu
    Copy the full SHA
    dd1ae1c View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2024

  1. Configuration menu
    Copy the full SHA
    ea57b67 View commit details
    Browse the repository at this point in the history
  2. Update copyright years

    runer112 committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    5b2b1cc View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2024

  1. Configuration menu
    Copy the full SHA
    170338c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    63374ef View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2024

  1. Configuration menu
    Copy the full SHA
    a6d0c5f View commit details
    Browse the repository at this point in the history
  2. Address MSVC issue

    runer112 committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    27a5c6e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    465ff1b View commit details
    Browse the repository at this point in the history
  4. Skip inheritance check for non-classes

    Makes the evaluation of the field count of huge arrays not result in
    excessive compiler resource utilization.
    runer112 committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    5546762 View commit details
    Browse the repository at this point in the history
  5. Skip hand-made aggregate check for non-classes

    Makes the evaluation of the field count of huge arrays not result in
    excessive compiler resource utilization.
    runer112 committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    5e655d4 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    cbc57cc View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2024

  1. Configuration menu
    Copy the full SHA
    85d05cf View commit details
    Browse the repository at this point in the history
  2. Fix incorrect include path

    runer112 authored Sep 30, 2024
    Configuration menu
    Copy the full SHA
    82770f5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c5424df View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2024

  1. Configuration menu
    Copy the full SHA
    ee3238e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ff14705 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d222d98 View commit details
    Browse the repository at this point in the history
  4. Avoid including <algorithm>

    runer112 committed Oct 4, 2024
    Configuration menu
    Copy the full SHA
    ae8ce8d View commit details
    Browse the repository at this point in the history
  5. Refine compiler size limits

    Verified ok targeting both x86 and x86-64 for:
    - clang 3.7.1
    - clang 19.1.0
    - gcc 8.2
    - gcc 14.2
    - msvc 19.20
    - msvc 19.40
    runer112 committed Oct 4, 2024
    Configuration menu
    Copy the full SHA
    f461689 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    5978e52 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    68e6aba View commit details
    Browse the repository at this point in the history
  8. Revert "Prevent unnecessary triggering of last-resort assertion"

    This reverts commit a6d0c5f.
    
    Conflicts:
    - include/boost/pfr/detail/fields_count.hpp
    runer112 committed Oct 4, 2024
    Configuration menu
    Copy the full SHA
    13f29c6 View commit details
    Browse the repository at this point in the history
  9. Revert "Add complete type precondition and condition evaluation on pr…

    …econditions"
    
    This reverts commit 096445f.
    
    Conflicts:
    - include/boost/pfr/detail/fields_count.hpp
    runer112 committed Oct 4, 2024
    Configuration menu
    Copy the full SHA
    ab3621c View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    d6677de View commit details
    Browse the repository at this point in the history
  11. Restore original whitespace

    runer112 committed Oct 4, 2024
    Configuration menu
    Copy the full SHA
    cdec333 View commit details
    Browse the repository at this point in the history
  12. Attempt to match code style

    runer112 committed Oct 4, 2024
    Configuration menu
    Copy the full SHA
    15e42ea View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    d643b5c View commit details
    Browse the repository at this point in the history
  14. Prevent ADL

    runer112 committed Oct 4, 2024
    Configuration menu
    Copy the full SHA
    4adba12 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2024

  1. Match code style

    runer112 authored Oct 7, 2024
    Configuration menu
    Copy the full SHA
    8395a30 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fe6f150 View commit details
    Browse the repository at this point in the history