Skip to content
/ lazy Public

golang persistent immutable lazy collections

License

Notifications You must be signed in to change notification settings

perdata/lazy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lazy

Status GoDoc codecov GoReportCard

Lazy is a golang package for dealing with mutations on large arrays. It works by basically deferring the actual edit methods and providing a way to iterate through all the slices. This avoids large-scale memory copying.

This still involves a fair degree of copying and very large arrays will benefit from the lazy package instead.

Benchmark stats

$ go test --bench=. --strlen=50000 -benchmem
goos: darwin
goarch: amd64
pkg: github.com/perdata/lazy
BenchmarkLazy-4     	    5000	    231841 ns/op	  920336 B/op	     722 allocs/op
BenchmarkString-4   	    2000	    501238 ns/op	 5046682 B/op	     200 allocs/op
PASS

Releases

No releases published

Packages

No packages published