Hello Codeforces.
I made two identical submissions on the same problem.
C++ 17(64bit) — 842ms.
C++ 20(64bit) — 1138ms.
Does anyone know why the time differs so much?
# | User | Rating |
---|---|---|
1 | jiangly | 3898 |
2 | tourist | 3840 |
3 | orzdevinwang | 3706 |
4 | ksun48 | 3691 |
5 | jqdai0815 | 3682 |
6 | ecnerwala | 3525 |
7 | gamegame | 3477 |
8 | Benq | 3468 |
9 | Ormlis | 3381 |
10 | maroonrk | 3379 |
# | User | Contrib. |
---|---|---|
1 | cry | 168 |
2 | -is-this-fft- | 165 |
3 | Dominater069 | 161 |
4 | Um_nik | 160 |
5 | atcoder_official | 159 |
6 | djm03178 | 157 |
7 | adamant | 153 |
8 | luogu_official | 150 |
9 | awoo | 149 |
10 | TheScrasse | 146 |
Hello Codeforces.
I made two identical submissions on the same problem.
C++ 17(64bit) — 842ms.
C++ 20(64bit) — 1138ms.
Does anyone know why the time differs so much?
Name |
---|
In my opinion C++20 is usually much quicker. Maybe it depends on the code.
Removing two lines containing the following makes both c++ versions run in the same amount of time:
C++17: 623ms/623ms
C++20: 623ms/624ms
Obviously, the problem was that compilers couldn't fully optimize away the unused call, but I don't know any details why such a difference.