Builds & Metrics

Library sizes, source metrics, and CI configuration for TriePack v1.1.0.

All sizes are from a Release build (-O2, no debug info) on macOS arm64. Sizes will vary slightly by platform and compiler.


Static Library Sizes

Library Size Description
libtriepack_bitstream.a 22 KB Arbitrary-width bit field I/O
libtriepack_core.a 23 KB Trie encoder/decoder, CRC-32, typed values
libtriepack_json.a 23 KB JSON encode/decode and DOM access
libtriepack_wrapper.a 18 KB C++ RAII wrappers
Total (all 4) 86 KB Complete library stack

The trp CLI tool (statically linked) is 59 KB.


Source Code

Component Language Lines Files
Bitstream C 990 7
Core (trie codec) C 1,760 8
JSON C 1,528 5
Public headers C 694 6
C++ wrapper C++ 653 6
C/C++ total   5,625  
JavaScript binding JS 1,076 7
Python binding Python 890 7
Grand total   7,591  

Example Program Sizes

All examples link statically against the TriePack libraries.

Example Size Libraries Used
basic_encode_decode 34 KB core, bitstream
rom_lookup 34 KB core, bitstream
prefix_search 34 KB core, bitstream
compaction_benchmark 42 KB core, bitstream
cpp_usage 40 KB wrapper, core, bitstream
json_roundtrip 51 KB json, core, bitstream
json_complex 51 KB json, core, bitstream

Cross-Language Fixture Files

These .trp files are generated by the C library and verified byte-for-byte by the JavaScript, TypeScript, and Python bindings.

Fixture Size Contents
empty.trp 40 B Empty dictionary (header + CRC only)
single_null.trp 48 B { "hello": null }
single_int.trp 48 B { "key": 42 }
keys_only.trp 65 B { "apple", "banana", "cherry" }
shared_prefix.trp 66 B { "abc": 10, "abd": 20, "xyz": 30 }
multi_mixed.trp 102 B 5 keys, mixed types (bool, int, float, string)
large.trp 628 B 100 sequential keys with integer values

Test Suite

Category Test Programs Individual Tests
C/C++ (Unity) 17 510
Python (pytest) 5 70
JavaScript (Jest) 4 70
TypeScript (Jest) 2 38
Total 28 688

Code coverage: 93.7% line coverage (remaining lines are malloc failure paths).


CI Matrix

All CI runs on GitHub Actions.

Job OS Compiler Notes
Ubuntu GCC Ubuntu 22.04 GCC 11+ Primary build
Ubuntu Clang Ubuntu 22.04 Clang 14+ Secondary build
macOS Clang macOS latest Apple Clang ARM64 build
32-bit Ubuntu 22.04 GCC multilib -m32 cross-compilation
clang-tidy Ubuntu 22.04 Clang Static analysis
clang-format Ubuntu 22.04 Clang Style enforcement
Python bindings Ubuntu 22.04 Python 3.x pytest
JS/TS bindings Ubuntu 22.04 Node.js 18+ Jest

Compiler flags: -Wall -Wextra -Wpedantic -Werror -Wconversion -Wshadow


Language Binding Status

Language Status Package Tests
Python Implemented pip install (planned) 70
JavaScript Implemented npm install (planned) 70
TypeScript Implemented (wraps JS) (same as JS) 38
Go Not yet implemented
Swift Not yet implemented
Rust Not yet implemented

Binary Format Summary

Field Size
Header 32 bytes
Magic bytes TRP\0 (4 bytes)
Format version 1.0
CRC-32 checksum 4 bytes (appended)
Minimum valid file 40 bytes (empty dictionary)