Your measurement of performance contains other elements:
if v, ok := itenariesMap[i]; ok { w.WriteHeader(http.StatusOK) fmt.Fprintf(w, utils.PrettyPrint(s.TravelItenariesCSV[v])) // this takes ~500.0µs //fmt.Fprintf(w, utils.PrettyPrint(v)) // this takes ~50.0µs } defer utils.PrintExecutionTime(startTime)does 2 things: fmt.Printf takes time. For 1 variable it will be x, it will scale accordingly for 10x the parameters
Second: When measuring throughput, do not use defer: Defer runs later (hence the term defer).
So to measure the map performance you could do:
for _, v := range s.TravelItenariesCSV { //s.TravelItenariesCSV is a slice of the struct above itenariesMap[v.FlightNum] = i }utils.PrintExecutionTime(startTime)rest of the codeThat should give you a better throughput estimate