Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6a879813397986a483893430d862ca13101fb137
Ticket: 2905784fffffffffffffffffffffffffffffffff
Sync [after] works too hard
User & Date: ferrieux on 2010-10-29 23:36:39
Changes

  1. icomment:
    Attaching the final patch. Care is taken to never undershoot, using a ceiling() approach when rounding usecs do msecs in time differences. Now a loop of {after 1} consumes < 0.1% CPU instead of 50%. Also, the total syscall budget is much reduced: one select() and three gettimeofday() only for a small [after].
    
    Cost in accuracy:
    
    % time {after 1} 1000
    1060.089 microseconds per iteration
    % time {after 2} 1000
    2061.111 microseconds per iteration
    % time {after 3} 1000
    3062.367 microseconds per iteration
    % time {after 100} 10
    100235.0 microseconds per iteration
    % time {after 10000} 1
    10002067 microseconds per iteration
    
    
    
  2. login: "ferrieux"
  3. mimetype: "text/plain"
  4. username: "ferrieux"