Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] lib: optimize util.format() #215

Closed
wants to merge 3 commits into from

Commits on Dec 29, 2014

  1. lib: make linklist functions return useful values

    Make a number of functions from require('_linklist') return the list or
    the item just inserted.  Makes the API a little less unwieldy to use.
    bnoordhuis committed Dec 29, 2014
    Configuration menu
    Copy the full SHA
    6129721 View commit details
    Browse the repository at this point in the history
  2. benchmark: add util.format() benchmark

    Add a simple (too simple!) benchmark for util.format().
    bnoordhuis committed Dec 29, 2014
    Configuration menu
    Copy the full SHA
    dffe15b View commit details
    Browse the repository at this point in the history
  3. lib: optimize util.format()

    Optimize util.format() by parsing the format string and generating
    specialized code on the fly, then caching the result in a LRU list.
    
    This change is based on the observation that most applications that
    log extensively, often have very skewed distributions of log patterns.
    It's common to see top 10 or top 25 of popular patterns, followed by
    a long (sometimes very long) tail of less popular patterns.
    
    This is a work in progress: the common case is currently 2-25x faster
    but the worst case - every pattern unique - is 4-5x slower.
    bnoordhuis committed Dec 29, 2014
    Configuration menu
    Copy the full SHA
    5a74f84 View commit details
    Browse the repository at this point in the history