Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 72c25ef87b98fa76ae33ff1d620ad5152e84cf9cfd2524a96feb9ee5f4caec77
Ticket: 4f6a1ebd64cffa3ef795d83cb15d92c40cfb12bd
ensemble: segmentation fault when -subcommand and -map values are the same object
User & Date: sebres on 2017-12-04 21:14:07
Changes

  1. icomment:
    I like the idea basically, but you've made a large performance regression on creating of each ensemble ("normal" case as well as "strange" case)...
    
    For example in "normal" case (where map != list) by N sub-commands for ensemble:
    Previously (original):<pre>
      - iterate over LIST for N elements;
        - search in target hash-table (also N times).
        - search for replacement in DICT (also N times);
        - set value in target hash-table;
    </pre>
    New ([f8daa294c6a88076]):<pre>
      - iterate over DICT for N elements;
        - iterate over LIST for N elements (N*N times);
          - search/create in target hash-table (also N*N times).
          - set value in target hash-table;
      - iterate over LIST for N elements (the second "if");
        - search in target hash-table (also N times).
    </pre>
    
    E. g. by 100 sub-commands you've almost 10x overhead there:<pre>
    -  23.508 µs/# 39808 # 42538.6 #/sec 935.809 nett-ms
    + 268.819 µs/#  3698 #  3720.0 #/sec 994.092 nett-ms
    </pre>
    Therefore I don't think it would be better now...
    
    What exactly don't like you in my solution [f9e184a041]?
    Possibly goto's?
    
  2. login: "sebres"
  3. mimetype: "text/x-fossil-wiki"