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

Optimizations #133

Merged
merged 3 commits into from
Aug 4, 2024
Merged

Conversation

yuki-was-taken
Copy link
Contributor

Is your pull request linked to an existing issue?

#132

What is your pull request about?:

  1. Added a few compile options to increase performance. As said in this comment, I think it should be safe to enable to danger flag, as any problems should be reported using the debug version.
  2. I added one line to flush stdout in the colors file.
  3. Made all the constants static.

Any other disclosures/notices/things to add?

There is definitely a performance increase of a few milliseconds, on my system it's 2 ms using debug mode, and on hyperfine the results are even faster on release mode.

Benchmark 1: ./bin/catnap
  Time (mean ± σ):       2.0 ms ±   0.1 ms    [User: 1.4 ms, System: 0.5 ms]
  Range (min … max):     1.7 ms …   2.5 ms    1354 runs

@iinsertNameHere iinsertNameHere merged commit 6ee08a5 into iinsertNameHere:main Aug 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants