From 1d457205792b223813eccf47426c7fe48feb06d6 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 18 Mar 2009 17:08:57 -0500 Subject: [PATCH] Add a deploy test to keep benchmark.regex-dna size down --- basis/tools/deploy/deploy-tests.factor | 2 ++ extra/benchmark/regex-dna/regex-dna.factor | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/basis/tools/deploy/deploy-tests.factor b/basis/tools/deploy/deploy-tests.factor index 3a2f960fc9..0a7549430d 100644 --- a/basis/tools/deploy/deploy-tests.factor +++ b/basis/tools/deploy/deploy-tests.factor @@ -26,6 +26,8 @@ os macosx? [ [ t ] [ "webkit-demo" shake-and-bake 500000 small-enough? ] unit-test ] when +[ t ] [ "benchmark.regex-dna" shake-and-bake 1200000 small-enough? ] unit-test + { "tools.deploy.test.1" "tools.deploy.test.2" diff --git a/extra/benchmark/regex-dna/regex-dna.factor b/extra/benchmark/regex-dna/regex-dna.factor index 5c11be357f..24e7759783 100644 --- a/extra/benchmark/regex-dna/regex-dna.factor +++ b/extra/benchmark/regex-dna/regex-dna.factor @@ -1,7 +1,7 @@ -! Copyright (C) 2008 Slava Pestov. +! Copyright (C) 2008, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors prettyprint io io.encodings.ascii -io.files kernel sequences assocs namespaces regexp ; +USING: accessors io io.encodings.ascii io.files kernel sequences +assocs math.parser namespaces regexp ; IN: benchmark.regex-dna ! Based on http://shootout.alioth.debian.org/gp4/benchmark.php?test=regexdna&lang=ruby&id=1 @@ -22,7 +22,7 @@ IN: benchmark.regex-dna R/ agggtaa[cgt]|[acg]ttaccct/i } [ [ raw>> write bl ] - [ count-matches . ] + [ count-matches number>string print ] bi ] with each ; @@ -50,9 +50,9 @@ SYMBOL: clen dup count-patterns do-replacements nl - ilen get . - clen get . - length . ; + ilen get number>string print + clen get number>string print + length number>string print ; : regex-dna-main ( -- ) "resource:extra/benchmark/regex-dna/regex-dna-test-in.txt" regex-dna ;