head	1.2;
access;
symbols
	tcllib-1-13:1.2
	tcllib-1-12:1.2
	tklib-0-5:1.2
	tcllib-1-11-1:1.2
	tcllib-1-11:1.2
	tcllib-1-10:1.2
	tcllib-1-9:1.2
	tcllib-1-8:1.2
	tcllib-1-7:1.2
	tcllib-1-6-1:1.2
	tcllib-1-6-branch:1.2.0.2
	tcllib-1-6:1.2
	tcllib-1-4-0:1.1;
locks; strict;
comment	@# @;


1.2
date	2004.01.15.06.36.13;	author andreas_kupries;	state Exp;
branches;
next	1.1;

1.1
date	2003.04.21.20.16.54;	author andreas_kupries;	state Exp;
branches;
next	;


desc
@@


1.2
log
@
	* matrix.man:  Implemented Ed Suominen's sort methods, with
	* matrix.tcl:  modifications to speed things up, and to have
	* matrix.test: a more standard API (-options).

	* matrix.man: Documented method links.

	* matrix.test: Updated test to cover for method links.
	* matrix.tcl: Changed the code to determine the list of available
	  methods automatically for use in the error message when an
	  unknown method is called.

	* matrix.test:
	* matrix.tcl: Namespaces of objects now standalone, and not inside
	  of struct::matrix anymore. Arbitrary placement of objects is now
	  possible, including nested namespaces. Cleanup of all references
	  to instance variables.

	* matrix.tcl: Made the return of errors more regular.

	* matrix.tcl: Changed a number of eval calls to the more proper
	  'uplevel 1'. This means that an implementation of a method can
	  now assume that it is called on the same stack level as the
	  method itself.

	* matrix.tcl: Typo in comments fixed.
	* matrix.tcl (__set_rect): Fixed typos in var names causing the
	  system to retain bogus cache data.
@
text
@# -*- tcl -*-
# loggerperformance.tcl

# $Id: s.loggerperformance 1.1 03/04/21 20:16:54-00:00 andreas_kupries $

# This code is for benchmarking the performance of the log tools.

set auto_path "[file dirname [info script]] $auto_path"
package require logger
package require log

# Set up logger
set log [logger::init date]

# Create a custom log routine, so we don't deal with the overhead of
# the default one, which does some system calls itself.

${log}::logproc notice txt {
    puts "$txt"
}

# Basic output.
proc Test1 {} {
    set date [clock format [clock seconds]]
    puts "Date is now $date"
}

# No output at all.  This is the benchmark by which 'turned off' log
# systems should be judged.
proc Test2 {} {
    set date [clock format [clock seconds]]
}

# Use logger.
proc Test3 {} {
    set date [clock format [clock seconds]]
    ${::log}::notice "Date is now $date"
}

# Use log.
proc Test4 {} {
    set date [clock format [clock seconds]]
    log::log notice "Date is now $date"
}

set res1 [time {
    Test1
} 1000]

set res2 [time {
    Test2
} 1000]

set res3 [time {
    Test3
} 1000]

${log}::disable notice

set res4 [time {
    Test3
} 1000]

set res5 [time {
    Test4
} 1000]

log::lvSuppressLE notice

set res6 [time {
    Test4
} 1000]

puts "Puts output:		$res1"
puts "No output:		$res2"
puts "Logger:			$res3"
puts "Logger disabled: 	$res4"
puts "Log: 			$res5"
puts "Log disabled: 		$res6"
@


1.1
log
@
	* uuencode.test: Added code to suppress output from the log
	  package during the test.

	* loggerperformance.test: Renaming to 'loggerperformance'. This is
	  neither a .tcl file of the package itself, nor does it belong
	  into the testsuite (which is about functionality, not speed). It
	  is a benchmark application.
@
text
@d4 1
a4 1
# $Id: loggerperformance.test,v 1.1 2003/01/31 03:12:09 davidw Exp $
@

