jodaTime icon indicating copy to clipboard operation
jodaTime copied to clipboard

Add ParseInLocationDirect

Open sitnikovv opened this issue 3 years ago • 1 comments

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

cpu From a minute of work 28 seconds is spent on cgo

sitnikovv avatar Dec 15 '21 07:12 sitnikovv

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

sitnikovv avatar Dec 15 '21 08:12 sitnikovv

👍

vjeantet avatar Feb 28 '23 22:02 vjeantet