Тёмный
CppCon
CppCon
CppCon
Подписаться
Visit cppcon.org for details on next year's conference. CppCon sponsors have made it possible to record and freely distribute over 1000 sessions from the first CppCon in 2014 to the present. We hope you enjoy them!
Комментарии
@koustavchowdhury8210
@koustavchowdhury8210 День назад
This is THE best talk for understanding value categories. Period.
@moonhowler667
@moonhowler667 День назад
Already love the first example. I wrote a performance/frame timer func, and obviously that *needs* to be as performant as possible so as not to burden the rest of... well, everything. Initially, I used Chrono. Too slow. Then I switched to filetime, which was much faster. But it still soaked up like 5% of my spent CPU, so, why? Well I checked out the ASM and saw that for some reason it was performing two [load effective], [copy]'s. I then realized, it's because I'm using both halves of the ULI I made to extract the full accuracy quadpart. I checked and, the low part works fine for comparisons for up to around 450s. A frame is 16.667ms or below. I dropped the upper part of the ULI along with the quadpart line, and the function was 50% faster. Don't trust the gut, trust the ASM and benchmarking.
@mohsenzare2511
@mohsenzare2511 День назад
I already subscribe so I just like more and more! thanks for great videos
@דניאלאביב-ו6ת
@דניאלאביב-ו6ת День назад
great talk!
@maxmustermann5590
@maxmustermann5590 2 дня назад
Back than he coulnt assume people have more than 4 cores at home and 7 years later cheap CPUs come with 12
@ppb2374
@ppb2374 3 дня назад
看到一半,忍不住要给老师点个赞,讲得非常好!把move语意的引入原因,使用方法讲得透透的,谢谢
@dominuspiritus
@dominuspiritus 3 дня назад
Protobuf is crying in the corner of the room.
@Drastonar
@Drastonar 3 дня назад
That filter bug is actually easy to fix, just test the filter in the cached begin before returning it, if it fails, start at the real begin. Also, if the container is modified before the cached begin, isn't it also an undefined behavior?
@theevilcottonball
@theevilcottonball 4 дня назад
First to like.
@llothar68
@llothar68 4 дня назад
Now its 2024 and we still might not see this in C++26 it is a shame how slow C++ develops in all things that are not template/type system crazy features
@PlexiumGames
@PlexiumGames 4 дня назад
What the fuck were those questions???? "Can you use template deduction with a member function?" TF? Have you ever used a template?
@fwang3695
@fwang3695 6 дней назад
I love this man! thanks for these wonderful presentations!
@rezwanarefin3493
@rezwanarefin3493 6 дней назад
13:58 There is a slight (or big?) difference between "if (std::is_constant_evaluated())" and "if consteval". The former is a *runtime* check for whether it is being evaluated at compile time BUT also allowed in places where one expects a constant result. While the later is a compile time check. Both have different usecases, and neither substitute the other. One can do "int arr[std::is_constant_evaluated() ? 10 : 15]" but cannot do so with "if consteval". One can call consteval functions from inside "if consteval", but cannot from inside "if (std::is_constant_evaluated())" since the check is at runtime.
@dera_ng
@dera_ng 6 дней назад
Can't wait for Carbon Lang enough 😓😪 (Rust is pretty fabulous).... I do understand all arguments and the perceived dip in care/quality of code from newer generation programmers however I guess C++ will continue to remain like this for reasons best known to the maintainers. C++ will have its use cases. New projects should simply use Rust and stop fighting C++.
@l3arn3r
@l3arn3r 7 дней назад
Very well explained - Thanks.
@Michael_19056
@Michael_19056 7 дней назад
Kevin, these interviews were fun to watch. Thank you for putting in all the effort!
@Devendraaaru
@Devendraaaru 7 дней назад
It’s a shame they have great folks but produce very bad and useless std library APIs since c++17.
@fillername4223
@fillername4223 7 дней назад
Both parts were bloody great, thank you for your work Klaus!
@chukwujiobicanon961
@chukwujiobicanon961 7 дней назад
With concepts, templates shouldn't be a problem yes?
@MrKatoriz
@MrKatoriz 7 дней назад
For the last question: the CPU store buffer and register renaming makes it possible to hide results of operations from external observers (i.e. other cores or memory for instance). The changes are only made visible when they will be program-correct (i.e. the CPU will actually execute and go past the array bounds, but before actually "publishing" the changes it will check if the branch prediction was correct and discard the incorrect results, that's why anything works)
@MrKatoriz
@MrKatoriz 7 дней назад
cmov is used for cases where the condition is close to random 50/50, since branching performs absolutely horrible there. In the presentation, random numbers generated for the test are in range 0-intmax (roughly 2 billion), while clamp limit is at 255, so the probability of mispredict is ~1.18e-7, which is why cmov is slower in the example.
@דניאלאביב-ו6ת
@דניאלאביב-ו6ת 8 дней назад
The API is quite cumbersome; it requires a lot of knowledge just to create a relatively simple view adaptor
@tokyospliff
@tokyospliff 9 дней назад
Now it's very important to watch this once when you wake up and once again before you fall asleep