Skip to content

Instantly share code, notes, and snippets.

@mdarby
Last active August 29, 2015 14:17
Show Gist options
  • Save mdarby/0f304779a14b3f5acba6 to your computer and use it in GitHub Desktop.
Save mdarby/0f304779a14b3f5acba6 to your computer and use it in GitHub Desktop.
jobs
|> Enum.map(fn(x) -> x.name end)
|> Enum.sort
|> Enum.chunk(5)
|> Enum.map(fn(x) -> Enum.shuffle(x) end)
# (A) is != to (B)
names = Enum.map(jobs, fn(x) -> x.name end)
sorted_names = Enum.sort(names)
chunked_names = Enum.chunk(sorted_names, 5)
shuffled_chunks = Enum.map(chunked_names, fn(x) -> Enum.shuffle(x) end)
# A == 14 more req/s and 4.2X LESS timeouts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment