-
-
Notifications
You must be signed in to change notification settings - Fork 98
perf: C++20 migration + fixes #567
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
base: main
Are you sure you want to change the base?
perf: C++20 migration + fixes #567
Conversation
|
Realistically, if we plan to move to C++ 20, there is also no reason to depend on {fmt} as its part of C++ 20 natively. |
|
fmt is theoretically more efficient, but honestly, it's nice to remove having excess dependencies tbh. What would we prefer? Moving everything to std::format is very much possible :] |
My assumption is that its likely immeasurable if there even is a difference in the first place. C++ does have some terrible standard library functions though so I wouldn't be surprised. I don't really have a opinion then if what your saying is correct :) |
|
Still uncertain, fmtlib seems faster in tests when scaled to larger batch prints compared to std::format, and another reason I didn't want to use std::format for us was it can't really handle colours, which we do use. We can migrate but swap all colours over to manual escape codes but the support for that becomes a bit more complex, especially if different shell-specs have varying escape codes that'll need us to detect shellcode at injector start possibly. Unless it's all equal, in which case we can just refactor with escape codes, though less neat I suppose xD |
|
Also, I wish to keep the use of |
d2aff04 to
08b9f3a
Compare
|
Few other things we might be able to add here. One, I've already implemented as far as we can rn, which is concepts and constraints, for API safety. Another is possible optimisation through spans or string_views, which will be a rather widespread edit, and technically string_view is possible in C++17 heheh. Still, it'll be an annoying rework, because there's 779 occurrences of std::strings, that I'll have to review, in that case. Willing to accept help on this one xD |
15d850d to
a762d1f
Compare
a762d1f to
f212299
Compare
Signed-off-by: ninetailedtori <ninetailedtori@uwu.gal>
f212299 to
a90fbaa
Compare
|
I like |
Hmm, string_view would be better than compared to const std::string& and const char * though. And at the least that one is safe? |
|
And I am testing string_view as I go along, what I can't change I leave as string&. |
|
|
Signed-off-by: Toria <ninetailedtori@uwu.gal>
6741b0c to
925a466
Compare
…ngleton<WebkitHookStore> as well. Signed-off-by: Toria <ninetailedtori@uwu.gal>
|
Well, I'm going to finish cleaning up this codebase tomorrow and prolly later too, but for now this is my progress :] |
|
I strongly dislike one-liner its harder to read, easier to accidentally break the if statement, and all around not an improvement in any fashion. |
|
Lots of these changes aren't inherently C++20 related, I'm not sure why they are apart of this PR. I was ready to merge it before you added all of these changes. We are just changing stuff for the sake of changing it. |
ngl, let me move it to another pr. It's part of performance changes, but it's ok if you want me to revert the ones that fall outside of what we wanted. |
|
I was looking for the absolute bare minimum changes required to move to C++20, nothing else |
…that update to the latest c++20 specifications on code safety. Signed-off-by: Toria <ninetailedtori@uwu.gal>
def97d8 to
81a68d7
Compare
Some of these are genuine errors in C++20, and thus have to be moved to new behaviours. This PR was intended to be not just C++20, but making it faster in C++20 as well, through code generation rule changes in 20+. |
Signed-off-by: Toria <ninetailedtori@uwu.gal>
…e classes that were missed/added between PR start and now. Signed-off-by: Toria <ninetailedtori@uwu.gal>
…const. Signed-off-by: Toria <ninetailedtori@uwu.gal>
Signed-off-by: Toria <ninetailedtori@uwu.gal>
…ptable changes only, mostly neatening things, adding C++20 support, and fixing any typos in my rework. Signed-off-by: Toria <ninetailedtori@uwu.gal>
Signed-off-by: Toria <ninetailedtori@uwu.gal>
Signed-off-by: Toria <ninetailedtori@uwu.gal>
Signed-off-by: Toria <ninetailedtori@uwu.gal>
Signed-off-by: Toria <ninetailedtori@uwu.gal>
Signed-off-by: Toria <ninetailedtori@uwu.gal>
…rning. Signed-off-by: Toria <ninetailedtori@uwu.gal>
|
Just cleaned up the majority of the Millennium backend, including finishing off any missing C++20 support or singleton rework bits, and any changes of spec that are required to build without errors. I need a test build in Windows though, Linux is flawless though. |
This PR seeks to provide a PR thread for the eventual update to C++20. This PR will act as a draft and updated periodically, to be merged when the migration occurs.