C++ Weekly - Ep 74 - std::regex optimize

preview_player
Показать описание
☟☟ Awesome T-Shirts! Sponsors! Books! ☟☟

Upcoming Workshops:

T-SHIRTS AVAILABLE!

WANT MORE JASON?

SUPPORT THE CHANNEL

GET INVOLVED

JASON'S BOOKS

► C++23 Best Practices

► C++ Best Practices

JASON'S PUZZLE BOOKS

► Object Lifetime Puzzlers Book 1

► Object Lifetime Puzzlers Book 2

► Object Lifetime Puzzlers Book 3

► Copy and Reference Puzzlers Book 1

► Copy and Reference Puzzlers Book 2

► Copy and Reference Puzzlers Book 3

► OpCode Puzzlers Book 1


RECOMMENDED BOOKS

AWESOME PROJECTS

O'Reilly VIDEOS

Source:
Рекомендации по теме
Комментарии
Автор

I got a 25% speed-up by setting the youtube speed to 1.25

stevenelliott
Автор

Got a nearly 5X speed up by making it static and another 2X by optimizing for a total 10X speed up. This was EXTREMELY helpful and informative. I had no clue construction was the real culprit and was worried we'd have to do some magic with the actual regex string itself and was worried it'd be super complicated.

SnakeBackwards
Автор

If you want to keep the scope limited I suppose you could just swap the while-loop out for a for-loop like this:
for( const std::regex regex(...); state.KeepRunning(); )

SonicFan
Автор

Hello Jason, glad to see this new video. Can you do another video to detail how capturing a substring of a string relatively to a pattern ? What is the functionnality needed ? Thanks

danielphd
Автор

I don't understand. the std::regex optimize didn't do anything, the fact to move a variable declaration did the trick. It has nothing to do with the flag?

Galaf
Автор

I'd expect compiler optimization to take the init outside of the loop. Maybe using a higher optimization level is what was needed?

yehezkelshb
Автор

Did I missed anything.
Put the std::cmatch in while loop will be slow of course, becuase it's construct many many times. This is nothing related to limit cmatch scope.
I really like Jason's video. I learned a lot from all these videoes. I'm not trying to pretend to be smart. I just got confused.

mipmap
Автор

So the optimize flag doesn't make any significant difference? What about benchmarking it the with O3 optimization?

kipu
Автор

Why some people strange pronounce "STD" as "stood"? Is it correct?

konrad
join shbcf.ru