Skip to content
  • Gregory Szorc's avatar
    ui: track label expansion when creating buffers · 6ef17697b03d
    Gregory Szorc authored
    As part of profiling `hg log` performance, I noticed a lot of time
    is spent in buffered writes to ui instances. This patch starts a series
    that refactors buffered writes with the eventual intent to improve
    performance.
    
    Currently, labels are expanded when buffers are popped. This means
    we have to preserve the original text and the label until we render
    the final output. This is avoidable overhead and adds complexity
    since we're retaining state.
    
    This patch adds functionality to ui.pushbuffer() to declare whether
    label expansion should be active for the buffer. Labels are still
    evaluated during buffer pop. This will change in a subsequent
    patch.
    
    Since we'll need to access the "expand labels" flag on future write()
    operations, we prematurely optimize how the current value is stored
    to optimize for rapid retrieval.
    6ef17697b03d