typelevel / typelevel/cats-effect

use `java.lang.ClassValue` instead of `IO.tag`

Open
#4,260 2 comments 3 reactions 0 assignees View on GitHub

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.

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.