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
import com.github.benmanes.caffeine.cache.Ticker | |
import com.github.blemale.scaffeine.Scaffeine | |
import scala.concurrent.duration.Duration | |
import scala.concurrent.{ExecutionContext, Future} | |
/** | |
* | |
* @param initialCapacity minimum total size for the internal hash tables | |
* @param maximumSize the maximum size of the cache |
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
Feature | EhCache | Google Guava | Caffeine | |
---|---|---|---|---|
Performanc with 8 threads | 11252172 Ops/sec | 12434655 Ops/sec | 181703298 Ops/sec | |
Async Loading | No | Not available out of the box | Available out of box | |
Scala Support | No | ScalaCache provides google guava[however key can only be String] | Scaffeine | |
User base | 1.2k stars on Github | 29k stars on Github | 5k stars on Github |
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
import pureconfig._ | |
import com.typesafe.config.ConfigFactory | |
case class Person(id: Int, name: String, number: String) | |
object PureConfigTest extends App { | |
val person = loadConfig[Person](ConfigFactory.load("conf123/application.conf")) match { | |
case Right(conf) => conf | |
case Left(failures) => |