Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 4034c84fed2700ebed89529bfdb9aeb681301c5a
Ticket: 3380073fffffffffffffffffffffffffffffffff
declining [expr] performance
User & Date: dgp on 2011-07-27 16:32:36
Changes

  1. assignee changed to: "dgp"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    
    A fairly typical calculation proc...
    
    set ::RADIAN_CONV  57.2957795131
    
    proc distance { lat1 lon1 lat2 lon2 } {
        set lat1 [expr {$lat1 / $::RADIAN_CONV}]
        set lat2 [expr {$lat2 / $::RADIAN_CONV}]
        set dlon [expr {($lon2 - $lon1) / $::RADIAN_CONV}]
    
        return [expr {acos(sin($lat1) * sin($lat2) + \
                               cos($lat1) * cos($lat2) * cos($dlon)) * \
                          6371.0}]
    }
    
    Measured performance trend:
    
    % time {distance 41.0 -81.0 42.0 -82.0} 100000    ;# 8.4
    1.98998 microseconds per iteration
    
    % time {distance 41.0 -81.0 42.0 -82.0} 100000    ;# 8.5
    2.17931 microseconds per iteration
    
    % time {distance 41.0 -81.0 42.0 -82.0} 100000     ;# 8.6
    3.03864 microseconds per iteration
    
    
  4. foundin changed to: "obsolete: 8.5.10"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "dgp"
  10. subsystem changed to: "47. Bytecode Compiler"
  11. title changed to: "declining [expr] performance"
  12. type changed to: "Bug"