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

Common: Remove dependency on cpp-optparse (Only for FEXLoader) #4070

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Sep 18, 2024

  1. Common: Remove dependency on cpp-optparse

    Doesn't remove it from the full project since three tools still use it.
    
    FEXLoader argument loader is fairly special since we have a generator
    tied to it. This generator lets us have some niceties where everything
    ends up being a string literal without any sort of dynamic requirements.
    
    cpp-optparse has a systemic issue where it makes deep copies of
    /everything/ all the time. This means it has huge runtime costs and huge
    stack usage (4992 bytes). The new implementation uses 608 bytes of stack
    space (plus 640 if it actually parses a strenum).
    
    When profiling cpp-optparse with FEXLoader's argument it takes ~2,039,307 ns to parse the arguments!
    As a direct comparison this new implementation takes ~56,885 ns.
    Both sides not getting passed /any/ arguments, really shows how spicy
    this library is.
    Sonicadvance1 committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    c4da55f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b6c9a5b View commit details
    Browse the repository at this point in the history