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

Optimize formatTime utility #3777

Merged
merged 5 commits into from
May 29, 2022
Merged

Conversation

zneix
Copy link
Collaborator

@zneix zneix commented May 29, 2022

Pull request checklist:

  • CHANGELOG.md was updated, if applicable

Description

Cherry-picked from #3775

Benchmark results built on commit a5f0812 with `cmake -DBUILD_BENCHMARKS=On -DBUILD_APP=Off -DUSE_PRECOMPILED_HEADERS=Off -DCMAKE_BUILD_TYPE=Debug`
2022-05-29T00:20:03+02:00
Running ./bin/chatterino-benchmark
Run on (16 X 1983.15 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x8)
  L1 Instruction 32 KiB (x8)
  L2 Unified 512 KiB (x8)
  L3 Unified 4096 KiB (x2)
Load Average: 1.33, 1.63, 1.82
---------------------------------------------------------------
Benchmark                     Time             CPU   Iterations
---------------------------------------------------------------
BM_ShortcodeParsing        4250 ns         4249 ns       164307
BM_TimeFormatting          2322 ns         2321 ns       301147
BM_TimeFormattingOld       4169 ns         4168 ns       167841

Benchmarking is done using the BENCHMARK_CAPTURE function now to pass
the test numbers that were previously part of the test cases

Also add test cases for the qstring (qs) variant of the function
@pajlada pajlada enabled auto-merge (squash) May 29, 2022 11:37
@pajlada pajlada merged commit 0ad66c0 into master May 29, 2022
@pajlada pajlada deleted the zneix/chore/optimize-format-duration branch May 29, 2022 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants