This report is generated from benchmarks in analysis_benchmak and charts
in docs/img/.
go run ./scripts/benchreport.go- Core constructors:
DateTime,ParentIdTag,StartTransactionReq - Scaling path #1:
SendLocalListReq(1 to 1000 entries) - Scaling path #2:
GetConfigurationReq(1 to 1000 keys) - Metrics:
ns/op,B/op,allocs/op
| Case | Custom ns/op | PrimitiveValidated ns/op | Ratio |
|---|---|---|---|
| SendLocalListReq_1000 | 10137.00 | 3066.00 | 3.31x |
| GetConfigurationReq_1000 | 15948.00 | 6074.00 | 2.63x |
| StartTransactionReq | 39.98 | 27.04 | 1.48x |
PrimitiveDirectis the fastest baseline because it skips validation.- Against a fair baseline (
PrimitiveValidated), custom types add bounded overhead but keep all OCPP validation centralized. - As input size grows, custom and validated primitive lines trend similarly (same O(n) shape), which means scaling behavior is predictable.
- Allocation charts show where object wrapping adds memory cost; this is measurable but small compared to typical network/JSON costs in end-to-end OCPP flows.
Using first-class datatypes is a speed vs safety tradeoff. If you want maximum raw microbenchmark speed, direct primitives win. If you want stronger correctness guarantees, clearer APIs, and less repeated validation logic, custom datatypes provide a practical and predictable cost profile.