Documentation
¶
Index ¶
- func DivePart1(input string) (_ int, err error)
- func DivePart2(input string) (_ int, err error)
- func DivePart2_V2(input string) (_ int, err error)
- func DivePart2_V3(input string) (_ int, err error)
- func DivePart2_V4(input string) (_ int, err error)
- func DivePart2_V5(input string) (_ int, err error)
- func ReadTestInput(t testing.TB) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DivePart2_V2 ¶
DivePart2_V2 is optimized version of DivePart2_V1 for latency. Scanner is quite bad, let's reimplement using IndexByte as in https://felixge.de/2021/12/01/advent-of-go-profiling-2021-day-1-1/.
func DivePart2_V3 ¶
DivePart2_V3 is optimized version of DivePart2_V2 for latency. mallogc GC and int parsing are main offendant. Let's reduce allocs and optimize int parsing. This solution has 0 heap allocs.
func DivePart2_V4 ¶
DivePart2_V4 is optimized version of DivePart2_V3 for latency. IndexByte were main offendants. This is still SLOWER than index Byte. V3 is the fastest.
func DivePart2_V5 ¶
DivePart2_V5 is optimized version of DivePart2_V3 for latency. We can optimize the digit parsing further.
func ReadTestInput ¶
Types ¶
This section is empty.