typelevel / typelevel/cats-effect
use `java.lang.ClassValue` instead of `IO.tag`
Open
Nobody has claimed this yet.
- #4266 by @djspiewak — closed without merging
- Dominant language
- Scala
- Stars
- 2.2k
- Forks
- 576
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 18
Description
I think java.lang.ClassValue is faster than current implementation.
- benchmark code https://github.com/xuwei-k/cats-effect/commit/f7c2dabfd974bcfb57cff683a360ef7c163a4487
- https://github.com/scala/scala/pull/9632
Jmh / run -i 10 -wi 10 -f 1 -t 1 cats.effect.benchmarks.TagBenchmark
[info] Benchmark Mode Cnt Score Error Units
[info] TagBenchmark.classValue thrpt 10 10348652.195 ± 116363.873 ops/s
[info] TagBenchmark.tag thrpt 10 7336411.108 ± 91988.686 ops/s
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the referenced TagBenchmark and run Jmh / run -i 10 -wi 10 -f 1 -t 1 cats.effect.benchmarks.TagBenchmark; review the linked benchmark commit and Scala pull request for context. Done means the implementation uses java.lang.ClassValue instead of IO.tag and the benchmark confirms the expected performance comparison.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100