| commit | 117a925f21509a9550f452433c190139e480a726 | [log] [tgz] |
|---|---|---|
| author | Dustin L. Howett <[email protected]> | Mon Oct 26 04:55:17 2020 |
| committer | Dustin L. Howett <[email protected]> | Mon Oct 26 04:55:17 2020 |
| tree | a000ad9754676a2904be6c54be2618052ef31199 | |
| parent | 2d98b15cd319e41e074d07e78b8f5d43d9e6e19f [diff] |
unmarshal: replace manual array element copy with reflect.Copy This commit also adds a benchmark for array unmarshaling. The difference is staggering. name old time/op new time/op delta LargeArrayUnmarshal-4 23.4µs ± 2% 0.4µs ± 2% -98.49% (p=0.000 n=9+9) name old alloc/op new alloc/op delta LargeArrayUnmarshal-4 96.0B ± 0% 128.0B ± 0% +33.33% (p=0.000 n=10+10) name old allocs/op new allocs/op delta LargeArrayUnmarshal-4 3.00 ± 0% 4.00 ± 0% +33.33% (p=0.000 n=10+10)
$ go get howett.net/plist
package main
import (
"howett.net/plist"
"os"
)
func main() {
encoder := plist.NewEncoder(os.Stdout)
encoder.Encode(map[string]string{"hello": "world"})
}