1. 21 Dec, 2012 2 commits
  2. 20 Dec, 2012 14 commits
  3. 19 Dec, 2012 21 commits
  4. 17 Dec, 2012 3 commits
    • Iustin Pop's avatar
      Switch Luxi sendMsg from strict to lazy ByteStrings · 62d5242b
      Iustin Pop authored
      Commit e821050d
      
       (“Switch the Luxi interface from Strings to
      ByteStrings”) was designed to optimise the receive interface, but has
      an unfortunate side-effect: when sending non-trivial messages, it
      means that both the entire String and the ByteString versions must be
      in memory at the same time, leading to much increased memory usage.
      
      By changing the "hPut" from strict to lazy ByteStrings, it means that
      both the String and the ByteString values can be evaluated lazily,
      with significant effects: for a test query answer, instead of having
      a peak from ~600MB to 1.4G during the entire Luxi send operation,
      memory consumption actually decreased during the send operation, as
      the ByteString chunks are released individually and even the backing
      storage of the items that create the JSON string serialisation is
      released lazily as well. So instead of slow growth 10→550MB then quick
      peak to 1.4GB during Luxi send, we now have an even slower growth to
      ~580MB and then decrease of memory as the Luxi send progresses.
      
      The only downside is of a small increase in CPU time of a few percents
      for the above case; for our use cases, I think this is much desirable.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
      62d5242b
    • Iustin Pop's avatar
      Add NFData instances for query results · 13b17073
      Iustin Pop authored
      
      
      This allows us to ensure that query results are strict as we build
      them, instead of being lazy and only evaluated when the reply is sent
      over the Luxi interface.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
      13b17073
    • Iustin Pop's avatar
      Introduce NFData instances for JSON types · daa79414
      Iustin Pop authored
      
      
      The JSValue/JSObject types don't come with a NFData instance, so let's
      add one ourselves, so that we can force evaluation of JSValues (either
      when building or when reading them).
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
      daa79414