Artifacts Associated With Ticket 3163961fffffffffffffffffffffffffffffffff
Ticket change [3f42f21d4d] (rid 121428) by twylite on 2011-01-22 15:48:09:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
"mapeach" is a collecting [foreach], and arises from a discussion at http://wiki.tcl.tk/26013 . This patch provides an implementation of [mapeach] in the core, with full bytecoding support, leveraging the existing [foreach] infrastructure.
- foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "twylite"
- subsystem initialized to: "16. Commands A-H"
- title initialized to: "mapeach implementation with bytecoding"
- type initialized to: "Patch"
Add attachment "mapeach.patch" [b0e6d2d807] (rid 98059) by twylite on 2011-01-22 22:48:09.
Ticket change [b5d7578898] (rid 125318) by twylite on 2011-01-22 22:48:10:
- icomment:
File Added - 399513: mapeach.patch
- login: "twylite"
- mimetype: "text/plain"
- username: "twylite"
- icomment:
Add attachment "mapeach.test" [783e3ee331] (rid 89926) by twylite on 2011-01-22 22:50:04.
Ticket change [64b120ced2] (rid 92813) by twylite on 2011-01-22 22:50:04:
- icomment:
File Added - 399514: mapeach.test
- login: "twylite"
- mimetype: "text/plain"
- username: "twylite"
- icomment:
Ticket change [5abebc3024] (rid 118199) by twylite on 2011-01-22 22:50:46:
- icomment:
Includes a full set up tests (partially derived from the foreach.test suite).
- login: "twylite"
- mimetype: "text/plain"
- username: "twylite"
- icomment:
Ticket change [ee4fdfd326] (rid 104060) by twylite on 2012-07-31 20:37:04:
- icomment:
File Added - 450233: td-3163961-2.patch
- login: "twylite"
- mimetype: "text/plain"
- username: "twylite"
- icomment:
Add attachment "td-3163961-2.patch" [12ec935394] (rid 124132) by twylite on 2012-07-31 20:37:04.
Ticket change [0053c4ba9d] (rid 119302) by dkf on 2012-08-02 16:31:42:
- foundin changed to: "TIP Implementation"
- title changed to: "TIP 405: mapeach implementation with bytecoding"
Ticket change [e16437c45b] (rid 87437) by twylite on 2012-08-02 18:55:26:
- icomment:
File Added - 450402: td-3163961-3.patch
- login: "twylite"
- mimetype: "text/plain"
- username: "twylite"
- icomment:
Add attachment "td-3163961-3.patch" [eba50c4c10] (rid 103571) by twylite on 2012-08-02 18:55:26.
Ticket change [24c49b1216] (rid 131165) by twylite on 2012-08-02 19:32:29:
- icomment:
# Performance tests # Tcl = 32-bit tclsh86t.exe from trunk [19174445] with branches bug-3545363 # and td-mapeach merged in, built with MSVC10, OPTS=threads # Platform = Intel64 (AMD64) i5 @ 2.67Ghz running Windows 7 (64-bit) set d [lsearch -all [lrepeat 1000000 x] x] ; llength $d lindex $d 1000 ;# ensure list rep time { set accum {} foreach {k v} $::d { lappend accum [expr { $k * $v }] } puts [tcl::mathop::+ {*}$accum] ;# 166666416666500000 } # 750919 microseconds per iteration (foreach) time { puts [tcl::mathop::+ {*}[mapeach {k v} $::d { expr { $k * $v } }]] ;# 166666416666500000 } # 616432 microseconds per iteration (mapeach) time { apply {{} { set accum {} foreach {k v} $::d { lappend accum [expr { $k * $v }] } puts [tcl::mathop::+ {*}$accum] ;# 166666416666500000 }} } # 382724 microseconds per iteration (apply foreach) time { apply {{} { puts [tcl::mathop::+ {*}[mapeach {k v} $::d { expr { $k * $v } }]] ;# 166666416666500000 }} } # 382829 microseconds per iteration (apply mapeach) dict get $d 1000 ;# ensure dict rep time { set accum {} dict for {k v} $::d { lappend accum [expr { $k * $v }] } puts [tcl::mathop::+ {*}$accum] ;# 166666416666500000 } # 739547 microseconds per iteration (dict for) time { puts [tcl::mathop::+ {*}[dict map {k v} $::d { expr { $k * $v } }]] ;# 166666416666500000 } # 621000 microseconds per iteration (dict map) time { apply {{} { set accum {} dict for {k v} $::d { lappend accum [expr { $k * $v }] } puts [tcl::mathop::+ {*}$accum] ;# 166666416666500000 }} } # 357713 microseconds per iteration (apply dict for) time { apply {{} { puts [tcl::mathop::+ {*}[dict map {k v} $::d { expr { $k * $v } }]] ;# 166666416666500000 }} } # 360457 microseconds per iteration (apply dict map) RANK: # 357713 microseconds per iteration (apply dict for) # 360457 microseconds per iteration (apply dict map) # 382724 microseconds per iteration (apply foreach) # 382829 microseconds per iteration (apply mapeach) # 616432 microseconds per iteration (mapeach) # 621000 microseconds per iteration (dict map) # 739547 microseconds per iteration (dict for) # 750919 microseconds per iteration (foreach) - login: "twylite"
- mimetype: "text/plain"
- username: "twylite"
- icomment:
Ticket change [b6ce2e6308] (rid 125479) by twylite on 2012-08-03 23:55:19:
- icomment:
Latest implementation committed to branch 'tip-405-impl-td'. This includes 'mapeach' and 'dict map' with full test suites, a bug fix made since the last patchfile, and man pages. Also included is an experimental accumulating foreach tentatively named 'foreacha'. [foreacha] treats the first list variable as an accumulator. The accumulator consumes a list element on the first iteration only, and is returned by [foreacha]. Examples of [foreacha]: fold with initial var: foreacha a 0 b {1 2 3 4} { incr a $b } fold without initial var: foreacha {a b} {1 2 3 4} { incr a $b } filter: foreacha a {} b {1 2 3 4} { if { ($b % 2)==0 } { lappend a $b } } map: foreacha a {} b {1 2 3 4} { lappend a [expr { $b * 5 }] } prefix: foreacha a {} b {1 2 3 4} { if { $b > 2 } break; lappend a $b } - login: "twylite"
- mimetype: "text/plain"
- username: "twylite"
- icomment:
Ticket change [1b1d1ebea5] (rid 133382) by dkf on 2013-08-20 10:21:54:
- closedate changed to: "2456524.9318784"
- closer changed to: "dkf"
- comment changed to:
"mapeach" is a collecting [foreach], and arises from a discussion at http://wiki.tcl.tk/26013 . This patch provides an implementation of [mapeach] in the core, with full bytecoding support, leveraging the existing [foreach] infrastructure.
- icomment:
Variation of this incorporated into 8.6 as <tt>lmap</tt>.
- login: "dkf"
- mimetype: "text/html"
- resolution changed to: "Accepted"
- severity changed to: "Minor"
- status changed to: "Closed"
- username: "dkf"