Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6b7e65cf98cc5f1c36db2e7217f8854248be2c91
Ticket: 472576ffffffffffffffffffffffffffffffffff
Tcl_GetBooleanFromObject performance
User & Date: kennykb on 2001-10-18 21:50:33
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Tcl_GetBooleanFromObj (and SetBooleanFromAny) have the anomaly that they don't check for an 
    object that is already of the correct type: instead, they reparse strings on each trip through.
    
    Moreover, they could be sped up still further by having Tcl_GetBooleanFromObj recognize at least 
    tclIntType and tclLongType, and doing the obvious int-to-Boolean conversion.
    
    Code that shows the performance anomaly:
    
    % time { set i 100000 ; while { true && [incr i -1] > 0 } {} }
    392272 microseconds per iteration
    % time { set i 100000 ; while { 1    && [incr i -1] > 0 } {} }
    293493 microseconds per iteration
    
  4. foundin changed to: "obsolete: 8.4a4"
  5. priority changed to: "1 Zero"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "kennykb"
  9. subsystem changed to: "10. Objects"
  10. title changed to: "Tcl_GetBooleanFromObject performance"
  11. type changed to: "Bug"