)]}'
{
  "commit": "bdb5e8c5383fa099d0b6dfda93a343b6c903fbdc",
  "tree": "11ee3ff91d69010e4584a658d319ba1f549b8d3b",
  "parents": [
    "ca4508e8f261cdaf3d5b48c9381a504b99b2669a"
  ],
  "author": {
    "name": "Primiano Tucci",
    "email": "primiano@google.com",
    "time": "Tue Mar 03 21:51:53 2026 +0000"
  },
  "committer": {
    "name": "Primiano Tucci",
    "email": "primiano@google.com",
    "time": "Tue Mar 03 21:54:14 2026 +0000"
  },
  "message": "EXPERIMENT: evaluating compression vs interning on Wakelock\n\nNOT FOR REVIEW\n\nPrompt\nWe are going to do some investigation about interning vs compression.\nYou\u0027ll have to write some python or C++ throwaway scripts to help me with some research on the topic.\n\nPre-work:\nTake the long_trace.pftrace file and extract out only the TracePacket that contain an AppWakelockBundle (defined in app_wakelock_data.proto). Save that in wakelock.pftrace.\n\nContext:\nyou\u0027ll notice that wakelocks are stored in an efficient manner via a union of interning + columnar encoding\n- There is an AppWakelockInfo structure which is interned.\n- When a wakelock is detected and stored into the trace:\n - If the wakelock is new, a new AppWakelockInfo is created and appended to TracePacket.interned_data.app_wakelock_info (see interned_data.proto)\n - The index of the newly created intern entry is appended to intern_id\n - The timestamp of the even is appended to encoded_ts\n - Ignore the other two fiels AppWakelockInfo info \u003d 3; and acquired \u003d 4\n\nSo the way you interpret the data is that encoded_ts and intern_id have the same cardinality. intern_id refers to the entry previously emitted in interned_data\n\nAssignment:\nI want you to de-intern the trace, and pretend that the AppWakelockInfo was written as a record, in a dumb way, without any interning.\nSO I want you to do this:\n\n- Modify TrackEvent and add AppWakelockInfo as one of the possible fields\n- Write a python/c++ script that parses the input trace and de-interns the data. FOr each entry in encoded_ts + intern_id, you shall create a new TrackEvent of type instant, with the appopriate timestamp, and same AppWakelockInfo fields (skip the iid field because it\u0027s only used for interning)\n- Hence create a wakelock_uninterned.pftrace, taking the previous wakelock.pftrace and expanding each wakelock as described above\n- Then I want you to update the importer code in trace_processor to import also this file. I want you to verify that you did a good job ensuring that at the trace_processor level, the data looks identical. You\u0027ll have to join the slice table with the tracks table, and filter for track of type \u0027app_wakelock_events\u0027, and then check the slice and its args\n\nAfter you have done all this, I want you to take both traces (wakelock.pftrace and wakelock_uninterned.pftrace) and apply compression as follows. You have to try the combination of the following matrix\nzstd levels\u003d{10, 15, 19} with block sizes of 512K, 1MB, 2MB, 8MB (that is, apply compression indpendently to blocks of these sizes)\n\nthen write me a report with comparing the reults of this compression matrix on both traces in a tabular format\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ef8620dd53f1ad6021151dd0c883fadd45cee3de",
      "old_mode": 33188,
      "old_path": "protos/perfetto/trace/perfetto_trace.proto",
      "new_id": "e3ede536279cad30a7a2a469cb30c645e401dd43",
      "new_mode": 33188,
      "new_path": "protos/perfetto/trace/perfetto_trace.proto"
    },
    {
      "type": "modify",
      "old_id": "319c2e292771466fadfe426539d8323e68d510af",
      "old_mode": 33188,
      "old_path": "protos/perfetto/trace/track_event/track_event.proto",
      "new_id": "b5c57b32ce028fafd55a4459a6763c971ca374ab",
      "new_mode": 33188,
      "new_path": "protos/perfetto/trace/track_event/track_event.proto"
    },
    {
      "type": "modify",
      "old_id": "d7acfa8ead10eb64cfed04619cf3b7af96060e77",
      "old_mode": 33188,
      "old_path": "src/trace_processor/importers/proto/track_event_parser.h",
      "new_id": "3929f3eeb7c1034fc54e7ae81b0d94d5e978bf39",
      "new_mode": 33188,
      "new_path": "src/trace_processor/importers/proto/track_event_parser.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "398b097304f7b3382a84a33d53a2d30730341d9a",
      "new_mode": 33188,
      "new_path": "tools/compression_benchmark.py"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "442f4d89d1311d47aeeddef88bd442218444297b",
      "new_mode": 33188,
      "new_path": "tools/wakelock_extract.py"
    }
  ]
}
