Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zio.Differ::patch seems to introduce boxing around integer #8110

Closed
guizmaii opened this issue May 12, 2023 · 4 comments · Fixed by #8111
Closed

zio.Differ::patch seems to introduce boxing around integer #8110

guizmaii opened this issue May 12, 2023 · 4 comments · Fixed by #8111

Comments

@guizmaii
Copy link
Member

In some CPU profiling of the benchmarks we run on our Consumer wrapping zio-kafka's Consumer, we can see this:

--- 10000000 ns (0.18%), 1 sample
  [ 0] scala.runtime.BoxesRunTime.boxToInteger
  [ 1] zio.Differ$$anon$8.patch
  [ 2] zio.FiberRef$unsafe$$anon$2.patch
  [ 3] zio.FiberRefs.$anonfun$forkAs$1
  [ 4] zio.FiberRefs$$Lambda$134.0x0000000800d59280.apply
  [ 5] scala.collection.immutable.Map$Map4.transform
  [ 6] scala.collection.immutable.Map$Map4.transform
  [ 7] zio.FiberRefs.forkAs
  [ 8] zio.ZIO$unsafe$.makeChildFiber
  [ 9] zio.ZIO$unsafe$.fork
  [10] zio.ZIO.$anonfun$forkWithScopeOverride$2
  [11] zio.ZIO$$Lambda$325.0x0000000800dd8800.apply
  [12] zio.internal.FiberRuntime.runLoop
  [13] zio.internal.FiberRuntime.runLoop
  [14] zio.internal.FiberRuntime.runLoop
  [15] zio.internal.FiberRuntime.runLoop
  [16] zio.internal.FiberRuntime.runLoop
  [17] zio.internal.FiberRuntime.runLoop
  [18] zio.internal.FiberRuntime.evaluateEffect
  [19] zio.internal.FiberRuntime.evaluateMessageWhileSuspended
  [20] zio.internal.FiberRuntime.drainQueueOnCurrentThread
  [21] zio.internal.FiberRuntime.run
  [22] zio.internal.ZScheduler$$anon$4.run
@adamgfraser
Copy link
Contributor

@guizmaii What FiberRefs are you creating?

@guizmaii
Copy link
Member Author

guizmaii commented May 12, 2023

We're not creating any FiberRef manually so I guess, the default ones.

How can I get this information?

@adamgfraser
Copy link
Contributor

A minimized reproducer, ideally only using ZIO, would be helpful.

@guizmaii
Copy link
Member Author

I'll see what I can do. Not sure it's easily isolatable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants