Groups | Search | Server Info | Login | Register


Groups > comp.lang.tcl > #55499

Re: optional args

From Ralf Fassel <ralfixx@gmx.de>
Newsgroups comp.lang.tcl
Subject Re: optional args
Date 2026-02-24 17:24 +0100
Message-ID <ygabjhertxf.fsf@akutech.de> (permalink)
References <10ni7p2$38636$1@dont-email.me> <10nib2c$394up$2@dont-email.me> <10niita$3cclr$1@dont-email.me> <ygafr6qs9t9.fsf@akutech.de> <10nk9hv$3t7h4$1@dont-email.me>

Show all headers | View raw


* Rich <rich@example.invalid>
| > | % time [list test1 1 2 ] 10000
| > | 0.60965 microseconds per iteration
| >>
| > | % time [list test1 1 2 3 4 5 6] 10000
| > | 0.56733 microseconds per iteration
| >>
| > | % time [list test1 1 2 3 4 5 6 7] 10000
| > | 0.6530900000000001 microseconds per iteration
| > 
| > IME if you repeat the individual tests multiple times, you get even
| > bigger variations.  So instead of taking a single run and base the
| > result on that, repeat at least say 10 times to get an idea.
>
| Those time runs are already for 10000 repetitions.
| The third parameter to [time] is "number of repetitions to perform".

Yes, I know.  Nevertheless, on my otherwise idle PC:

    % time [list test1 1 2 3 4 5 6 7] 100000
    0.60292 microseconds per iteration
    % time [list test1 1 2 3 4 5 6 7] 100000
    0.56502 microseconds per iteration
    % time [list test1 1 2 3 4 5 6 7] 100000
    0.52475 microseconds per iteration
    % time [list test1 1 2 3 4 5 6 7] 100000
    0.5317 microseconds per iteration
    % time [list test1 1 2 3 4 5 6 7] 100000
    0.4898 microseconds per iteration
    % time [list test1 1 2 3 4 5 6 7] 100000
    0.43831 microseconds per iteration
    % time [list test1 1 2 3 4 5 6 7] 100000
    0.482 microseconds per iteration
    % time [list test1 1 2 3 4 5 6 7] 100000
    0.44397 microseconds per iteration
    % time [list test1 1 2 3 4 5 6 7] 100000
    0.55761 microseconds per iteration
    % time [list test1 1 2 3 4 5 6 7] 100000
    0.51394 microseconds per iteration
    % time [list test1 1 2 3 4 5 6 7] 100000
    0.46066 microseconds per iteration
    % time [list test1 1 2 3 4 5 6 7] 100000
    0.48599 microseconds per iteration
    % time [list test1 1 2 3 4 5 6 7] 100000
    0.45478 microseconds per iteration

I.e. min 0.43831, max 0.60292 (delta ~25%).  If it comes to
*micro*seconds, I think there is no 'accurate' timing this way.

R'

Back to comp.lang.tcl | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

optional args saito <saitology9@gmail.com> - 2026-02-23 13:54 -0500
  Re: optional args Rich <rich@example.invalid> - 2026-02-23 19:50 +0000
    Re: optional args saito <saitology9@gmail.com> - 2026-02-23 17:04 -0500
      Re: optional args Ralf Fassel <ralfixx@gmx.de> - 2026-02-24 11:41 +0100
        Re: optional args Rich <rich@example.invalid> - 2026-02-24 13:37 +0000
          Re: optional args Ralf Fassel <ralfixx@gmx.de> - 2026-02-24 17:24 +0100
            Re: optional args saito <saitology9@gmail.com> - 2026-02-24 16:27 -0500
              Re: optional args et99 <et99@rocketship1.me> - 2026-02-24 13:40 -0800
                Re: optional args saito <saitology9@gmail.com> - 2026-02-24 17:03 -0500
                Re: optional args Rich <rich@example.invalid> - 2026-02-25 05:27 +0000
              Re: optional args Ralf Fassel <ralfixx@gmx.de> - 2026-02-25 11:50 +0100
                Re: optional args Rich <rich@example.invalid> - 2026-02-25 16:27 +0000

csiph-web