From 6c63a5a34ee2379e3dd0ed740eea396e14bb656e Mon Sep 17 00:00:00 2001 From: Emile Date: Tue, 17 Sep 2019 19:24:39 +0200 Subject: added some benchmarks --- convert_test.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'convert_test.go') diff --git a/convert_test.go b/convert_test.go index 0cf195f..f3dd2b4 100644 --- a/convert_test.go +++ b/convert_test.go @@ -5,6 +5,7 @@ import ( "fmt" "os" "reflect" + "strings" "testing" ) @@ -480,3 +481,27 @@ func BenchmarkNewTLE(b *testing.B) { _, _ = NewTLE(RawTLE) } } + +func BenchmarkParseLineOne(b *testing.B) { + RawTLE := `CALSPHERE 1 +1 00900U 64063C 19230.92310804 .00000183 00000-0 18763-3 0 9990 +2 00900 90.1493 23.5442 0025413 246.1721 230.7950 13.73262737728795` + + var SplitTLE = strings.Split(RawTLE, "\n") + + for i := 0; i < b.N; i++ { + _, _ = parseLineOne(SplitTLE) + } +} + +func BenchmarkParseLineTwo(b *testing.B) { + RawTLE := `CALSPHERE 1 +1 00900U 64063C 19230.92310804 .00000183 00000-0 18763-3 0 9990 +2 00900 90.1493 23.5442 0025413 246.1721 230.7950 13.73262737728795` + + var SplitTLE = strings.Split(RawTLE, "\n") + + for i := 0; i < b.N; i++ { + _, _ = parseLineTwo(SplitTLE) + } +} -- cgit 1.4.1