• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

llnl / dftracer-utils / 26043728131

18 May 2026 03:37PM UTC coverage: 51.706% (-0.4%) from 52.076%
26043728131

push

github

hariharan-devarajan
feat(perf): performance improvements for parallel reading, indexing, and aggregation

Indexer
- Streaming parse-and-emit worker pipeline with bounded memory usage
- Concurrent SST artifact ingestion with staging support
- Gzip member slicing for parallel indexing
- Lazy decoding for compressed value counts
- Bypass DOM wrapper for indexer hot path (simdjson on_demand)
- Decoupled write workers from parse workers
- --rebuild-summaries flag and optimized root summary rebuild

Aggregator / MPI
- Task-based DAG execution for aggregator pipeline
- Shared staging for multi-node artifact relocation
- Per-node thread scaling to avoid oversubscription
- Unified distributed aggregation tracking, removed manifest consolidation
- Deterministic aggregation and intra-file parallelism

Trace reader / query
- Compiled predicate evaluation for AND-of-EQ queries
- Uniform-match shortcut for AND-of-EQ queries
- Line-range support for work items and checkpoint processing
- Optimized chunk pruning and checkpoint handling

Replay
- Pipelined replay with coroutines and channels
- JsonParser-based trace processing
- Optimized string handling and i/o buffering

Organize / writer / dft
- Parallel slice creation and merging in organize visitor
- Inline indexer in organize
- Gzip member tracking in writer
- Coroutine-based event dispatcher with extracted parse logic
- Batch flushing in organize visitor

Arrow / call_tree
- Optimized arrow conversion
- Arrow IPC support and improved save/load in call_tree

Build / infrastructure
- zlib-ng option, system simdjson fallback
- cgroup v1/v2 memory limit detection
- Auto-computed per-file memory estimates and batch sizes
- CI: perf branch trigger, formatting

Docs
- Rewritten indexer and trace reader API references

35907 of 90345 branches covered (39.74%)

Branch coverage included in aggregate %.

16869 of 21880 new or added lines in 137 files covered. (77.1%)

273 existing lines in 39 files now uncovered.

32021 of 41028 relevant lines covered (78.05%)

13164.29 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/dftracer/utils/server/cursor.cpp
1
#include <dftracer/utils/server/cursor.h>
2

3
#include <array>
4
#include <cstring>
5

6
namespace dftracer::utils::server {
7

8
namespace {
9

10
// Minimal base64 encode/decode for cursor serialization.
11
static constexpr char BASE64_CHARS[] =
12
    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
13

14
std::string base64_encode(const void* data, std::size_t len) {
×
15
    auto* bytes = static_cast<const unsigned char*>(data);
×
16
    std::string out;
×
17
    out.reserve(4 * ((len + 2) / 3));
×
18
    for (std::size_t i = 0; i < len; i += 3) {
×
19
        unsigned val = static_cast<unsigned>(bytes[i]) << 16;
×
20
        if (i + 1 < len) val |= static_cast<unsigned>(bytes[i + 1]) << 8;
×
21
        if (i + 2 < len) val |= static_cast<unsigned>(bytes[i + 2]);
×
NEW
22
        out.push_back(BASE64_CHARS[(val >> 18) & 0x3F]);
×
NEW
23
        out.push_back(BASE64_CHARS[(val >> 12) & 0x3F]);
×
NEW
24
        out.push_back((i + 1 < len) ? BASE64_CHARS[(val >> 6) & 0x3F] : '=');
×
NEW
25
        out.push_back((i + 2 < len) ? BASE64_CHARS[val & 0x3F] : '=');
×
26
    }
27
    return out;
×
28
}
×
29

30
std::optional<std::string> base64_decode(std::string_view sv) {
×
31
    static constexpr unsigned char DEC_TABLE[256] = {
32
        // clang-format off
33
        64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
34
        64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
35
        64,64,64,64,64,64,64,64,64,64,64,62,64,64,64,63,
36
        52,53,54,55,56,57,58,59,60,61,64,64,64,64,64,64,
37
        64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,
38
        15,16,17,18,19,20,21,22,23,24,25,64,64,64,64,64,
39
        64,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,
40
        41,42,43,44,45,46,47,48,49,50,51,64,64,64,64,64,
41
        64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
42
        64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
43
        64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
44
        64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
45
        64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
46
        64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
47
        64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
48
        64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
49
        // clang-format on
50
    };
51

52
    if (sv.size() % 4 != 0) return std::nullopt;
×
53
    std::string out;
×
54
    out.reserve(sv.size() / 4 * 3);
×
55
    for (std::size_t i = 0; i < sv.size(); i += 4) {
×
56
        auto a = DEC_TABLE[static_cast<unsigned char>(sv[i])];
×
57
        auto b = DEC_TABLE[static_cast<unsigned char>(sv[i + 1])];
×
58
        auto c = DEC_TABLE[static_cast<unsigned char>(sv[i + 2])];
×
59
        auto d = DEC_TABLE[static_cast<unsigned char>(sv[i + 3])];
×
60
        if (a == 64 || b == 64) return std::nullopt;
×
61
        unsigned val = (a << 18) | (b << 12);
×
62
        out.push_back(static_cast<char>(val >> 16));
×
63
        if (c != 64) {
×
64
            val |= (c << 6);
×
65
            out.push_back(static_cast<char>((val >> 8) & 0xFF));
×
66
        }
67
        if (d != 64) {
×
68
            val |= d;
×
69
            out.push_back(static_cast<char>(val & 0xFF));
×
70
        }
71
    }
72
    return out;
×
73
}
×
74

75
}  // namespace
76

77
// Wire format: 8 bytes file_index + 4 bytes chunk_index + 4 bytes line_offset
78
// (all little-endian), base64-encoded.
79
static constexpr std::size_t CURSOR_BYTES = 16;
80

81
std::string QueryCursor::encode() const {
×
82
    unsigned char raw[CURSOR_BYTES];
83
    std::memcpy(raw, &file_index, 8);
×
84
    std::memcpy(raw + 8, &chunk_index, 4);
×
85
    std::memcpy(raw + 12, &line_offset, 4);
×
86
    return base64_encode(raw, CURSOR_BYTES);
×
87
}
88

89
std::optional<QueryCursor> QueryCursor::decode(std::string_view cursor) {
×
90
    auto raw = base64_decode(cursor);
×
91
    if (!raw || raw->size() != CURSOR_BYTES) return std::nullopt;
×
92
    QueryCursor c;
×
93
    std::memcpy(&c.file_index, raw->data(), 8);
×
94
    std::memcpy(&c.chunk_index, raw->data() + 8, 4);
×
95
    std::memcpy(&c.line_offset, raw->data() + 12, 4);
×
96
    return c;
×
97
}
×
98

99
}  // namespace dftracer::utils::server
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc