タグ

benchmarkに関するdmizuno55のブックマーク (2)

  • 正規表現のパフォーマンスの話をされても全くピンと来なかった僕は、backtrackに出会いました。 - Qiita

    /^.*-.*$/ #悪い(表現方法として"短い"けど) /^\d{3}-\d{4}$/ #良い(表現方法として"長い") となります。 (もちろん、上のパタンは、デタラメなものも引っかかるので、正しくないけど、そういうのはいったん無視。 感覚的には下の方がよさそうだけど。どういうことですか? ステップ数を見てみる! https://regex101.com/#pcre この素晴らしいサイトを利用します。 123-4567とのマッチングを考えます。 まず、/^\d{3}-\d{4}$/ はこんな感じで、7ステップ 一方、/^.*-.*$/ は..12ステップ ということで、.* の方がステップ数が増えてパフォーマンスが悪くなっていそうです。 (実際パフォーマンスはこのステップ数に依存しそうなので、悪くなっていると思います。後で時間測ります。 バックトラック(BACKTRACK)と出会いまし

    正規表現のパフォーマンスの話をされても全くピンと来なかった僕は、backtrackに出会いました。 - Qiita
  • TPC-Error 404

    OOps Something is a miss .... We are sorry, but the page that you were looking for could not be found. If you typed the page name directly into the address bar, please check the spelling and try again. Or use the navigation bar at the top to find what you are looking for. If you like assistance, please contact us. If you want to access a Reference URL (a.k.a. 'Short-ID'), please note, that the ref

  • 1