This document provides an overview of the performance benchmarks for the Fabtoken driver in Panurus.
Related Documentation:
- Testing Architecture - Understanding the test layers
The Fabtoken benchmarks measure the performance of token operations (Issue, Transfer, and Validation) at different abstraction layers. Unlike the ZKAT DLog driver, Fabtoken does not use complex zero-knowledge proofs, making its operations significantly faster and simpler.
The following packages contain benchmark tests for Fabtoken:
token/core/fabtoken/v1:
BenchmarkTransferServiceTransfer, BenchmarkIssueServiceIssue, BenchmarkAuditorServiceCheckBenchmarkSender, BenchmarkIssuerBenchmarkVerificationSenderProof, BenchmarkProofVerificationIssuerBenchmarkTransferProofGenerationtoken/core/fabtoken/v1/validator:
BenchmarkValidatorTransfer, BenchmarkValidatorIssueFabtoken benchmarks support the same programmatic parameter system as other drivers:
These are controlled via the benchmark package and can be customized in the test code or via flags if implemented in the future (currently using defaults from GenerateCasesWithDefaults).
# Transfer Service
go test ./token/core/fabtoken/v1 -bench=BenchmarkTransferServiceTransfer -benchmem -run=^$
# Issue Service
go test ./token/core/fabtoken/v1 -bench=BenchmarkIssueServiceIssue -benchmem -run=^$
# Auditor Service
go test ./token/core/fabtoken/v1 -bench=BenchmarkAuditorServiceCheck -benchmem -run=^$
# Transfer Action Generation
go test ./token/core/fabtoken/v1 -bench=BenchmarkSender -benchmem -run=^$
# Issue Action Generation
go test ./token/core/fabtoken/v1 -bench=BenchmarkIssuer -benchmem -run=^$
go test ./token/core/fabtoken/v1/validator -bench=BenchmarkValidatorTransfer -benchmem -run=^$
go test ./token/core/fabtoken/v1/validator -bench=BenchmarkValidatorIssue -benchmem -run=^$
Most benchmarks include parallel variants to measure performance under concurrent load:
BenchmarkParallelSender, BenchmarkVerificationParallelSenderProofTestParallelBenchmarkTransferServiceTransfer, TestParallelBenchmarkIssueServiceIssue, TestParallelBenchmarkAuditorServiceCheck, TestParallelBenchmarkValidatorTransfer, etc.To run the custom parallel benchmarks (using *testing.T):
go test ./token/core/fabtoken/v1 -run=TestParallelBenchmarkTransferServiceTransfer -v
The benchmarks report:
ns/op: Time taken per operation.B/op: Memory allocated per operation.allocs/op: Number of memory allocations per operation.Lower values indicate better performance. Since Fabtoken uses standard cryptographic signatures (like ECDSA or RSA) instead of ZK proofs, you should expect much lower ns/op compared to the DLog driver.