Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 726c74a7daacd1bfbefecdcee812e331e193dce657e093a02b7fcd48d45cdd38
Ticket: 28cc67a606a7ab771af4c7b542b34ec1a377edc7
array set from dict: set values multi times on the same array is slower with Tcl9.0.
User & Date: anonymous on 2024-04-15 15:59:55
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-plain"
  4. comment changed to:
    proc SimplePERM {} {
        set permmod [dict create]
        for {set i 0} {$i < 512} {incr i} {
            dict set permmod $i [expr {$i + int(rand() * (256 - $i))}]
            
        }
        return $permmod
    }
    
    proc generateData {} {
        array set val {}
        for {set i 0} {$i <= 20} {incr i} {
            for {set j 0} {$j <= 20} {incr j} {
                for {set k 0} {$k <= 20} {incr k} {
                    set v [SimplePERM]
                    array set val0 $v
                    array set val1 $v
                    array set val2 $v
                }
            }
        }
    }
    
    generateData
    
    time tclsh9.0b2 setarray.tcl
    > 8,23s user 0,02s system 99% cpu 8,281 total
    time tclsh9.0b1 setarray.tcl
    > 7,93s user 0,02s system 99% cpu 7,962 total
    time tclsh8.6.14 setarray.tcl
    > 2,71s user 0,01s system 99% cpu 2,726 total
    
  5. foundin changed to: "9.0"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "09c930666be5f16f66385ff2c54c7816bbb4dfd4"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "anonymous"
  14. subsystem changed to: "16. Commands A-H"
  15. title changed to:
    array set : set values multi times on the same array is slower with Tcl9.0.
    
  16. type changed to: "Bug"