Created
December 16, 2011 05:19
-
-
Save miyamuko/1484611 to your computer and use it in GitHub Desktop.
#xyzzy で巨大な文字列に対する正規表現マッチがすごい遅い
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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