Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b8a5f4657aa0d76a37ead03950d6e282668bb6f1
Ticket: f97d4ee02082971e4b86a853c18c093fd0b2a45d
quadratic cost of namespace teardown
User & Date: dgp on 2015-07-22 14:08:10
Changes

  1. icomment:
    
    Open to a patch along those lines, but I have my doubts.
    
    I suspect that most of the cost is repeatedly scanning over
    empty buckets since Tcl_FirstHashEntry() always starts looking
    at bucket 0.
    
    Would improve things (enough?) to arrange for a circular
    bucket search to have a start/stop point determine by the
    value of searchPtr->nextIndex first passed to Tcl_FirstHashEntry().
    And then have repeated Tcl_FirstHashEntry() calls remember where
    we were last looking.
    
    The snag is that the obvious way to do such a thing appears to
    require modifying fields in public structs.
    
    Might be worth a demo on a branch, just to see if it's effective,
    and then try to conjure some workaround of the non-opaque struct
    corner we've painted ourselves into.
    
  2. login: "dgp"
  3. mimetype: "text/plain"