about summary refs log tree commit diff
path: root/src/libexpr/symbol-table.hh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-10-24T00·41+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-10-24T00·41+0000
commit0b305c534f989dbc3645ff03e070b0e4665fdeb7 (patch)
tree558a033ea76e04aacca79fbeaf58da352b613fc2 /src/libexpr/symbol-table.hh
parenta247d20604a97ff6e84b87f66e3338714e7964f0 (diff)
* Store attribute sets as a vector instead of a map (i.e. a red-black
  tree).  This saves a lot of memory.  The vector should be sorted so
  that names can be looked up using binary search, but this is not the
  case yet.  (Surprisingly, looking up attributes using linear search
  doesn't have a big impact on performance.)

  Memory consumption for

    $ nix-instantiate /etc/nixos/nixos/tests -A bittorrent.test --readonly-mode

  on x86_64-linux with GC enabled is now 185 MiB (compared to 946
  MiB on the trunk).

Diffstat (limited to 'src/libexpr/symbol-table.hh')
-rw-r--r--src/libexpr/symbol-table.hh2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libexpr/symbol-table.hh b/src/libexpr/symbol-table.hh
index 20ebe5fedbf6..976117a20a46 100644
--- a/src/libexpr/symbol-table.hh
+++ b/src/libexpr/symbol-table.hh
@@ -28,6 +28,8 @@ private:
     friend class SymbolTable;
 
 public:
+    Symbol() : s(0) { };
+    
     bool operator == (const Symbol & s2) const
     {
         return s == s2.s;