Commit Graph

4 Commits

Author SHA1 Message Date
ebbcd71b3d Optimize merging/sorting
Previously we sorted a list e.g. [3,2,1]
that we already got, then fetched another
list e.g. [6,7,8,2]. Instead of just
sorting the new list and manually merging it
we would sort the appended lists:
[1,2,3,  6,7,8,2]

Despite mergesort, this is now optimized in
a two-step process:
* ONLY sort the new list
* call a Merge function on both lists, that assumes
  sorted and deduplicated lists

This should be faster.
2017-09-11 16:13:31 +02:00
17aa010ebf Use context.Context for cancellation 2017-09-11 16:13:18 +02:00
771f7c6892 Meet the 500ms timeout
* First, lower the MaxResponseTime which is used
  in the Handler to cancel the running goroutines
  and finalize the result. Since we want to stay below 500ms
  we cannot pick 500ms, because the finalization steps
  take some time too.
* Second, set WriteTimeout to 500ms in order to make sure
  the handler never exceeds that timeframe.
2017-09-11 12:12:23 +02:00
c76b5266e2 Initial commit 2017-09-11 12:08:43 +02:00