Regexps can be fast, but they don't have to

mrzasa
March 17, 2018

Regexps can be fast, but they don't have to

LIghtning talk about regexp performance pitfalls in Ruby and browser. Wroclove.rb 2018

mrzasa

March 17, 2018

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

12 slides
  1. REGEXPS CAN BE REGEXPS CAN BE FAST FAST BUT THEY

    DON'T HAVE TO BUT THEY DON'T HAVE TO MACIEK RZĄSA, TEXTMASTER MACIEK RZĄSA, TEXTMASTER @mjrzasa
  2. 100% CPU ON PRODUCTION 100% CPU ON PRODUCTION Hello! →

    Witaj! → ¡Hola! → Salut ! Discourse client, described by Sam Saffron ::Typography.to_html_french # Insert a thin space before punctuation text.gsub(/(\s|)+([!?;]+(\s|\z))/, '&thinsp;\2\3') # <-58 spaces> GET /wp-login.php HTTP/1.1 69 GET /show.aspx HTTP/1.1 15
  3. WHAT COULD I DO? WHAT COULD I DO? be specific

    test almost matching input don't believe in magic, there is just software I will send links on twitter

More Decks by mrzasa

Other Decks in Programming