Skip to content

Commit

Permalink
Simplify README (#26)
Browse files Browse the repository at this point in the history
Swap `@benchmark` for `@btime`

Also does some general maintenance, including bumping for
version 0.4.3.
  • Loading branch information
timholy authored Mar 3, 2022
1 parent 125537a commit 735b24b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 40 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
name: CompatHelper
on:
schedule:
- cron: '00 20 * * *'
- cron: 0 0 * * *
workflow_dispatch:
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
version:
- '0.7'
- '1.0'
- '1.6'
- '1'
- 'nightly'
os:
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Ratios"
uuid = "c84ed2f1-dad5-54f0-aa8e-dbefe2724439"
authors = ["Tim Holy <[email protected]>"]
version = "0.4.2"
version = "0.4.3"

[deps]
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Expand Down
41 changes: 7 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ratios

[![Build Status](https://travis-ci.org/timholy/Ratios.jl.svg?branch=master)](https://travis-ci.org/timholy/Ratios.jl)
[![CI](https://github.com/timholy/Ratios.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/timholy/Ratios.jl/actions/workflows/ci.yml) [![Coverage](https://codecov.io/gh/timholy/Ratios.jl/branch/master/graph/badge.svg?token=ZVcLnVyTBB)](https://codecov.io/gh/timholy/Ratios.jl)

This package provides types similar to Julia's `Rational` type, which make some sacrifices but have better computational performance at the risk of greater risk of overflow.

Expand Down Expand Up @@ -39,39 +39,12 @@ Stacktrace:
[FastRationals](https://github.com/JeffreySarnoff/FastRationals.jl) is another package with safety and performance characteristics that lies somewhere between `SimpleRatio` and `Rational`:

```julia
julia> @benchmark x + y setup=((x, y) = (SimpleRatio(rand(-20:20), rand(2:20)), SimpleRatio(rand(-20:20), rand(2:20))))
BenchmarkTools.Trial: 10000 samples with 1000 evaluations.
Range (min max): 1.727 ns 28.575 ns ┊ GC (min max): 0.00% 0.00%
Time (median): 1.739 ns ┊ GC (median): 0.00%
Time (mean ± σ): 1.753 ns ± 0.445 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
julia> @btime x + y setup=((x, y) = (SimpleRatio(rand(-20:20), rand(2:20)), SimpleRatio(rand(-20:20), rand(2:20))));
1.969 ns (0 allocations: 0 bytes)

▂ ▃ ▃ ▃ ▄ ▆ ▇ █ ▆ ▅ ▅ ▇ ▄ ▁
▂▁▂▁▃▁▅▁█▁█▁█▁█▁█▁█▁█▁█▁█▁█▁█▁▁█▁█▁█▁█▁▆▁▃▁▃▁▃▁▃▁▃▁▃▁▃▁▃▁▂ ▄
1.73 ns Histogram: frequency by time 1.76 ns <
julia> @btime x + y setup=((x, y) = (FastRational(rand(-20:20), rand(2:20)), FastRational(rand(-20:20), rand(2:20))));
3.192 ns (0 allocations: 0 bytes)

Memory estimate: 0 bytes, allocs estimate: 0.

julia> @benchmark x + y setup=((x, y) = (FastRational(rand(-20:20), rand(2:20)), FastRational(rand(-20:20), rand(2:20))))
BenchmarkTools.Trial: 10000 samples with 1000 evaluations.
Range (min max): 3.192 ns 89.167 ns ┊ GC (min max): 0.00% 0.00%
Time (median): 3.215 ns ┊ GC (median): 0.00%
Time (mean ± σ): 3.307 ns ± 1.820 ns ┊ GC (mean ± σ): 0.00% ± 0.00%

▃█▆█▃▂
▄███████▅▄▃▃▃▃▃▃▃▃▃▂▂▂▂▂▂▂▂▂▂▂▁▂▂▂▂▁▂▂▂▂▂▂▁▂▂▂▂▂▂▂▂▂▁▂▂▂▂▂ ▃
3.19 ns Histogram: frequency by time 3.45 ns <

Memory estimate: 0 bytes, allocs estimate: 0.

julia> @benchmark x + y setup=((x, y) = (Rational(rand(-20:20), rand(2:20)), Rational(rand(-20:20), rand(2:20))))
BenchmarkTools.Trial: 10000 samples with 996 evaluations.
Range (min max): 22.385 ns 81.269 ns ┊ GC (min max): 0.00% 0.00%
Time (median): 32.777 ns ┊ GC (median): 0.00%
Time (mean ± σ): 33.162 ns ± 4.743 ns ┊ GC (mean ± σ): 0.00% ± 0.00%

▁ ▇ ▄▂ ▁▆▃ ▂█▃ ▁ ▇ ▁ ▁
▁▁▁▁▁▄▂▁▆▂▂█▄▃█▅▆█▇▇█████████████▅█▆▂▁█▇▁▂▁█▄▁▂▁▁▆▂▁▁▁▁▃▁▁▁ ▃
22.4 ns Histogram: frequency by time 45.8 ns <

Memory estimate: 0 bytes, allocs estimate: 0.
julia> @btime x + y setup=((x, y) = (Rational(rand(-20:20), rand(2:20)), Rational(rand(-20:20), rand(2:20))));
23.065 ns (0 allocations: 0 bytes)
```

2 comments on commit 735b24b

@timholy
Copy link
Owner Author

@timholy timholy commented on 735b24b Mar 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/55896

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.3 -m "<description of version>" 735b24b4854bebfa6372bb9572904da4fadb52c4
git push origin v0.4.3

Please sign in to comment.