Skip to content

Instantly share code, notes, and snippets.

@miyamuko
Created December 16, 2011 05:19
Show Gist options
  • Save miyamuko/1484611 to your computer and use it in GitHub Desktop.
Save miyamuko/1484611 to your computer and use it in GitHub Desktop.
#xyzzy で巨大な文字列に対する正規表現マッチがすごい遅い
;; xyzzy だとすっごい遅い。
;; Ctrl-g で止めることもできないからプロセスを殺すしかない。
(string-match
"a+\\|b"
(make-sequence 'string 50000 :initial-element #\a))
0
;; ruby だと一瞬。
> ruby -e "p ('a'*50000) =~ /a+|b/"
0
;; これはさすがに早い。
(string-match
"a+"
(make-sequence 'string 50000 :initial-element #\a))
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment