Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.tcl > #55497
| From | Ralf Fassel <ralfixx@gmx.de> |
|---|---|
| Newsgroups | comp.lang.tcl |
| Subject | Re: optional args |
| Date | 2026-02-24 11:41 +0100 |
| Message-ID | <ygafr6qs9t9.fsf@akutech.de> (permalink) |
| References | <10ni7p2$38636$1@dont-email.me> <10nib2c$394up$2@dont-email.me> <10niita$3cclr$1@dont-email.me> |
* saito <saitology9@gmail.com>
| So, it seems there is some slowdown as default arguments increase but
| assuming this is constant per args processing, it is quite minor.
>
--<snip-snip>--
| % proc test1 {a b {c {}} {d {}} {e {}} {f {}} {g {}}} { }
>
| % time [list test1 1 2 3] 10000
| 0.5722900000000001 microseconds per iteration
>
| % time [list test1 1 2 3] 10000
| 0.62627 microseconds per iteration
As you can see from these two, there already is a rather large delta
(~10%) for identical calls. Anything in that delta is noise, not any
real difference. Also I'm not quite sure when byte compilation happens,
ISTR that this was at first call of a proc, so that first call probably
should be discarded (though it is fastest in your example :-).
| % 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.
R'
Back to comp.lang.tcl | Previous | Next — Previous in thread | Next in thread | Find similar
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