Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3a1529fdc94c60615da18c22f73c513c91f82b37
Ticket: fa5c8a823085c0cd88bdd2d10a5c24f5ebb4bf07
memory cost and execution time exploding of nested namespaces
User & Date: sebres on 2017-05-18 07:26:06
Changes

  1. assignee changed to: "sebres"
  2. foundin changed to: ">= 8.5"
  3. icomment:
    Seems to affect 8.5 and 8.6 in same manner also.
    
    Additionally it've very large execution time exploding.
    Just as comparison to not-nested (>= 8.6, x86):
    
    <code><verbatim>
    # not nested:
    set i 0; time {namespace eval ::namespace[incr i] {}} 10000
    ----> 4.74 microseconds per iteration (and 8.0MB memory)
    # nested:
    set name {}; 
    set i 0; time {namespace eval [set name ${name}::namespace[incr i]] {}} 10000
    ----> 70110.60 microseconds per iteration (and 770.0MB memory)
    </verbatim></code>
    
    This difference looks in 8.5 still many times worse and the execution time exploding is very grave (with the similar memory consumption like 8.6).
    
    <code><verbatim>
    % # not nested:
    % set i 0; time {namespace eval ::namespace[incr i] {}} 10000
    2.91753049225468 microseconds per iteration
    %
    % # nested:
    % set name {};
    % # 1. thousand:
    % set i 0; time {namespace eval [set name ${name}::namespace[incr i]] {}} 1000
    1153.3163043544507 microseconds per iteration
    % # 2. thousand:
    % set i 0; time {namespace eval [set name ${name}::namespace[incr i]] {}} 1000
    7032.770893726276 microseconds per iteration
    % # 3. thousand:
    % set i 0; time {namespace eval [set name ${name}::namespace[incr i]] {}} 1000
    18984.08208553774 microseconds per iteration
    %
    </verbatim></code>
    
  4. login: "sebres"
  5. mimetype: "text/x-fossil-wiki"
  6. title changed to:
    memory cost and execution time exploding of nested namespaces