├── .gitignore ├── LICENSE ├── NOTICE ├── README.md ├── css └── styles.css ├── doc ├── Example.md ├── chrome_os_graph.png ├── mac_graph.png ├── win_graph.png └── win_mac_chrome_graph.png ├── index.html └── js ├── Benchmark.js ├── Test.js └── WebAudioBenchApplication.js /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Web Audio Bench 2 | Copyright (c) 2019 Spotify AB 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Web Audio Bench 2 | 3 | [](https://img.shields.io/badge/lifecycle-alpha-blue.svg) 4 | [](LICENSE.txt) 5 | 6 | Web Audio Bench is a test suite for comparing web audio performance across devices and browsers. It is written in Javascript. 7 | 8 | ## Example 9 | 10 | The example below compares different browsers on Mac. Lower values are better. It shows: 11 | 12 | * The performance is similar across browsers for AudioBufferSourceNode and OscillatorNode. 13 | * There are big variations in GainNode and BiquadFilterNode automation performance. 14 | * The most expensive node types are CompressorNode and the nodes involving FFT; WaveShaperNode, ConvolverNode and PannerNode, with variations across browsers. 15 | * Safari has the fastest baseline and most nodes are a bit faster. This could indicate faster framework, such as a more efficient audio graph traversal / audio data propagation. 16 | * The MixedBenchmark metric is a compound score using a handful of the most commonly used nodes. It can be used as an overall score for a given platform and browser. 17 | 18 |  19 | 20 | ## About 21 | 22 | The primary goal of Web Audio Bench is to provide a benchmark of overall CPU performance for Web Audio as well as individual performance figures for different AudioNodes. The results can be used to e.g. 23 | 24 | * Compare the performance of different browsers on the same hardware 25 | * Compare the performance on different hardware for the same browser 26 | * Compare different browser versions 27 | 28 | It can be used to identify regressions as well as optimisation opportunities. It can also be used to customize web audio usage for best performance per platform. 29 | 30 | The second goal is to allow Web Audio developers to write custom tests to compare the relative performance of different graph layouts. For this, you'll need to fork this project and add your own 31 | custom test implementations. 32 | 33 | * [More examples](doc/Example.md) 34 | * [Source code for tests](js/Test.js) 35 | 36 | # Running 37 | 38 | To run the benchmark, go to [https://spotify.github.io/web-audio-bench/](https://spotify.github.io/web-audio-bench/) or clone this repo and open index.html in your browser. 39 | 40 | Alternatively, use an http server, e.g.: 41 | 42 | npm install http-server -g 43 | http-server -p 7777 -c-1 44 | 45 | Then, open http://localhost:7777 46 | 47 | ### Safari note 48 | 49 | 2019-09-11: A memory leak in Safari makes the browser tab crash after 50 test runs or so. To avoid it, reduce number of test runs. If this doesn't help, reduce the test duration too. 50 | 51 | Also note that Safari time resolution is limited to 1ms, so the default test duration is set to 5x longer than on other browsers. 52 | 53 | # Developing 54 | 55 | All tests inherit the `Test` base class. For a simple example, look at the `CompressorTest`. You can add constructor arguments to customize the kind of test to be run. In the `CompressorTest` 56 | example, we can provide different `knee`-values and see how this affects performance. 57 | 58 | After having written your test, add it to the list of tests in `WebAudioBenchApplication.getTestList()`. 59 | 60 | In order to get fast test runs while not measuring too short time periods, all tests have been tuned to take approximately 50 ms on a MacBook Pro 2017 (3,1 GHz Intel Core i7) when running in Chrome 78. When adding your 61 | own tests, try to make them run roughly as long. You can tune the test duration by setting `numNodes` in the `Test` constructor, which will indicate how many 62 | nodes you intend to test on in parallel. The total duration of your test will then be divided by this number. 63 | 64 | ## Contributing 65 | 66 | Contributions such as bug fixes, improvements and new tests are welcome. Please submit a pull request or issue. 67 | 68 | ## Development Status 69 | 70 | This product is considered alpha. 71 | 72 | ## Code of Conduct 73 | 74 | This project adheres to the [Open Code of Conduct][code-of-conduct]. By participating, you are expected to honor this code. 75 | 76 | [code-of-conduct]: https://github.com/spotify/code-of-conduct/blob/master/code-of-conduct.md 77 | -------------------------------------------------------------------------------- /css/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: 'Crete Round', serif; 3 | padding: 20px; 4 | background-color: #fff; 5 | color: #000; 6 | font-size: 14px; 7 | line-height: 1.5em; 8 | } 9 | 10 | h1 { 11 | margin-top: 20px; 12 | font-size: 100px; 13 | line-height: 1.15em; 14 | margin-bottom: 20px; 15 | color: #333; 16 | } 17 | 18 | .fork-me-ribbon { 19 | position: absolute; 20 | top: 0; 21 | right: 0; 22 | } 23 | 24 | .mid-section { 25 | display: flex; 26 | flex-direction: row; 27 | margin: 30px 0 40px; 28 | } 29 | 30 | .mid-section .control-column { 31 | width: 470px; 32 | } 33 | 34 | .input-basic { 35 | box-sizing: border-box; 36 | padding: 5px 10px; 37 | border-radius: 3px; 38 | box-shadow: none; 39 | font-size: 13px; 40 | border: 1px solid #ccc; 41 | } 42 | 43 | .select-basic { 44 | font-family: 'Crete Round', serif; 45 | box-sizing: border-box; 46 | border-radius: 3px; 47 | box-shadow: none; 48 | font-size: 13px; 49 | border: 1px solid #ccc; 50 | } 51 | 52 | .run-settings .control { 53 | display: flex; 54 | margin-bottom: 20px; 55 | } 56 | 57 | .run-settings .control label { 58 | width: 100px; 59 | } 60 | 61 | .run-settings .runs input { 62 | width: 250px; 63 | } 64 | 65 | .run-settings .duration input { 66 | width: 250px; 67 | } 68 | 69 | .run-settings .tests-selection select { 70 | width: 250px; 71 | height: 250px; 72 | } 73 | 74 | .button-basic { 75 | border: 0; 76 | border-radius: 20px; 77 | box-shadow: none; 78 | background-color: #5790c1; 79 | color: #fff; 80 | padding: 9px 20px; 81 | font-size: 17px; 82 | min-width: 200px; 83 | } 84 | 85 | .button-basic:hover { 86 | opacity: 0.9; 87 | } 88 | 89 | .results-table { 90 | font-family: Monospaced, Courier; 91 | font-size: 16px; 92 | line-height: 1.5em; 93 | white-space: pre; 94 | } 95 | 96 | .results-table th { 97 | width: 80px; 98 | font-weight: bold; 99 | text-align: right; 100 | } 101 | 102 | .results-table td { 103 | width: 80px; 104 | text-align: right; 105 | } 106 | 107 | .results-table td:nth-child(1), .results-table th:nth-child(1) { 108 | text-align: left; 109 | width: 300px; 110 | font-weight: bold; 111 | } 112 | 113 | .results-table td:nth-child(2), .results-table th:nth-child(2) { 114 | font-weight: bold; 115 | } 116 | 117 | .results-table td:nth-child(3), .results-table th:nth-child(3) { 118 | width: 250px; 119 | } 120 | -------------------------------------------------------------------------------- /doc/Example.md: -------------------------------------------------------------------------------- 1 | # Web Audio Bench Examples 2 | 3 | ## Mac 4 | 5 | * MacBook Pro 2017 (3,1 GHz Intel Core i7). 6 | * The performance is similar across browsers for AudioBufferSourceNode and OscillatorNode. 7 | * There are big variations in GainNode and BiquadFilterNode automation performance. 8 | * The most expensive node types are CompressorNode and the nodes involving FFT; WaveShaperNode, ConvolverNode and PannerNode, with variations across browsers. 9 | * Safari has the fastest baseline and most nodes are a bit faster. This could indicate faster framework, such as a more efficient audio graph traversal / audio data propagation. 10 | * The MixedBenchmark metric is a compound score using a handful of the most commonly used nodes. It can be used as an overall score for a given platform and browser. 11 | 12 |  13 | 14 | | TEST | Mac Chrome 79 | Mac Safari 13 | Mac Firefox 71 | 15 | |--------------------------------|---------------|---------------|----------------| 16 | | Baseline | 313 | 97 | 230 | 17 | | Biquad-default | 195 | 139 | 185 | 18 | | Biquad-440 | 204 | 134 | 184 | 19 | | AudioBufferSource-rate1 | 62 | 45 | 35 | 20 | | AudioBufferSource-rate0.9 | 229 | 204 | 193 | 21 | | Oscillator | 448 | 370 | 372 | 22 | | Gain-default | 42 | 21 | 21 | 23 | | Gain-1.0 | 66 | 20 | 22 | 24 | | Gain-0.9 | 66 | 24 | 23 | 25 | | Gain-0.9-k-rate | 59 | 22 | 21 | 26 | | GainCancel-1.0 | 66 | 21 | 22 | 27 | | GainCancel-0.9 | 66 | 23 | 22 | 28 | | GainCancel-0.9-k-rate | 60 | 22 | 21 | 29 | | GainAutomation-exp-a-rate | 108 | 111 | 830 | 30 | | GainAutomation-linear-a-rate | 63 | 113 | 362 | 31 | | GainAutomation-target-a-rate | 90 | 196 | 615 | 32 | | GainAutomation-curve-a-rate | 114 | 114 | 1029 | 33 | | GainAutomation-exp-k-rate | 99 | 117 | 834 | 34 | | GainAutomation-linear-k-rate | 76 | 122 | 363 | 35 | | GainAutomation-target-k-rate | 90 | 206 | 612 | 36 | | GainAutomation-curve-k-rate | 99 | 109 | 1029 | 37 | | BiquadAutomation-exp-a-rate | 1387 | 308 | 201 | 38 | | BiquadAutomation-linear-a-rate | 1347 | 283 | 193 | 39 | | BiquadAutomation-target-a-rate | 1382 | 340 | 201 | 40 | | BiquadAutomation-curve-a-rate | 1403 | 327 | 199 | 41 | | BiquadAutomation-exp-k-rate | 309 | 287 | 200 | 42 | | BiquadAutomation-linear-k-rate | 276 | 290 | 196 | 43 | | BiquadAutomation-target-k-rate | 296 | 292 | 199 | 44 | | BiquadAutomation-curve-k-rate | 313 | 286 | 198 | 45 | | Delay-default | 753 | 795 | 902 | 46 | | Delay-0.1 | 767 | 790 | 908 | 47 | | DelayAutomation-a-rate | 818 | 875 | 1128 | 48 | | DelayAutomation-k-rate | 768 | 930 | 1133 | 49 | | ChannelSplitter | 38 | 21 | 36 | 50 | | ChannelMerger | 44 | 19 | 182 | 51 | | Analyser | 33 | 17 | 420 | 52 | | WaveShaper-1x | 209 | 234 | 177 | 53 | | WaveShaper-2x | 902 | 962 | 865 | 54 | | WaveShaper-4x | 2203 | 2283 | 1590 | 55 | | Compressor-knee-0 | 4013 | 5737 | 5710 | 56 | | Compressor-knee-40 | 3383 | 4903 | 5047 | 57 | | Convolver-128f-3ms | 379 | 150 | 360 | 58 | | Convolver-1024f-23ms | 933 | 923 | 1340 | 59 | | Convolver-2048f-46ms | 1097 | 1093 | 1667 | 60 | | Convolver-32768f-743ms | 2088 | 2090 | 3478 | 61 | | Panner-equalpower | 285 | 221 | 122 | 62 | | Panner-HRTF | 2047 | 1920 | 2887 | 63 | | StereoPanner-default | 80 | - | 176 | 64 | | StereoPanner-0 | 92 | - | 174 | 65 | | StereoPanner-0.2 | 93 | - | 194 | 66 | | StereoPanner-1 | 94 | - | 192 | 67 | | MixedBenchmark | 2835 | 2010 | 2791 | 68 | 69 | ## Windows vs Mac Chrome 70 | 71 | * Mac: MacBook Pro 2017 (3,1 GHz Intel Core i7). 72 | * Windows: Intel Core i5-7300U 2.6Hgz 2.71 GHz. Test results were adjusted for clock speed difference (2.6 / 3.1). 73 | * Windows has 100% slower FFT performance. 74 | * Windows has 50% slower Biquad performance. 75 | 76 |  77 | 78 | | Test | Chrome 77 Win adjusted | Chrome 78 Mac | 79 | |--------------------------------|------------------------|---------------| 80 | | Baseline | 313 | 317 | 81 | | Biquad-default | 321 | 190 | 82 | | Biquad-440 | 335 | 211 | 83 | | AudioBufferSource-rate1 | 78 | 61 | 84 | | AudioBufferSource-rate0.9 | 231 | 229 | 85 | | Oscillator | 414 | 437 | 86 | | Gain-default | 45 | 42 | 87 | | Gain-1.0 | 72 | 65 | 88 | | Gain-0.9 | 70 | 69 | 89 | | Gain-0.9-k-rate | 66 | 59 | 90 | | GainCancel-1.0 | 74 | 66 | 91 | | GainCancel-0.9 | 71 | 69 | 92 | | GainCancel-0.9-k-rate | 122 | 60 | 93 | | GainAutomation-exp-a-rate | 122 | 107 | 94 | | GainAutomation-linear-a-rate | 84 | 60 | 95 | | GainAutomation-target-a-rate | 100 | 89 | 96 | | GainAutomation-curve-a-rate | 127 | 109 | 97 | | GainAutomation-exp-k-rate | 122 | 98 | 98 | | GainAutomation-linear-k-rate | 94 | 73 | 99 | | GainAutomation-target-k-rate | 108 | 89 | 100 | | GainAutomation-curve-k-rate | 126 | 98 | 101 | | BiquadAutomation-exp-a-rate | 1494 | 1372 | 102 | | BiquadAutomation-linear-a-rate | 1344 | 1380 | 103 | | BiquadAutomation-target-a-rate | 1375 | 1354 | 104 | | BiquadAutomation-curve-a-rate | 1406 | 1361 | 105 | | BiquadAutomation-exp-k-rate | 502 | 410 | 106 | | BiquadAutomation-linear-k-rate | 453 | 432 | 107 | | BiquadAutomation-target-k-rate | 460 | 414 | 108 | | BiquadAutomation-curve-k-rate | 493 | 401 | 109 | | Delay-default | 720 | 738 | 110 | | Delay-0.1 | 752 | 763 | 111 | | DelayAutomation-a-rate | 899 | 820 | 112 | | DelayAutomation-k-rate | 776 | 750 | 113 | | ChannelSplitter | 51 | 37 | 114 | | ChannelMerger | 60 | 43 | 115 | | Analyser | 51 | 32 | 116 | | WaveShaper-1x | 481 | 208 | 117 | | WaveShaper-2x | 2073 | 897 | 118 | | WaveShaper-4x | 4470 | 2193 | 119 | | Compressor-knee-0 | 4476 | 3993 | 120 | | Compressor-knee-40 | 3928 | 3393 | 121 | | Convolver-128f-3ms | 790 | 392 | 122 | | Convolver-1024f-23ms | 1781 | 943 | 123 | | Convolver-2048f-46ms | 2119 | 1137 | 124 | | Convolver-32768f-743ms | 3897 | 2089 | 125 | | Panner-equalpower | 325 | 285 | 126 | | Panner-HRTF | 2376 | 2027 | 127 | | StereoPanner-default | 105 | 79 | 128 | | StereoPanner-0 | 124 | 91 | 129 | | StereoPanner-0.2 | 124 | 94 | 130 | | StereoPanner-1 | 124 | 91 | 131 | | MixedBenchmark | 3752 | 2542 | 132 | 133 | ## Windows 134 | 135 | * Windows: Intel Core i5-7300U 2.6Hgz 2.71 GHz. 136 | * A lot of differences due to completely different implementations. 137 | 138 |  139 | 140 | 141 | | Test | Chrome 77 Win | Firefox 69 Win | 142 | |--------------------------------|---------------|----------------| 143 | | Baseline | 373 | 273 | 144 | | Biquad-default | 383 | 237 | 145 | | Biquad-440 | 400 | 227 | 146 | | AudioBufferSource-rate1 | 93 | 54 | 147 | | AudioBufferSource-rate0.9 | 276 | 307 | 148 | | Oscillator | 494 | 660 | 149 | | Gain-default | 54 | 35 | 150 | | Gain-1.0 | 86 | 29 | 151 | | Gain-0.9 | 84 | 29 | 152 | | Gain-0.9-k-rate | 79 | 29 | 153 | | GainCancel-1.0 | 88 | 32 | 154 | | GainCancel-0.9 | 85 | 31 | 155 | | GainCancel-0.9-k-rate | 145 | 30 | 156 | | GainAutomation-exp-a-rate | 146 | 1183 | 157 | | GainAutomation-linear-a-rate | 100 | 321 | 158 | | GainAutomation-target-a-rate | 119 | 675 | 159 | | GainAutomation-curve-a-rate | 151 | 725 | 160 | | GainAutomation-exp-k-rate | 146 | 1177 | 161 | | GainAutomation-linear-k-rate | 112 | 316 | 162 | | GainAutomation-target-k-rate | 129 | 680 | 163 | | GainAutomation-curve-k-rate | 150 | 698 | 164 | | BiquadAutomation-exp-a-rate | 1781 | 247 | 165 | | BiquadAutomation-linear-a-rate | 1602 | 249 | 166 | | BiquadAutomation-target-a-rate | 1639 | 243 | 167 | | BiquadAutomation-curve-a-rate | 1676 | 253 | 168 | | BiquadAutomation-exp-k-rate | 598 | 246 | 169 | | BiquadAutomation-linear-k-rate | 540 | 234 | 170 | | BiquadAutomation-target-k-rate | 549 | 239 | 171 | | BiquadAutomation-curve-k-rate | 588 | 239 | 172 | | Delay-default | 858 | 1170 | 173 | | Delay-0.1 | 897 | 1173 | 174 | | DelayAutomation-a-rate | 1072 | 1382 | 175 | | DelayAutomation-k-rate | 925 | 1370 | 176 | | ChannelSplitter | 61 | 62 | 177 | | ChannelMerger | 72 | 243 | 178 | | Analyser | 61 | 398 | 179 | | WaveShaper-1x | 573 | 203 | 180 | | WaveShaper-2x | 2472 | 1232 | 181 | | WaveShaper-4x | 5330 | 2197 | 182 | | Compressor-knee-0 | 5337 | 6317 | 183 | | Compressor-knee-40 | 4683 | 5720 | 184 | | Convolver-128f-3ms | 942 | 464 | 185 | | Convolver-1024f-23ms | 2123 | 1593 | 186 | | Convolver-2048f-46ms | 2527 | 2027 | 187 | | Convolver-32768f-743ms | 4647 | 4290 | 188 | | Panner-equalpower | 387 | 161 | 189 | | Panner-HRTF | 2833 | 4020 | 190 | | StereoPanner-default | 125 | 221 | 191 | | StereoPanner-0 | 148 | 222 | 192 | | StereoPanner-0.2 | 148 | 245 | 193 | | StereoPanner-1 | 148 | 246 | 194 | | MixedBenchmark | 4474 | 3533 | 195 | 196 | ## Chrome OS 197 | 198 | * Dell Chromebook 11 P22T (3120) Intel Celeron N2840 2.16 GHz (candy) 199 | * Lenovo N23 Yoga Chromebook ARM Cortex A53 (ARMv8) (hana) 200 | * This compares Intel vs ARM performance, however on two machines of unequal strength. 201 | * The Lenovo is faster on everything, except FFT, where it is 20% slower. 202 | 203 |  204 | 205 | | TEST | Dell Chromebook 11 Chrome 77 | Lenovo N23 Yoga Chrome 77 | 206 | |--------------------------------|------------------------------|---------------------------| 207 | | Baseline | 1070 | 1000 | 208 | | Biquad-default | 1022 | 723 | 209 | | Biquad-440 | 1086 | 751 | 210 | | AudioBufferSource-rate1 | 357 | 337 | 211 | | AudioBufferSource-rate0.9 | 1113 | 926 | 212 | | Oscillator | 1777 | 1208 | 213 | | Gain-default | 182 | 158 | 214 | | Gain-1.0 | 288 | 241 | 215 | | Gain-0.9 | 307 | 246 | 216 | | Gain-0.9-k-rate | 270 | 210 | 217 | | GainCancel-1.0 | 295 | 242 | 218 | | GainCancel-0.9 | 308 | 245 | 219 | | GainCancel-0.9-k-rate | 272 | 205 | 220 | | GainAutomation-exp-a-rate | 499 | 439 | 221 | | GainAutomation-linear-a-rate | 330 | 560 | 222 | | GainAutomation-target-a-rate | 433 | 488 | 223 | | GainAutomation-curve-a-rate | 806 | 736 | 224 | | GainAutomation-exp-k-rate | 559 | 422 | 225 | | GainAutomation-linear-k-rate | 375 | 280 | 226 | | GainAutomation-target-k-rate | 464 | 347 | 227 | | GainAutomation-curve-k-rate | 476 | 397 | 228 | | BiquadAutomation-exp-a-rate | 11604 | 6557 | 229 | | BiquadAutomation-linear-a-rate | 11367 | 6656 | 230 | | BiquadAutomation-target-a-rate | 11511 | 6557 | 231 | | BiquadAutomation-curve-a-rate | 11948 | 6838 | 232 | | BiquadAutomation-exp-k-rate | 2162 | 1402 | 233 | | BiquadAutomation-linear-k-rate | 1901 | 1203 | 234 | | BiquadAutomation-target-k-rate | 2058 | 1356 | 235 | | BiquadAutomation-curve-k-rate | 2061 | 1388 | 236 | | Delay-default | 1963 | 843 | 237 | | Delay-0.1 | 2000 | 898 | 238 | | DelayAutomation-a-rate | 2978 | 1255 | 239 | | DelayAutomation-k-rate | 2037 | 878 | 240 | | ChannelSplitter | 191 | 157 | 241 | | ChannelMerger | 262 | 205 | 242 | | Analyser | 189 | 196 | 243 | | WaveShaper-1x | 972 | 587 | 244 | | WaveShaper-2x | 6782 | 10713 | 245 | | WaveShaper-4x | 16840 | 18940 | 246 | | Compressor-knee-0 | 18133 | 14200 | 247 | | Compressor-knee-40 | 16003 | 12500 | 248 | | Convolver-128f-3ms | 3483 | 5366 | 249 | | Convolver-1024f-23ms | 8857 | 10480 | 250 | | Convolver-2048f-46ms | 10867 | 12433 | 251 | | Convolver-32768f-743ms | 21920 | 26142 | 252 | | Panner-equalpower | 1431 | 1181 | 253 | | Panner-HRTF | 10997 | 7117 | 254 | | StereoPanner-default | 505 | 359 | 255 | | StereoPanner-0 | 584 | 402 | 256 | | StereoPanner-0.2 | 573 | 413 | 257 | | StereoPanner-1 | 792 | 624 | 258 | | MixedBenchmark | 17374 | 13201 | 259 | -------------------------------------------------------------------------------- /doc/chrome_os_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spotify/web-audio-bench/77a6f80e43044481a9adbf40288b56a7473d38ed/doc/chrome_os_graph.png -------------------------------------------------------------------------------- /doc/mac_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spotify/web-audio-bench/77a6f80e43044481a9adbf40288b56a7473d38ed/doc/mac_graph.png -------------------------------------------------------------------------------- /doc/win_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spotify/web-audio-bench/77a6f80e43044481a9adbf40288b56a7473d38ed/doc/win_graph.png -------------------------------------------------------------------------------- /doc/win_mac_chrome_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spotify/web-audio-bench/77a6f80e43044481a9adbf40288b56a7473d38ed/doc/win_mac_chrome_graph.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 |This page contains a series of web audio benchmark tests. The tests are run in an OfflineAudioContext, where an AudioBufferSourceNode is used as baseline to feed data into the test. 22 | To get more accurate results, each test is run multiple times and the min duration is chosen (here's why). The results are given in microseconds per second of processed audio data and node, so lower is 23 | faster. A value of 1000000 means realtime processing speed.
24 | 25 |For accurate results:
26 | 27 |TEST | 61 |μs | 62 |MIN | 63 |Q1 | 64 |MEDIAN | 65 |Q3 | 66 |MAX | 67 |MEAN | 68 |STDDEV | 69 |
---|