From 7b1a1c06d6d6cdf4035ef5b35802f85862b27088 Mon Sep 17 00:00:00 2001 From: ferrieux Date: Wed, 23 Jul 2008 23:19:31 +0000 Subject: Added relative speed test for pure byte array concats. --- ChangeLog | 4 +++- tests/binary.test | 13 ++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b129a8..449a1fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,9 @@ 2008-07-23 Alexandre Ferrieux * tests/lrange.test: Added relative speed test to check for lrange - in-place optimization committed 2008-06-30. + in-place optimization committed 2008-06-30. + * tests/binary.test: Added relative speed test to check for pure + byte array CONCAT1 optimization committed 2008-06-30. 2008-07-23 Andreas Kupries 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 -- cgit v0.12