opal 1.6.1 → 1.7.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +17 -0
- data/Gemfile +1 -0
- data/HACKING.md +47 -26
- data/UNRELEASED.md +28 -0
- data/benchmark/benchmarks +415 -103
- data/benchmark/bm_call_overhead.yml +28 -0
- data/benchmark/run.rb +61 -40
- data/docs/cdp_common.json +3364 -0
- data/docs/cdp_common.md +18 -0
- data/docs/{headless_chrome.md → headless_browsers.md} +31 -12
- data/lib/opal/ast/builder.rb +1 -1
- data/lib/opal/builder.rb +6 -1
- data/lib/opal/builder_processors.rb +5 -3
- data/lib/opal/cache.rb +1 -7
- data/lib/opal/cli_options.rb +72 -58
- data/lib/opal/cli_runners/chrome.rb +47 -9
- data/lib/opal/cli_runners/chrome_cdp_interface.rb +238 -112
- data/lib/opal/cli_runners/compiler.rb +146 -13
- data/lib/opal/cli_runners/deno.rb +32 -0
- data/lib/opal/cli_runners/firefox.rb +350 -0
- data/lib/opal/cli_runners/firefox_cdp_interface.rb +212 -0
- data/lib/opal/cli_runners/node_modules/.bin/chrome-remote-interface.cmd +17 -0
- data/lib/opal/cli_runners/node_modules/.bin/chrome-remote-interface.ps1 +28 -0
- data/lib/opal/cli_runners/node_modules/.package-lock.json +41 -0
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/LICENSE +1 -1
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/README.md +322 -182
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/bin/client.js +99 -114
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/chrome-remote-interface.js +1 -11
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js +16 -11
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/api.js +41 -33
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/chrome.js +224 -214
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/devtools.js +71 -191
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js +26 -6
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/protocol.json +20788 -9049
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/websocket-wrapper.js +10 -3
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/package.json +59 -123
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/webpack.config.js +25 -32
- data/lib/opal/cli_runners/node_modules/commander/History.md +298 -0
- data/lib/opal/cli_runners/node_modules/commander/LICENSE +22 -0
- data/lib/opal/cli_runners/node_modules/commander/Readme.md +217 -61
- data/lib/opal/cli_runners/node_modules/commander/index.js +431 -145
- data/lib/opal/cli_runners/node_modules/commander/package.json +16 -79
- data/lib/opal/cli_runners/node_modules/ws/README.md +334 -98
- data/lib/opal/cli_runners/node_modules/ws/browser.js +8 -0
- data/lib/opal/cli_runners/node_modules/ws/index.js +5 -10
- data/lib/opal/cli_runners/node_modules/ws/lib/buffer-util.js +129 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/constants.js +10 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/event-target.js +184 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/extension.js +223 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/limiter.js +55 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/permessage-deflate.js +518 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/receiver.js +607 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/sender.js +409 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/stream.js +180 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/validation.js +104 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/websocket-server.js +447 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/websocket.js +1195 -0
- data/lib/opal/cli_runners/node_modules/ws/package.json +40 -106
- data/lib/opal/cli_runners/package-lock.json +62 -0
- data/lib/opal/cli_runners/package.json +1 -1
- data/lib/opal/cli_runners.rb +26 -4
- data/lib/opal/nodes/args/prepare_post_args.rb +2 -2
- data/lib/opal/nodes/def.rb +8 -8
- data/lib/opal/nodes/iter.rb +12 -12
- data/lib/opal/nodes/logic.rb +1 -1
- data/lib/opal/nodes/masgn.rb +2 -2
- data/lib/opal/parser/with_ruby_lexer.rb +1 -1
- data/lib/opal/paths.rb +14 -0
- data/lib/opal/rewriter.rb +2 -0
- data/lib/opal/rewriters/forward_args.rb +52 -4
- data/lib/opal/rewriters/targeted_patches.rb +94 -0
- data/lib/opal/version.rb +1 -1
- data/opal/corelib/basic_object.rb +1 -1
- data/opal/corelib/boolean.rb +2 -2
- data/opal/corelib/class.rb +11 -0
- data/opal/corelib/constants.rb +3 -3
- data/opal/corelib/enumerable.rb +4 -0
- data/opal/corelib/enumerator.rb +1 -1
- data/opal/corelib/hash.rb +2 -2
- data/opal/corelib/helpers.rb +1 -1
- data/opal/corelib/kernel.rb +3 -3
- data/opal/corelib/method.rb +1 -1
- data/opal/corelib/module.rb +29 -8
- data/opal/corelib/proc.rb +7 -5
- data/opal/corelib/runtime.js +141 -78
- data/opal/corelib/set.rb +252 -0
- data/opal/corelib/string.rb +2 -1
- data/opal/corelib/time.rb +2 -2
- data/opal/opal.rb +1 -0
- data/opal.gemspec +1 -0
- data/spec/filters/bugs/array.rb +22 -13
- data/spec/filters/bugs/base64.rb +5 -5
- data/spec/filters/bugs/basicobject.rb +16 -8
- data/spec/filters/bugs/bigdecimal.rb +161 -160
- data/spec/filters/bugs/binding.rb +10 -10
- data/spec/filters/bugs/class.rb +8 -8
- data/spec/filters/bugs/complex.rb +2 -1
- data/spec/filters/bugs/date.rb +79 -81
- data/spec/filters/bugs/datetime.rb +29 -29
- data/spec/filters/bugs/delegate.rb +1 -3
- data/spec/filters/bugs/encoding.rb +69 -69
- data/spec/filters/bugs/enumerable.rb +22 -20
- data/spec/filters/bugs/enumerator.rb +88 -85
- data/spec/filters/bugs/exception.rb +46 -40
- data/spec/filters/bugs/file.rb +32 -32
- data/spec/filters/bugs/float.rb +26 -21
- data/spec/filters/bugs/freeze.rb +88 -0
- data/spec/filters/bugs/hash.rb +39 -38
- data/spec/filters/bugs/integer.rb +57 -44
- data/spec/filters/bugs/io.rb +1 -1
- data/spec/filters/bugs/kernel.rb +349 -269
- data/spec/filters/bugs/language.rb +220 -188
- data/spec/filters/bugs/main.rb +5 -3
- data/spec/filters/bugs/marshal.rb +38 -38
- data/spec/filters/bugs/math.rb +2 -1
- data/spec/filters/bugs/method.rb +73 -62
- data/spec/filters/bugs/module.rb +163 -143
- data/spec/filters/bugs/numeric.rb +6 -6
- data/spec/filters/bugs/objectspace.rb +16 -16
- data/spec/filters/bugs/openstruct.rb +1 -1
- data/spec/filters/bugs/pack_unpack.rb +51 -51
- data/spec/filters/bugs/pathname.rb +7 -7
- data/spec/filters/bugs/proc.rb +63 -63
- data/spec/filters/bugs/random.rb +7 -6
- data/spec/filters/bugs/range.rb +12 -9
- data/spec/filters/bugs/rational.rb +8 -7
- data/spec/filters/bugs/regexp.rb +49 -48
- data/spec/filters/bugs/ruby-32.rb +56 -0
- data/spec/filters/bugs/set.rb +30 -30
- data/spec/filters/bugs/singleton.rb +4 -4
- data/spec/filters/bugs/string.rb +187 -99
- data/spec/filters/bugs/stringio.rb +7 -0
- data/spec/filters/bugs/stringscanner.rb +68 -68
- data/spec/filters/bugs/struct.rb +11 -9
- data/spec/filters/bugs/symbol.rb +1 -1
- data/spec/filters/bugs/time.rb +78 -63
- data/spec/filters/bugs/trace_point.rb +4 -4
- data/spec/filters/bugs/unboundmethod.rb +32 -17
- data/spec/filters/bugs/warnings.rb +8 -12
- data/spec/filters/unsupported/array.rb +24 -107
- data/spec/filters/unsupported/basicobject.rb +12 -12
- data/spec/filters/unsupported/bignum.rb +27 -52
- data/spec/filters/unsupported/class.rb +1 -2
- data/spec/filters/unsupported/delegator.rb +3 -3
- data/spec/filters/unsupported/enumerable.rb +2 -9
- data/spec/filters/unsupported/enumerator.rb +2 -11
- data/spec/filters/unsupported/file.rb +1 -1
- data/spec/filters/unsupported/float.rb +28 -47
- data/spec/filters/unsupported/hash.rb +8 -14
- data/spec/filters/unsupported/integer.rb +75 -91
- data/spec/filters/unsupported/kernel.rb +17 -35
- data/spec/filters/unsupported/language.rb +11 -19
- data/spec/filters/unsupported/marshal.rb +22 -41
- data/spec/filters/unsupported/matchdata.rb +28 -52
- data/spec/filters/unsupported/math.rb +1 -1
- data/spec/filters/unsupported/privacy.rb +229 -285
- data/spec/filters/unsupported/range.rb +1 -5
- data/spec/filters/unsupported/regexp.rb +40 -66
- data/spec/filters/unsupported/set.rb +2 -2
- data/spec/filters/unsupported/singleton.rb +4 -4
- data/spec/filters/unsupported/string.rb +305 -508
- data/spec/filters/unsupported/struct.rb +3 -4
- data/spec/filters/unsupported/symbol.rb +15 -18
- data/spec/filters/unsupported/thread.rb +1 -7
- data/spec/filters/unsupported/time.rb +159 -202
- data/spec/filters/unsupported/usage_of_files.rb +170 -259
- data/spec/lib/builder_spec.rb +4 -4
- data/spec/lib/rewriters/forward_args_spec.rb +32 -12
- data/spec/mspec-opal/runner.rb +2 -0
- data/spec/ruby_specs +4 -0
- data/stdlib/deno/base.rb +28 -0
- data/stdlib/deno/file.rb +340 -0
- data/stdlib/{headless_chrome.rb → headless_browser/base.rb} +1 -1
- data/stdlib/headless_browser/file.rb +15 -0
- data/stdlib/headless_browser.rb +4 -0
- data/stdlib/native.rb +1 -1
- data/stdlib/nodejs/file.rb +5 -0
- data/stdlib/opal/platform.rb +8 -6
- data/stdlib/opal-platform.rb +14 -8
- data/stdlib/set.rb +1 -258
- data/tasks/benchmarking.rake +62 -19
- data/tasks/performance.rake +1 -1
- data/tasks/testing.rake +5 -3
- data/test/nodejs/test_file.rb +29 -10
- data/test/opal/http_server.rb +28 -11
- data/test/opal/unsupported_and_bugs.rb +2 -1
- metadata +91 -52
- data/lib/opal/cli_runners/node_modules/ultron/LICENSE +0 -22
- data/lib/opal/cli_runners/node_modules/ultron/index.js +0 -138
- data/lib/opal/cli_runners/node_modules/ultron/package.json +0 -112
- data/lib/opal/cli_runners/node_modules/ws/SECURITY.md +0 -33
- data/lib/opal/cli_runners/node_modules/ws/lib/BufferUtil.fallback.js +0 -56
- data/lib/opal/cli_runners/node_modules/ws/lib/BufferUtil.js +0 -15
- data/lib/opal/cli_runners/node_modules/ws/lib/ErrorCodes.js +0 -28
- data/lib/opal/cli_runners/node_modules/ws/lib/EventTarget.js +0 -158
- data/lib/opal/cli_runners/node_modules/ws/lib/Extensions.js +0 -69
- data/lib/opal/cli_runners/node_modules/ws/lib/PerMessageDeflate.js +0 -339
- data/lib/opal/cli_runners/node_modules/ws/lib/Receiver.js +0 -520
- data/lib/opal/cli_runners/node_modules/ws/lib/Sender.js +0 -438
- data/lib/opal/cli_runners/node_modules/ws/lib/Validation.fallback.js +0 -9
- data/lib/opal/cli_runners/node_modules/ws/lib/Validation.js +0 -17
- data/lib/opal/cli_runners/node_modules/ws/lib/WebSocket.js +0 -705
- data/lib/opal/cli_runners/node_modules/ws/lib/WebSocketServer.js +0 -336
- data/spec/filters/bugs/boolean.rb +0 -3
- data/spec/filters/bugs/matrix.rb +0 -3
- data/spec/filters/unsupported/fixnum.rb +0 -15
- data/spec/filters/unsupported/freeze.rb +0 -102
- data/spec/filters/unsupported/pathname.rb +0 -4
- data/spec/filters/unsupported/proc.rb +0 -4
- data/spec/filters/unsupported/random.rb +0 -5
- data/spec/filters/unsupported/taint.rb +0 -162
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38a2d4a4ed5e087f1bed29102d84f675f8afe1db295464f44b1d4aee52e6c633
|
4
|
+
data.tar.gz: 290899e91ac1683024cf394ea8b66d64f4df70df7a1233723a9aac88002e6b73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b13492436e25b705e65cde1a672f24cb668c9743992cc7d17f40d248a72a55cc9a8d9ade0a785d236972278217f89f54eb6362ca87411a026a4c41fd69c72c9b
|
7
|
+
data.tar.gz: e7944265ce2f63fd094a624ec42738da5f098e55330da3ea4184b225411dc4c28fb00b792023b578edad3c45efc6e170b920330c7fed87a77bda53dd32219b7d
|
data/.github/workflows/build.yml
CHANGED
@@ -24,6 +24,12 @@ jobs:
|
|
24
24
|
- name: mspec-chrome
|
25
25
|
ruby: '3.0'
|
26
26
|
command: bin/rake mspec_chrome
|
27
|
+
- name: minitest-firefox
|
28
|
+
env:
|
29
|
+
# when changing version, also change it below
|
30
|
+
MOZILLA_FIREFOX_BINARY: '/opt/hostedtoolcache/firefox/106.0.4/x64/firefox'
|
31
|
+
ruby: '3.0'
|
32
|
+
command: xvfb-run bin/rake minitest_firefox
|
27
33
|
- name: minitest
|
28
34
|
ruby: '3.0'
|
29
35
|
command: bin/rake minitest
|
@@ -53,6 +59,13 @@ jobs:
|
|
53
59
|
command: bundle exec rake mspec_chrome
|
54
60
|
ruby: '3.0'
|
55
61
|
os: windows-latest
|
62
|
+
- name: windows-minitest-firefox
|
63
|
+
env:
|
64
|
+
# when changing version, also change it below and above
|
65
|
+
MOZILLA_FIREFOX_BINARY: 'C:/Program Files/Firefox_106.0.4/firefox.exe'
|
66
|
+
ruby: '3.0'
|
67
|
+
command: bundle exec rake minitest_firefox
|
68
|
+
os: windows-latest
|
56
69
|
- name: windows-minitest
|
57
70
|
command: bundle exec rake minitest
|
58
71
|
ruby: '3.0'
|
@@ -81,6 +94,10 @@ jobs:
|
|
81
94
|
runs-on: ${{ matrix.combo.os || 'ubuntu-latest' }}
|
82
95
|
continue-on-error: ${{ matrix.combo.permissive || false }}
|
83
96
|
steps:
|
97
|
+
- uses: browser-actions/setup-firefox@latest
|
98
|
+
with:
|
99
|
+
# when changing version, also change it above
|
100
|
+
firefox-version: '106.0.4'
|
84
101
|
- uses: actions/checkout@v2
|
85
102
|
with:
|
86
103
|
fetch-depth: ${{ fromJSON(matrix.combo.fetchdepth || '1') }}
|
data/Gemfile
CHANGED
data/HACKING.md
CHANGED
@@ -86,26 +86,29 @@ Also there are some specs in `spec/ruby/language/while_spec.rb` that cause an in
|
|
86
86
|
|
87
87
|
## Benchmarking
|
88
88
|
|
89
|
-
|
89
|
+
Opal benchmarking uses the standard Ruby [benchmark_driver](https://github.com/benchmark-driver/), allowing for Ruby .rb and .yaml benchmarks. Examples are available in the `benchmark` directory.
|
90
90
|
|
91
|
-
|
92
|
-
|
93
|
-
It's important to understand that benchmarking in Opal works on the principle of a single, shared benchmarking workspace, a *bench*, where the results of each benchmark run that you perform get automatically saved. When you do `bundle exec rake bench:report`, you get a combined report of all of the benchmark results that are currently sitting in your workspace. This means you can check out an older commit, run benchmarks, checkout a newer commit, run benchmarks, then run the report to see the results from the two commits side-by-side. After you're done, (or before starting a new benchmarking session), you can do `bundle exec rake bench:clear` to reset your workspace to a clean slate.
|
91
|
+
Benchmarking in Opal works on the principle of a single, shared benchmarking workspace, a *bench*, where the results of each benchmark run that you perform get automatically saved. When you do `bundle exec rake bench:report`, you get a combined report of all of the benchmark results that are currently sitting in your workspace. This means you can check out an older commit, run benchmarks, checkout a newer commit, run benchmarks, then run the report to see the results from the two commits side-by-side. After you're done, (or before starting a new benchmarking session), you can do `bundle exec rake bench:clear` to reset your workspace to a clean slate.
|
94
92
|
|
95
93
|
You can get a list of all the available benchmarking commands by running `bundle exec rake -T | grep bench` as shown below.
|
96
94
|
|
95
|
+
On Windows make sure to enable the DevKit before running benchmarks: `ridk enable`.
|
96
|
+
On Linux, depending on your environment, it may be required to use `xvfb-run bundle exec ...` to make sure browser runners can run in headless mode.
|
97
|
+
|
97
98
|
```
|
98
99
|
$ bundle exec rake -T | grep bench
|
99
100
|
|
100
101
|
rake bench:clear # Delete all benchmark results
|
101
|
-
rake bench:
|
102
|
-
rake bench:
|
102
|
+
rake bench:opal_chrome # Benchmark Opal with Chrome runner
|
103
|
+
rake bench:opal_firefox # Benchmark Opal with Firefox runner
|
104
|
+
rake bench:opal_node # Benchmark Opal with Node runner
|
103
105
|
rake bench:ruby # Benchmark Ruby
|
106
|
+
rake bench:ruby_vs_opal # Benchmark Ruby vs Opal Node
|
107
|
+
rake bench:all # Benchmark Ruby vs Opal Node vs Opal Chrome vs Opal Firefox
|
108
|
+
rake bench:report # Combined report of all benchmark results
|
104
109
|
```
|
105
110
|
|
106
|
-
|
107
|
-
|
108
|
-
At the root of the opal project tree is a folder called `benchmark` that contains a file called `benchmarks`. This file lists all of the benchmarks that will be run if you do `bundle exec bench:opal` without specifying any particular benchmark file(s) as parameters to this rake task. In the example below, I pick which benchmarks to run by passing their file paths as parameters to the rake task.
|
111
|
+
At the root of the opal project tree is a folder called `benchmark` that contains a file called `benchmarks`. This file lists all of the benchmarks that will be run if you do `bundle exec bench:opal_node` without specifying any particular benchmark file(s) as parameters to this rake task. In the example below, I pick which benchmarks to run by passing their file paths as parameters to the rake task.
|
109
112
|
|
110
113
|
Start with a clean slate:
|
111
114
|
|
@@ -115,43 +118,61 @@ $ bundle exec rake bench:clear
|
|
115
118
|
rm tmp/bench/*
|
116
119
|
```
|
117
120
|
|
118
|
-
Run two benchmark programs from the
|
121
|
+
Run two benchmark programs from the benchmarking suite by passing their file paths as parameters:
|
119
122
|
(Note: passing params to Rake tasks is tricky - notice there is no space after the comma!)
|
120
123
|
|
121
124
|
```
|
122
|
-
$ bundle exec rake bench:
|
125
|
+
$ bundle exec rake bench:opal_node[benchmark/bm_array_flatten.rb,benchmark/bm_array_add.rb]
|
126
|
+
bundle exec ruby benchmark/run.rb -node benchmark/bm_array_flatten.rb benchmark/bm_array_add.rb | tee tmp/bench/1_opal-node-1-5-1.txt
|
127
|
+
|
128
|
+
Benchmarking benchmark/bm_array_add.rb started at 2022-11-06 10:20:57 +0100:
|
129
|
+
Calculating -------------------------------------
|
130
|
+
bm_array_add 1.941k i/s - 1.000 times in 0.000515s (515.20μs/i)
|
131
|
+
|
132
|
+
Benchmarking benchmark/bm_array_flatten.rb started at 2022-11-06 10:21:05 +0100:
|
133
|
+
Calculating -------------------------------------
|
134
|
+
bm_array_flatten 1.037 i/s - 1.000 times in 0.964620s (964.62ms/i)
|
123
135
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
===============================================
|
128
|
-
Executed 2 benchmarks in 0.8530001640319824 sec
|
136
|
+
|
137
|
+
bm_array_add 1.941k i/s - 1.000 times in 0.000515s (515.20μs/i)
|
138
|
+
bm_array_flatten 1.037 i/s - 1.000 times in 0.964620s (964.62ms/i)
|
129
139
|
```
|
130
140
|
|
131
141
|
In this case, I want to see how Opal's results stack up against MRI's results, so I will run the same set of benchmarks for Ruby:
|
132
142
|
|
133
143
|
```
|
134
|
-
$ bundle exec rake bench:ruby[
|
144
|
+
$ bundle exec rake bench:ruby[benchmark/bm_array_flatten.rb,benchmark/bm_array_add.rb]
|
145
|
+
bundle exec ruby benchmark/run.rb -ruby benchmark/bm_array_flatten.rb benchmark/bm_array_add.rb | tee tmp/bench/2_ruby-3-2-0.txt
|
146
|
+
|
147
|
+
Benchmarking benchmark/bm_array_add.rb started at 2022-11-06 10:22:23 +0100:
|
148
|
+
Calculating -------------------------------------
|
149
|
+
bm_array_add 14.306k i/s - 1.000 times in 0.000070s (69.90μs/i)
|
150
|
+
|
151
|
+
Benchmarking benchmark/bm_array_flatten.rb started at 2022-11-06 10:22:27 +0100:
|
152
|
+
Calculating -------------------------------------
|
153
|
+
bm_array_flatten 7.347 i/s - 1.000 times in 0.136105s (136.10ms/i)
|
135
154
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
===============================================
|
140
|
-
Executed 2 benchmarks in 1.3780025219966774 sec
|
155
|
+
|
156
|
+
bm_array_add 14.306k i/s - 1.000 times in 0.000070s (69.90μs/i)
|
157
|
+
bm_array_flatten 7.347 i/s - 1.000 times in 0.136105s (136.10ms/i)
|
141
158
|
```
|
142
159
|
|
143
160
|
Now I'm ready to see the result of the two runs side-by-side:
|
144
161
|
|
145
162
|
```
|
146
163
|
$ bundle exec rake bench:report
|
147
|
-
|
148
|
-
Benchmark
|
149
|
-
|
150
|
-
|
164
|
+
Base: 1_opal-node-1-5-1
|
165
|
+
Benchmark 1_opal-node-1-5-1 | 2_ruby-3-2-0 |
|
166
|
+
bm_array_flatten 1.037 i/s | +608.49% 7.347 i/s |
|
167
|
+
bm_array_add 1941.000 i/s | +637.04% 14306.000 i/s |
|
151
168
|
```
|
152
169
|
|
153
170
|
If I were to continue running benchmarks, more columns would be added to the report. You can select which columns you want to display (and in what order) by passing their names as params to the rake task like so: `bundle exec rake bench:report[Ruby1,Opal1]`
|
154
171
|
|
172
|
+
Rubies, that are unknown to the Opal benchmarking harness, can be benchmarked by setting the `OPAL_BENCH_EXTRA_RUBIES` environment variable.
|
173
|
+
The full paths to the extra rubies must be specified, separated by ';', ready for benchmark_driver to be passed as option. Example:
|
174
|
+
`OPAL_BENCH_EXTRA_RUBIES="/usr/local/bin/ruby.wasm;/usr/local/bin/ruby.head"`
|
175
|
+
|
155
176
|
### The Ruby Spec Suite Benchmarking
|
156
177
|
|
157
178
|
This type of benchmarking relies on a feature of MSpec whereby you can ask it to execute every example in a given spec multiple times. Adding `BM=<number of times>` to your regular spec suite invocation command will hook into this MSpec functionality, collect timing information, and dump the results into the benchmarking workspace, making them available for reporting. Below is an example run with a single spec and `BM` set to `100`, meaning each example in the spec would be run 100 times.
|
data/UNRELEASED.md
CHANGED
@@ -7,3 +7,31 @@
|
|
7
7
|
### Performance
|
8
8
|
### Fixed
|
9
9
|
-->
|
10
|
+
|
11
|
+
### Added
|
12
|
+
|
13
|
+
- Update benchmarking and CLI runners, added support for Deno and Firefox (#2490, #2492, #2494, #2495, #2497, #2491, #2496)
|
14
|
+
- Ruby 3.2 support branch (#2500)
|
15
|
+
- `Set` now part of the corelib
|
16
|
+
- Anonymous rest keyword and block arguments can be passed to calls: `call(**, &)`
|
17
|
+
- `Refinement#refined_class` has been added
|
18
|
+
- `Module#refinements` has been added
|
19
|
+
- `Module#const_added` has been added
|
20
|
+
- `Proc#parameters` now accepts lambda keyword
|
21
|
+
- `Class#attached_object` has been added, inverse of `singleton_class`
|
22
|
+
- `Hash#shift` now returns `nil` instead of passing `nil` to the `default_proc`
|
23
|
+
- Added `--watch` and `--output` options to the CLI for live compilation (#2485)
|
24
|
+
|
25
|
+
### Performance
|
26
|
+
|
27
|
+
- Replace all occurences of `'$'+name` with a cached helper, saving about 2% in performance (#2481)
|
28
|
+
- Optimize argument passing and arity checks (#2499)
|
29
|
+
- Targeted patches for Opal-Parser, saves up to 12% during compilation (#2482)
|
30
|
+
|
31
|
+
### Internal
|
32
|
+
|
33
|
+
- MSpec & Ruby Spec update (#2486)
|
34
|
+
|
35
|
+
### Fixed
|
36
|
+
|
37
|
+
- Remove throws from runtime (#2484)
|