)]}'
{
  "commit": "62bb5a59ac59760541507bfc35d2a557c2360dcf",
  "tree": "bc5997eced67d5f6680485e7ec0327582f3a17c0",
  "parents": [
    "31601eee4a6d63e11abd9c7bc30f2f37ae93860d"
  ],
  "author": {
    "name": "CritasWang",
    "email": "critas@outlook.com",
    "time": "Wed Jul 15 14:54:52 2026 +0800"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Jul 15 14:54:52 2026 +0800"
  },
  "message": "perf: single-pass single-buffer tablet serialization, BigInt-free int64 writes (#16)\n\nCPU profiling of the write path (insertTablet-heavy workload) showed the\nevent loop 79.5% busy with serializeTabletValues at 26% self time and GC\nat 24.5% — almost entirely allocation churn in the serializer. This\nrewrites the fast (default) write path:\n\n- serializeTabletValues: new single-pass serializeTabletValuesFast()\n  writes all columns AND null bitmaps into ONE exactly-sized buffer.\n  Eliminates the rows-\u003ecolumns transpose (one array per column), the\n  per-column boolean[] null bitmaps (built then discarded when a column\n  has no nulls), the per-column intermediate buffers, the per-column\n  1-byte Buffer.from([flag]) allocations, and the trailing Buffer.concat\n  (which re-copied the whole payload). Fixed-width sizes come from the\n  schema; variable-width columns get one byteLength pre-scan.\n- INT64/TIMESTAMP writes: writeBigInt64BE(BigInt(v)) replaced with a\n  sign-correct hi/lo 32-bit pair (hi \u003d floor(v / 2^32), lo \u003d v \u003e\u003e\u003e 0),\n  avoiding one BigInt allocation per value. BigInt inputs and non-safe\n  integers still take the exact writeBigInt64BE path.\n- TEXT/STRING columns: single-entry encode cache — TAG columns repeat\n  one string per tablet, so consecutive identical values reuse the\n  encoded Buffer instead of re-encoding UTF-8 every row.\n- BufferPool: removed from the write path. It was acquire-only (zero\n  release() calls anywhere in src/), i.e. a guaranteed 0% hit rate and\n  pure overhead over Buffer.allocUnsafe. The class stays exported\n  (public API) but is deprecated.\n\nWire format is unchanged — existing serialization unit tests pass\nuntouched, and new golden tests assert the fast path output equals the\nlegacy path byte-for-byte for mixed-type tablets with nulls, all-null\ncolumns, bitmap-width edge cases (17 rows), BLOB/DATE, and negative /\nMIN_SAFE_INTEGER / BigInt int64 values. The legacy path\n(enableFastSerialization\u003dfalse) is untouched.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5c8cffc6cb3e8eac9f7a182e8b194caef308e795",
      "old_mode": 33188,
      "old_path": "src/client/Session.ts",
      "new_id": "73d180da103ebcee6f747a070280a278ddaf353c",
      "new_mode": 33188,
      "new_path": "src/client/Session.ts"
    },
    {
      "type": "modify",
      "old_id": "76a29653e66e5d0500e40570460cdb7b2caffacd",
      "old_mode": 33188,
      "old_path": "src/index.ts",
      "new_id": "2504833e815b9146e07a4bd3961047b76cdad60e",
      "new_mode": 33188,
      "new_path": "src/index.ts"
    },
    {
      "type": "modify",
      "old_id": "11e32e00e9219677f53a1fd330a7fd03dd3100bc",
      "old_mode": 33188,
      "old_path": "src/utils/BufferPool.ts",
      "new_id": "f477f2d572628301550fdd47ee4fd8c3b92f056c",
      "new_mode": 33188,
      "new_path": "src/utils/BufferPool.ts"
    },
    {
      "type": "modify",
      "old_id": "5ca7da10a936f0f5b5f693cdaf5b185600b4c6fc",
      "old_mode": 33188,
      "old_path": "src/utils/Config.ts",
      "new_id": "05016f90bf284f51d3c8e6dab9a2f1ae07bb9eda",
      "new_mode": 33188,
      "new_path": "src/utils/Config.ts"
    },
    {
      "type": "modify",
      "old_id": "76ae9ede984c591091bfca0f1cebecde9c48902f",
      "old_mode": 33188,
      "old_path": "src/utils/FastSerializer.ts",
      "new_id": "f0d45f5e77653099bbc3fa6922646d5737ab3678",
      "new_mode": 33188,
      "new_path": "src/utils/FastSerializer.ts"
    },
    {
      "type": "modify",
      "old_id": "f6e673d4f9e6889c4ec5c86856d39839b19dd348",
      "old_mode": 33188,
      "old_path": "tests/unit/FastSerializer.test.ts",
      "new_id": "1e83a978d52bad8f941939ec6192e2d2c04bdb51",
      "new_mode": 33188,
      "new_path": "tests/unit/FastSerializer.test.ts"
    },
    {
      "type": "modify",
      "old_id": "620a4320f4f7335272f1927d7c690c2883e144fe",
      "old_mode": 33188,
      "old_path": "tests/unit/TabletSerialization.test.ts",
      "new_id": "a3ddfa8502af5884be3b1a01b1be83116e6a20d6",
      "new_mode": 33188,
      "new_path": "tests/unit/TabletSerialization.test.ts"
    }
  ]
}
