test rpds_hash_trie_map_get ... bench: 11,531,784 ns/iter (+/- 503,096)
test rpds_hash_trie_map_insert ... bench: 249,887,732 ns/iter (+/- 4,251,611)
test rpds_hash_trie_map_insert_mut ... bench: 22,702,839 ns/iter (+/- 3,153,523)
test rpds_hash_trie_map_iterate ... bench: 6,493,574 ns/iter (+/- 257,859)
test rpds_hash_trie_map_remove ... bench: 243,386,699 ns/iter (+/- 2,248,218)
test rpds_hash_trie_map_remove_mut ... bench: 24,521,295 ns/iter (+/- 2,955,226)
test rpds_list_drop_first ... bench: 4,368,620 ns/iter (+/- 150,818)
test rpds_list_drop_first_mut ... bench: 1,563,121 ns/iter (+/- 70,488)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ch07 | |
import java.util.UUID | |
import java.util.concurrent.{Callable, CountDownLatch, ExecutorService, Executors} | |
import java.util.concurrent.atomic.AtomicReference | |
import ch07.Par.Par | |
import ch07.ParImpl.Par | |
object ParActor { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object UriCodecsDemo extends App { | |
import UriEncoder.Implicit._ | |
case class Channel(name: String) | |
implicit val channelUriEncoder: UriEncoder[Channel] = _.name | |
val uri = (SimpleUri(HttpProtocol.Https, "discovery.itv.com") / "channel" / Channel("itv")) ? ("q" -> "foobar") ? ("lang" -> "en") | |
println(uri.fullPath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ch07 | |
import scala.concurrent.duration.Duration | |
import scala.concurrent.{Await, ExecutionContext, Future} | |
object ParImpl { | |
sealed trait Par[A] { | |
def toFuture(implicit ec: ExecutionContext): Future[A] = { | |
this match { | |
case Par.Unit(f) => Future(f()) |