From ce53ef58daa923666fe71717d2affd0be1d2bbbd Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sat, 22 Oct 2022 01:13:42 -0500 Subject: [PATCH] Include speed explanation --- main.go | 2 ++ swapi.go | 3 +++ 2 files changed, 5 insertions(+) diff --git a/main.go b/main.go index b4b20f9..3b3ac83 100644 --- a/main.go +++ b/main.go @@ -21,6 +21,8 @@ func init() { } func main() { + // If you wonder why this is slow, see how long even a very basic API request + // takes. swapi is very slow! starships, err := AllStarships() if err != nil { log.Errorf("Error loading Starships: %+v", err) diff --git a/swapi.go b/swapi.go index 110b204..b9e0ae1 100644 --- a/swapi.go +++ b/swapi.go @@ -7,6 +7,9 @@ import ( "sync" ) +// If you're using this module and wondering why it's slow, it's the API, not +// this code. + const API_PREFIX = "https://swapi.dev/api" // Source: https://swapi.dev/documentation#people