Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 81145ce0efc252f557a8c6e329788b62dbcd0378
Ticket: 32c5740a4d3e86b1973915d92f07d5aee6104a14
Undesirable [lappend] performance as LIST_MAX is reached
User & Date: dgp on 2015-11-17 18:40:08
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    Phil Brooks presented at the 2015 Tcl Conference, and later
    posted to comp.lang.tcl a demonstration of [lappend] growth
    of large lists, and some undesirable performance.  Here's his
    demo script as it appeared in clt:
    
    set i 0
    set my_list {}
    set count 0
    set t0 [ clock seconds ]
    # Create a list with a billion elements
    while {$i < 1000000000} {
           lappend my_list "List element $i"
           incr count
           if { [expr {fmod($count, 100000000)} ] == 0.0} {
              # Show progress every 100 million elements
              set tnow [ clock seconds ]
              puts "elapsed time: [ expr { $tnow - $t0 } ] seconds"
              puts [llength $my_list]
           } elseif { $count > 403000000 } {
              # Show progress more incrementally
              if { [expr {fmod($count, 1000)} ] == 0.0} {
                  set tnow [ clock seconds ]
                  puts "elapsed time: [ expr { $tnow - $t0 } ] seconds"
                  puts [llength $my_list]
              }
           }
           incr i
    }
    
  5. foundin changed to: "trunk"
  6. is_private changed to: "0"
  7. login: "dgp"
  8. priority changed to: "5 Medium"
  9. resolution changed to: "None"
  10. severity changed to: "Important"
  11. status changed to: "Open"
  12. submitter changed to: "dgp"
  13. subsystem changed to: "14. List Object"
  14. title changed to:
    Undesirable [lappend] performance as LIST_MAX is reached
    
  15. type changed to: "Bug"