Skip to content

Tags: xtaci/qpp

Tags

v1.1.25

Toggle v1.1.25's commit message
perf: optimize EncryptWithPRNG/DecryptWithPRNG for ~32% throughput im…

…provement

Performance improvement from ~1450 MB/s to ~1920 MB/s while maintaining
full backward compatibility.

Optimizations applied:
- Inline xoshiro256ss PRNG to eliminate function call overhead
- 2x loop unrolling (process 16 bytes per iteration instead of 8)
- Bounds check elimination hints using `_ = d[15]`
- Use bit shift `count << 3` instead of multiplication `count * 8`
- Pre-compute XOR offsets for better instruction-level parallelism
- Add //go:nosplit compiler directive to avoid stack split checks
- Early return for empty data slices
- Optimize struct field ordering for better cache locality
- Add padding to Rand struct for optimal alignment

Benchmark results (AMD Ryzen 9 5950X):
  Before: ~1450 MB/s
  After:  ~1920 MB/s

v1.1.24

Toggle v1.1.24's commit message
use modernized loop

v1.1.23

Toggle v1.1.23's commit message
encrypt full hmac instead of half hmac

v1.1.22

Toggle v1.1.22's commit message
use vet recommended writing style

v1.1.21

Toggle v1.1.21's commit message
Use (perms.BitLen()+7)/8 before deriving chunkCount.

v1.1.20

Toggle v1.1.20's commit message
fix fastprng

v1.1.19

Toggle v1.1.19's commit message
Rounded the chunk count up when deriving seed segments so seedToChunks

never under-fills the required entropy budget; also guard against
zero so there is always at least one 32-byte block (qpp.go:336-368).

v1.1.18

Toggle v1.1.18's commit message
add a fast PRNG for simple extension of seed, and move CreatePRNG to

public function

v1.1.17

Toggle v1.1.17's commit message
add a package description

v1.1.16

Toggle v1.1.16's commit message
optimize createprng