Include speed explanation
This commit is contained in:
parent
3dbedac7af
commit
ce53ef58da
2
main.go
2
main.go
|
@ -21,6 +21,8 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
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()
|
starships, err := AllStarships()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("Error loading Starships: %+v", err)
|
log.Errorf("Error loading Starships: %+v", err)
|
||||||
|
|
3
swapi.go
3
swapi.go
|
@ -7,6 +7,9 @@ import (
|
||||||
"sync"
|
"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"
|
const API_PREFIX = "https://swapi.dev/api"
|
||||||
|
|
||||||
// Source: https://swapi.dev/documentation#people
|
// Source: https://swapi.dev/documentation#people
|
||||||
|
|
Loading…
Reference in a new issue