summaryrefslogtreecommitdiff
path: root/etc/compare-token-variants.rb
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2012-07-18 11:46:41 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2012-07-18 11:46:41 +0200
commita1582d7856bc385b7bad492d8fc3f02e2b9f4d94 (patch)
tree3abdb3a7d6aa00edca62fc5b36cf9a9a8242b245 /etc/compare-token-variants.rb
parenta4b8b094da5525354cb8a927761385825236c5a1 (diff)
downloadcoderay-a1582d7856bc385b7bad492d8fc3f02e2b9f4d94.tar.gz
remove etc folder
Diffstat (limited to 'etc/compare-token-variants.rb')
-rw-r--r--etc/compare-token-variants.rb33
1 files changed, 0 insertions, 33 deletions
diff --git a/etc/compare-token-variants.rb b/etc/compare-token-variants.rb
deleted file mode 100644
index a4edd83..0000000
--- a/etc/compare-token-variants.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-require "benchmark"
-require "strscan"
-
-TESTS = 2_000_000
-S = 'begin ' * TESTS
-r = /begin /
-
-len = nil
-Benchmark.bm 20 do |results|
- results.report 'string' do
- s = StringScanner.new S
- a = []
- while matched = s.scan(r)
- a << [matched, :test]
- end
- end
- results.report 'length' do
- s = StringScanner.new S
- a = []
- while len = s.skip(r)
- a << [len, :test]
- end
- end
- results.report 'two arrays' do
- s = StringScanner.new S
- a = []
- b = []
- while matched = s.scan(r)
- a << len
- b << :test
- end
- end
-end \ No newline at end of file