Skip to content

Commit

Permalink
Merge branch 'master' into update/jmh-core-1.37
Browse files Browse the repository at this point in the history
  • Loading branch information
mschuwalow authored Mar 10, 2024
2 parents a0d938a + 7c06839 commit 4f793b5
Show file tree
Hide file tree
Showing 18 changed files with 73 additions and 96 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/auto-approve.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/automerge.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
fail-fast: false
matrix:
java: ['17']
scala: ['2.12.17', '2.13.10', '3.2.2']
scala: ['2.12.19', '2.13.13', '3.3.3']
steps:
- name: Checkout current branch
uses: actions/[email protected]
Expand All @@ -63,7 +63,7 @@ jobs:
fail-fast: false
matrix:
java: ['8', '11', '17']
scala: ['2.12.17', '2.13.10', '3.2.2']
scala: ['2.12.19', '2.13.13', '3.3.3']
steps:
- name: Checkout current branch
uses: actions/[email protected]
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/label-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Label PR

on:
pull_request_target: {}

jobs:
update-pr-labels:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
outputs:
labels: ${{ steps.get-pr-labels.outputs.value }}
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: srvaroa/labeler@v1
- run: gh pr view --json labels $PR_URL > pr-labels.json
- id: get-pr-labels
uses: sergeysova/jq-action@v2
with:
cmd: cat pr-labels.json | jq -c '.labels | map(.name)'

auto-approve:
needs: update-pr-labels
runs-on: ubuntu-latest
if: contains(fromJSON(needs.update-pr-labels.outputs.labels), 'auto-approve')
permissions:
pull-requests: write
steps:
- uses: hmarr/auto-approve-action@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

enable-auto-merge:
needs: update-pr-labels
runs-on: ubuntu-latest
if: contains(fromJSON(needs.update-pr-labels.outputs.labels), 'automerge')
permissions:
contents: write
steps:
- run: gh pr merge --merge --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 0 additions & 15 deletions .github/workflows/pr-labeler.yml

This file was deleted.

6 changes: 2 additions & 4 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was autogenerated using `zio-sbt-website` via `sbt generateGithubWorkflow`
# This file was autogenerated using `zio-sbt-website` via `sbt generateGithubWorkflow`
# task and should be included in the git repository. Please do not edit it manually.

name: Website
Expand Down Expand Up @@ -29,8 +29,6 @@ jobs:
check-latest: true
- name: Check if the README file is up to date
run: sbt docs/checkReadme
- name: Check if the site workflow is up to date
run: sbt docs/checkGithubWorkflow
- name: Check artifacts build process
run: sbt +publishLocal
- name: Check website build process
Expand All @@ -51,7 +49,7 @@ jobs:
java-version: 17
check-latest: true
- name: Setup NodeJs
uses: actions/setup-node@v4
uses: actions/setup-node@v3
with:
node-version: 16.x
registry-url: https://registry.npmjs.org
Expand Down
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.7.17"
version = "3.8.0"
maxColumn = 120
align.preset = most
align.multiline = false
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ SamplingProfiler
.flatMap(_.stackCollapseToFile("profile.folded"))
```

The resulting file can be converted to a svg using the flamegraph.pl script ([preview](img/example_sampling_profile.svg)):
The resulting file can be converted to a svg using the flamegraph.pl script ([example](img/example_sampling_profile.svg)):
```bash
flamegraph.pl ./examples/profile.folded > profile.svg
```
Expand Down Expand Up @@ -102,7 +102,7 @@ CausalProfiler(iterations = 100)
.flatMap(_.renderToFile("profile.coz"))
```

The file can be viewed using the [Coz Visualizer](docs/https://plasma-umass.org/coz/) ([preview](img/example_causal_profile.png)).
The file can be viewed using the [Coz Visualizer](https://plasma-umass.org/coz/) (docs/[example](img/example_causal_profile.png)).
As you can see, the profiler correctly tells you that you can get up to a 33% speedup by optimizing the `slow2` effect,
but it's impossible to get a speedup any other way.

Expand Down Expand Up @@ -204,11 +204,11 @@ Learn more on the [ZIO Profiling homepage](https://zio.dev/zio-profiling/)!

## Contributing

For the general guidelines, see ZIO [contributor's guide](https://zio.dev/about/contributing).
For the general guidelines, see ZIO [contributor's guide](https://zio.dev/contributor-guidelines).

## Code of Conduct

See the [Code of Conduct](https://zio.dev/about/code-of-conduct)
See the [Code of Conduct](https://zio.dev/code-of-conduct)

## Support

Expand Down
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,5 @@ lazy val docs = project
projectName := "ZIO Profiling",
mainModuleName := (core / moduleName).value,
projectStage := ProjectStage.Concept,
docsPublishBranch := "master",
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(core)
)
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ SamplingProfiler
.flatMap(_.stackCollapseToFile("profile.folded"))
```

The resulting file can be converted to a svg using the flamegraph.pl script ([preview](img/example_sampling_profile.svg)):
The resulting file can be converted to a svg using the flamegraph.pl script ([example](img/example_sampling_profile.svg)):
```bash
flamegraph.pl ./examples/profile.folded > profile.svg
```
Expand Down Expand Up @@ -102,7 +102,7 @@ CausalProfiler(iterations = 100)
.flatMap(_.renderToFile("profile.coz"))
```

The file can be viewed using the [Coz Visualizer](https://plasma-umass.org/coz/) ([preview](img/example_causal_profile.png)).
The file can be viewed using the [Coz Visualizer](https://plasma-umass.org/coz/) ([example](img/example_causal_profile.png)).
As you can see, the profiler correctly tells you that you can get up to a 33% speedup by optimizing the `slow2` effect,
but it's impossible to get a speedup any other way.

Expand Down
25 changes: 6 additions & 19 deletions project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Keys._
import sbtbuildinfo._
import BuildInfoKeys._
import scalafix.sbt.ScalafixPlugin.autoImport._
import Dependencies.{silencerVersion, organizeImportsVersion}

object BuildHelper {
private val versions: Map[String, String] = {
Expand Down Expand Up @@ -39,25 +38,13 @@ object BuildHelper {
crossScalaVersions := List(Scala212, Scala213, Scala3),
ThisBuild / scalaVersion := defaultScalaVersion,
scalacOptions := stdOptions ++ extraOptions(scalaVersion.value, optimize = !isSnapshot.value),
libraryDependencies ++= {
if (scalaVersion.value == Scala3)
Seq(
"com.github.ghik" % s"silencer-lib_$Scala213" % silencerVersion % Provided
)
else
Seq(
"com.github.ghik" % "silencer-lib" % silencerVersion % Provided cross CrossVersion.full,
compilerPlugin("com.github.ghik" % "silencer-plugin" % silencerVersion cross CrossVersion.full)
)
},
semanticdbEnabled := scalaVersion.value == defaultScalaVersion,
semanticdbEnabled := scalaVersion.value == defaultScalaVersion,
semanticdbOptions ++= (if (scalaVersion.value != Scala3) List("-P:semanticdb:synthetics:on") else Nil),
semanticdbVersion := scalafixSemanticdb.revision,
ThisBuild / scalafixScalaBinaryVersion := CrossVersion.binaryScalaVersion(scalaVersion.value),
ThisBuild / scalafixDependencies += "com.github.liancheng" %% "organize-imports" % organizeImportsVersion,
Compile / fork := true,
Test / fork := true,
Test / parallelExecution := true,
semanticdbVersion := scalafixSemanticdb.revision,
ThisBuild / scalafixScalaBinaryVersion := CrossVersion.binaryScalaVersion(scalaVersion.value),
Compile / fork := true,
Test / fork := true,
Test / parallelExecution := true,
incOptions ~= (_.withLogRecompileOnMacro(false)),
autoAPIMappings := true,
buildInfoKeys := Seq[BuildInfoKey](organization, moduleName, name, version, scalaVersion, sbtVersion, isSnapshot),
Expand Down
4 changes: 1 addition & 3 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
object Dependencies {
val collectionCompatVersion = "2.11.0"
val jmhVersion = "1.37"
val organizeImportsVersion = "0.6.0"
val silencerVersion = "1.7.14"
val zioVersion = "2.0.14"
val zioVersion = "2.0.21"
}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.9.8
sbt.version = 1.9.9
8 changes: 4 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.13")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.4")
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.15")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.0")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.2")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.7")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.5.2")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.10")
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.4.0-alpha.23")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")

libraryDependencies += "org.snakeyaml" % "snakeyaml-engine" % "2.7"
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class TaggingPlugin(val global: Global) extends Plugin {
case ZioTaggingTarget(t1, t2, t3) =>
q"$costCenterModule.withChildCostCenter[$t1,$t2,$t3]($name)($tree)($traceModule.empty)"
case ZStreamTaggingTarget(t1, t2, t3) =>
println(name)
q"$costCenterModule.withChildCostCenterStream[$t1,$t2,$t3]($name)($tree)($traceModule.empty)"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ object TaggingPhase extends PluginPhase {
def unapply(tp: Tree[Type])(using Context): Option[TaggingTarget] =
tp.tpe.dealias match {
case AppliedType(at, t1 :: t2 :: t3 :: Nil) if at.isRef(zioTypeRef.symbol) => Some(ZioTaggingTarget(t1, t2, t3))
case AppliedType(at, t1 :: t2 :: t3 :: Nil) if at.isRef(zioTypeRef.symbol) => Some(ZStreamTaggingTarget(t1, t2, t3))
case AppliedType(at, t1 :: t2 :: t3 :: Nil) if at.isRef(zStreamTypeRef.symbol) => Some(ZStreamTaggingTarget(t1, t2, t3))
case _ => None
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package zio.profiling.causal

import com.github.ghik.silencer.silent

import java.util.concurrent.ConcurrentHashMap
import scala.jdk.CollectionConverters._

Expand Down Expand Up @@ -57,7 +55,6 @@ final private class Experiment(
()
}

@silent("JavaConverters")
def toResult(): ExperimentResult =
ExperimentResult(
candidate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ private[causal] object FiberState {
val state = new FiberState(
new AtomicLong(inheritedDelay),
CostCenter.getCurrentUnsafe(fiber),
true,
false,
false,
running = true,
lastEffectWasStateful = false,
inAsync = false,
0
)
state
Expand Down

0 comments on commit 4f793b5

Please sign in to comment.