jodaTime
jodaTime copied to clipboard
Add ParseInLocationDirect
Good day. On my system, the implementation of time.LoadLocation uses cgo for non standart timezones, like Europe/Moscow, which takes a lot of CPU time, I would like to be able to parse the time without calculating the location every time
From a minute of work 28 seconds is spent on cgo
Benchmarks:
d:\www\github\jodaTime>go test -bench=. -cpuprofile=cpu.out parse_test.go parse.go
goos: windows
goarch: amd64
cpu: Intel(R) Xeon(R) CPU X5670 @ 2.93GHz
BenchmarkParse-8 914535 1299 ns/op
BenchmarkParseInLocation-8 8008 161671 ns/op
BenchmarkParseInLocationDirect-8 856102 1431 ns/op
PASS
ok command-line-arguments 4.204s
👍