diff options
author | ferrieux <ferrieux@users.sourceforge.net> | 2008-07-23 23:19:31 (GMT) |
---|---|---|
committer | ferrieux <ferrieux@users.sourceforge.net> | 2008-07-23 23:19:31 (GMT) |
commit | 7b1a1c06d6d6cdf4035ef5b35802f85862b27088 (patch) | |
tree | 6df0c2ac34f68c053e371f29fcfda6aab9419f8c /tests | |
parent | 4f9bbccc00c295f21e8675079ffa2664f4d2c41d (diff) | |
download | tcl-7b1a1c06d6d6cdf4035ef5b35802f85862b27088.zip tcl-7b1a1c06d6d6cdf4035ef5b35802f85862b27088.tar.gz tcl-7b1a1c06d6d6cdf4035ef5b35802f85862b27088.tar.bz2 |
Added relative speed test for pure byte array concats.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/binary.test | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/binary.test b/tests/binary.test index 2f71866..7f41559 100644 --- a/tests/binary.test +++ b/tests/binary.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: binary.test,v 1.35 2008/07/19 22:50:38 nijtmans Exp $ +# RCS: @(#) $Id: binary.test,v 1.36 2008/07/23 23:19:33 ferrieux Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -2700,6 +2700,17 @@ test binary-75.23 {binary decode uuencode} -body { list [string length $r] $r } -result {3 abc} +test binary-76.1 {byte array concat speed} -body { + set b1 [binary format H* [string repeat E9 1000000]] + set b2 [binary format H* 41] + set t1 [lindex [time {set z ${b1}${b2}}] 0] + unset z + set b1 [binary format H* [string repeat E9 1000000]] + set b2 [binary format H* 41] + set t2 [lindex [time {set z ${b1}é}] 0] + expr {($t2/$t1)>3} +} -result 1 + # cleanup ::tcltest::cleanupTests return |