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

Re-added the string cache, disabled by default (bonus: also thread-safe) #172

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Commits on Aug 4, 2015

  1. Update README.md

    vintagedave committed Aug 4, 2015
    Configuration menu
    Copy the full SHA
    95233e9 View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2016

  1. Configuration menu
    Copy the full SHA
    643d79f View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2016

  1. Re-adding string caching (memory optimization, for memory usage and a…

    …lso very importantly memory fragmentation).
    
    Added StringCache.pas.
    Changed attributes to use the string cache.
    Note required a define USESTRINGCACHE which is off by default. The cache is not threadsafe.
    vintagedave committed Apr 22, 2016
    Configuration menu
    Copy the full SHA
    e6baee2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3228e5b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    66d852e View commit details
    Browse the repository at this point in the history
  4. TStringCacheDictionary is not used (was originally written for a dict…

    …ionary of attributes, but attributes no longer work as a dictionary.)
    vintagedave committed Apr 22, 2016
    Configuration menu
    Copy the full SHA
    1aa71d6 View commit details
    Browse the repository at this point in the history
  5. Basic threadsafety for the string cache. Not extensively reviewed. Wh…

    …en threadsafe, any individual instance has get/add method contents wrapped in a lock, to lock the internal structures. The instance is never cleared when the count of objects using it drops to 0, since that's a bit more complex to get right (should only clear while the refcount is 0, but have to lock that to ensure it's not changed while clearing is happening, which severely slows inc/decrementing the count. I couldn't think of a good compare-lock-exchange algorithm. So just don't bother; it's never cleared while alive, when threadsafe.)
    vintagedave committed Apr 22, 2016
    Configuration menu
    Copy the full SHA
    fc0470b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    5b58370 View commit details
    Browse the repository at this point in the history
  7. Comment; also holds lock for AddAndGet (enters lock individually for …

    …both operations; now holds it for both. Safe to enter a CS twice.)
    vintagedave committed Apr 22, 2016
    Configuration menu
    Copy the full SHA
    6685524 View commit details
    Browse the repository at this point in the history
  8. Revert "Update README.md"

    This reverts commit 95233e9.
    vintagedave committed Apr 22, 2016
    Configuration menu
    Copy the full SHA
    38e35ba View commit details
    Browse the repository at this point in the history

Commits on Apr 23, 2016

  1. Configuration menu
    Copy the full SHA
    b799dd8 View commit details
    Browse the repository at this point in the history