Skip to content

Commit

Permalink
Adjust references to tracing profiler in readme (#170)
Browse files Browse the repository at this point in the history
* Adjust references to tracing profiler in readme

* adjust workflow
  • Loading branch information
mschuwalow committed Mar 22, 2023
1 parent c618514 commit 804f015
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Git Checkout
uses: actions/checkout@v3.4.0
uses: actions/checkout@v3.3.0
with:
fetch-depth: '0'
- name: Setup Scala
uses: actions/setup-java@v3.10.0
uses: actions/setup-java@v3.9.0
with:
distribution: temurin
java-version: 17
Expand All @@ -41,11 +41,11 @@ jobs:
if: ${{ ((github.event_name == 'release') && (github.event.action == 'published')) || (github.event_name == 'workflow_dispatch') }}
steps:
- name: Git Checkout
uses: actions/checkout@v3.4.0
uses: actions/checkout@v3.3.0
with:
fetch-depth: '0'
- name: Setup Scala
uses: actions/setup-java@v3.10.0
uses: actions/setup-java@v3.9.0
with:
distribution: temurin
java-version: 17
Expand All @@ -62,15 +62,15 @@ jobs:
generate-readme:
name: Generate README
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'push') || ((github.event_name == 'release') && (github.event_name == 'published')) }}
if: ${{ (github.event_name == 'push') || ((github.event_name == 'release') && (github.event.action == 'published')) }}
steps:
- name: Git Checkout
uses: actions/checkout@v3.4.0
uses: actions/checkout@v3.3.0
with:
ref: ${{ github.head_ref }}
fetch-depth: '0'
- name: Setup Scala
uses: actions/setup-java@v3.10.0
uses: actions/setup-java@v3.9.0
with:
distribution: temurin
java-version: 17
Expand All @@ -84,7 +84,7 @@ jobs:
git add README.md
git commit -m "Update README.md" || echo "No changes to commit"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4.2.4
uses: peter-evans/create-pull-request@v4.2.3
with:
body: |-
Autogenerated changes after running the `sbt docs/generateReadme` command of the [zio-sbt-website](https://zio.dev/zio-sbt) plugin.
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ val slow = ZIO.succeed(Thread.sleep(600))
val program = fast <&> slow
```

In order to profile the program, we wrap it with the `profile` method of the tracing profiler. Once the effect has completed
In order to profile the program, we wrap it with the `profile` method of the sampling profiler. Once the effect has completed
this will yield the profiling result. We can either manipulate the result in Scala or render it in a number of standard
formats. In this case we are going to write it out in a format supported by https://github.com/brendangregg/FlameGraph, so we
can visualize it as a flamegraph.
```scala
TracingProfiler
SamplingProfiler
.profile(program)
.flatMap(_.stackCollapseToFile("profile.folded"))
```

The resulting file can be converted to a svg using the flamegraph.pl script ([preview](img/example_tracing_profile.svg)):
The resulting file can be converted to a svg using the flamegraph.pl script ([preview](img/example_sampling_profile.svg)):
```bash
flamegraph.pl ./examples/profile.folded > profile.svg
```
Expand All @@ -61,7 +61,7 @@ flamegraph.pl ./examples/profile.folded > profile.svg

ZIO Profiling includes experimental support for causal profiling inspired by [coz](https://github.com/plasma-umass/coz).

Usage is similar to the tracing profiler, but instead of displaying the time spent running the program it will give recommendations
Usage is similar to the sampling profiler, but instead of displaying the time spent running the program it will give recommendations
which parts of the program to focus on during performance tuning for biggest effect. It achieves this by iteratively artificially speeding
up parts of the program (by slowing down all parts running concurrently) and measuring the effect on overall runtime.

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](docs/https://plasma-umass.org/coz/) ([preview](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
File renamed without changes
8 changes: 4 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ val slow = ZIO.succeed(Thread.sleep(600))
val program = fast <&> slow
```

In order to profile the program, we wrap it with the `profile` method of the tracing profiler. Once the effect has completed
In order to profile the program, we wrap it with the `profile` method of the sampling profiler. Once the effect has completed
this will yield the profiling result. We can either manipulate the result in Scala or render it in a number of standard
formats. In this case we are going to write it out in a format supported by https://github.com/brendangregg/FlameGraph, so we
can visualize it as a flamegraph.
```scala
TracingProfiler
SamplingProfiler
.profile(program)
.flatMap(_.stackCollapseToFile("profile.folded"))
```

The resulting file can be converted to a svg using the flamegraph.pl script ([preview](img/example_tracing_profile.svg)):
The resulting file can be converted to a svg using the flamegraph.pl script ([preview](img/example_sampling_profile.svg)):
```bash
flamegraph.pl ./examples/profile.folded > profile.svg
```
Expand All @@ -61,7 +61,7 @@ flamegraph.pl ./examples/profile.folded > profile.svg

ZIO Profiling includes experimental support for causal profiling inspired by [coz](https://github.com/plasma-umass/coz).

Usage is similar to the tracing profiler, but instead of displaying the time spent running the program it will give recommendations
Usage is similar to the sampling profiler, but instead of displaying the time spent running the program it will give recommendations
which parts of the program to focus on during performance tuning for biggest effect. It achieves this by iteratively artificially speeding
up parts of the program (by slowing down all parts running concurrently) and measuring the effect on overall runtime.

Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.2")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.7.0")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.3")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.4")
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.10")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3")

libraryDependencies += "org.snakeyaml" % "snakeyaml-engine" % "2.3"

0 comments on commit 804f015

Please sign in to comment.