Skip to content

Instantly share code, notes, and snippets.

View raymondtay's full-sized avatar
🎯
Focusing

Raymond Tay raymondtay

🎯
Focusing
View GitHub Profile

Understanding Comparative Benchmarks

I'm going to do something that I don't normally do, which is to say I'm going to talk about comparative benchmarks. In general, I try to confine performance discussion to absolute metrics as much as possible, or comparisons to other well-defined neutral reference points. This is precisely why Cats Effect's readme mentions a comparison to a fixed thread pool, rather doing comparisons with other asynchronous runtimes like Akka or ZIO. Comparisons in general devolve very quickly into emotional marketing.

But, just once, today we're going to talk about the emotional marketing. In particular, we're going to look at Cats Effect 3 and ZIO 2. Now, for context, as of this writing ZIO 2 has released their first milestone; they have not released a final 2.0 version. This implies straight off the bat that we're comparing apples to oranges a bit, since Cats Effect 3 has been out and in production for months. However, there has been a post going around which cites various compar

Cats Effect 3.0 Proposal

If you're someone for whom code speaks louder than words, here's a branch to ponder: https://github.com/typelevel/cats-effect/tree/ce3

The following is a proposal for Cats Effect 3, collaboratively devised over the last few months by several of the maintainers and contributors to the library. I will frequently use first-person in this document (because I'm lazy), which is posted under my name (ditto), but it really was a joint effort. As with any joint effort, there has definitely been some healthy debate about several of the concepts in this proposal. For reference, these are the things we're the least sure about:

  • Concurrent now takes two type parameters, and thus is somewhat less ergonomic
  • Region has been added, along with some complex associated machinery
    • One component of that machinery is the Safe.Case type
  • Several existing laws are retained (such as Sync being stack-safe)
@paulp
paulp / typelevel-difference.scala
Last active March 31, 2017 00:59
different behavior between typelevel and standard compiler
/** The following difference in behavior is seen between the
* typelevel scala 2.12.1 compiler and the standard one. The
* only difference between the failing case and the succeeding one
* is the scalaOrganization. No compiler options are needed.
* To reproduce, add
*
* scalaOrganization := "org.typelevel"
*
* to the build.sbt at https://github.com/paulp/psp-std and sbt test.
*/
anonymous
anonymous / response.md
Created October 6, 2016 14:29
Response to recent InfoQ article

Most of what's written in this article is deliberately biased and wrong. It is yet another in the stream of Scala-hating posts that people. I analyze the article below:

  1. TIOBE index is a metric based on search engine ranking policies and can be intentionally or unintentionally gamed.

    https://blog.timbunce.org/2009/05/17/tiobe-index-is-being-gamed/

On these rankings, Scala is quite high:

@pchiusano
pchiusano / microbenchmark.markdown
Created December 2, 2011 13:49
Simple microbenchmarks comparing Scala vs Java mutable map performance

I was curious about the results reported here, which reports that Scala's mutable maps are slower than Java's: http://www.infoq.com/news/2011/11/yammer-scala

In my tests, Scala's OpenHashMap equals or beats java's HashMap:

Insertion 100k elements (String keys) time in ms:

  • scala HashMap: 92.75
  • scala OpenHashMap: 14.03125
  • java HashMap: 15.78125