├── .gitignore ├── LICENSE ├── README.md ├── pom.xml └── src └── main └── java ├── encyrption └── MemoryAccessMain.java ├── javatest └── InstanceOfMain.java ├── lambda ├── LambdaSerialization.java ├── README.md └── Results.txt └── utf8 ├── AllMain.java ├── DecodeMain.java ├── EncodeMain.java └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | *.iml 3 | *.class 4 | 5 | # Mobile Tools for Java (J2ME) 6 | .mtj.tmp/ 7 | 8 | # Package Files # 9 | *.jar 10 | *.war 11 | *.ear 12 | 13 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 14 | hs_err_pid* 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jvm-micro-benchmarks 2 | Microbenchmarks for JVM code. 3 | 4 | Some benchmarks use JMH for latency test. 5 | 6 | # Co-ordinated omission 7 | Some benchmarks are hand written to compensate for co-ordinated ommission. 8 | Co-ordinated ommission can result in dramatically under rating poor latencies. 9 | The difference can be that your 99.999% latency with co-ordniated omission is actually you 90% latency. 10 | Correcting for co-ordinated omission can help how why you have problems in real systems. 11 | 12 | The way we correct for co-ordinated omission is to not time the latency from when we start the test, 13 | but instead we time from when the tests *should have started*. To have a view on this, we have to have a 14 | throughput we are testing for. One way of doing this is to tst at regular intervals, however this can 15 | give overly optimisitic figures as well. To produce more robust figures we randomise the time between 16 | tests so that we have an average interval which achieves the desired throughput. 17 | ```java 18 | int rate = ... ; // the rate being tested. 19 | long next = System.nanoTime(); 20 | int interval = (int) (1e9 / rate); 21 | Random rand = new Random(); 22 | for (int t = 0; t < tests; t++) { 23 | next += rand.nextInt(2 * interval); // avg = interval. 24 | while(System.nanoTime() < next) { 25 | // busy wait 26 | } 27 | 28 | performTest(i); 29 | 30 | times[i] = System.nanoTime() - next; 31 | } 32 | ``` -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 31 | 32 | 34 | 4.0.0 35 | 36 | net.openhft 37 | jvm-micro-benchmarks 38 | 1.0 39 | jar 40 | 41 | JMH benchmark sample: Java 42 | 43 | 47 | 48 | 49 | 3.0 50 | 51 | 52 | 53 | 54 | net.openhft 55 | chronicle-bom 56 | 1.7.11-SNAPSHOT 57 | pom 58 | import 59 | 60 | 61 | 62 | 63 | 64 | 65 | net.openhft 66 | chronicle-wire 67 | 68 | 69 | 70 | org.slf4j 71 | slf4j-simple 72 | 1.7.12 73 | 74 | 75 | 76 | org.openjdk.jmh 77 | jmh-core 78 | ${jmh.version} 79 | 80 | 81 | org.openjdk.jmh 82 | jmh-generator-annprocess 83 | ${jmh.version} 84 | provided 85 | 86 | 87 | 88 | 89 | UTF-8 90 | 1.10.3 91 | 1.8 92 | benchmarks 93 | 94 | 95 | 96 | 97 | 98 | org.apache.maven.plugins 99 | maven-compiler-plugin 100 | 3.1 101 | 102 | ${javac.target} 103 | ${javac.target} 104 | ${javac.target} 105 | 106 | 107 | 108 | org.apache.maven.plugins 109 | maven-shade-plugin 110 | 2.2 111 | 112 | 113 | package 114 | 115 | shade 116 | 117 | 118 | ${uberjar.name} 119 | 120 | 122 | org.openjdk.jmh.Main 123 | 124 | 125 | 126 | 127 | 131 | *:* 132 | 133 | META-INF/*.SF 134 | META-INF/*.DSA 135 | META-INF/*.RSA 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | maven-clean-plugin 148 | 2.5 149 | 150 | 151 | maven-deploy-plugin 152 | 2.8.1 153 | 154 | 155 | maven-install-plugin 156 | 2.5.1 157 | 158 | 159 | maven-jar-plugin 160 | 2.4 161 | 162 | 163 | maven-javadoc-plugin 164 | 2.9.1 165 | 166 | 167 | maven-resources-plugin 168 | 2.6 169 | 170 | 171 | maven-site-plugin 172 | 3.3 173 | 174 | 175 | maven-source-plugin 176 | 2.2.1 177 | 178 | 179 | maven-surefire-plugin 180 | 2.17 181 | 182 | 183 | 184 | 185 | 186 | 187 | -------------------------------------------------------------------------------- /src/main/java/encyrption/MemoryAccessMain.java: -------------------------------------------------------------------------------- 1 | package encyrption; 2 | 3 | import org.openjdk.jmh.annotations.Benchmark; 4 | import org.openjdk.jmh.runner.Runner; 5 | import org.openjdk.jmh.runner.RunnerException; 6 | import org.openjdk.jmh.runner.options.Options; 7 | import org.openjdk.jmh.runner.options.OptionsBuilder; 8 | import sun.misc.Unsafe; 9 | 10 | import java.lang.reflect.Field; 11 | import java.nio.ByteBuffer; 12 | import java.nio.charset.Charset; 13 | 14 | /** 15 | * This benchmark looks at the relative cost of different operations when use with memory access scan. 16 | */ 17 | public class MemoryAccessMain { 18 | public static final int ARRAY_BYTE_BASE_OFFSET; 19 | public static final int ARRAY_INT_BASE_OFFSET; 20 | static final String text = "0123456789" + 21 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + 22 | "abcdefghijklmnopqrstuvwxyz-_" + 23 | "0123456789" + 24 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + 25 | "abcdefghijklmnopqrstuvwxyz-_"; 26 | static final Unsafe UNSAFE; 27 | static final int ARRAY_LONG_BASE_OFFSET; 28 | private static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1"); 29 | static byte[] byteArray = text.getBytes(ISO_8859_1); 30 | static int[] intArray = new int[byteArray.length / 4]; 31 | static int[] longArray = new int[byteArray.length / 8]; 32 | static ByteBuffer bb = ByteBuffer.allocateDirect(text.length()); 33 | 34 | static { 35 | try { 36 | Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe"); 37 | theUnsafe.setAccessible(true); 38 | UNSAFE = (Unsafe) theUnsafe.get(null); 39 | ARRAY_BYTE_BASE_OFFSET = UNSAFE.arrayBaseOffset(byte[].class); 40 | ARRAY_INT_BASE_OFFSET = UNSAFE.arrayBaseOffset(int[].class); 41 | ARRAY_LONG_BASE_OFFSET = UNSAFE.arrayBaseOffset(long[].class); 42 | 43 | UNSAFE.copyMemory(byteArray, ARRAY_BYTE_BASE_OFFSET, intArray, ARRAY_INT_BASE_OFFSET, byteArray.length); 44 | ; 45 | UNSAFE.copyMemory(byteArray, ARRAY_BYTE_BASE_OFFSET, longArray, ARRAY_LONG_BASE_OFFSET, byteArray.length); 46 | for (int i = 0; i < text.length(); i++) 47 | bb.put((byte) text.charAt(i)); 48 | } catch (Exception e) { 49 | throw new AssertionError(e); 50 | } 51 | } 52 | 53 | static long address(ByteBuffer bb) { 54 | return ((sun.nio.ch.DirectBuffer) bb).address(); 55 | } 56 | 57 | public static void main(String[] args) throws RunnerException { 58 | Options opt = new OptionsBuilder() 59 | .include(MemoryAccessMain.class.getSimpleName()) 60 | .forks(9) 61 | .build(); 62 | 63 | new Runner(opt).run(); 64 | } 65 | 66 | @Benchmark 67 | public long checkSumWithCopyByByte() { 68 | UNSAFE.copyMemory(null, address(bb), byteArray, ARRAY_BYTE_BASE_OFFSET, byteArray.length); 69 | long sum = 0; 70 | for (byte b : byteArray) 71 | sum += b; 72 | return sum; 73 | } 74 | 75 | @Benchmark 76 | public long checkSumWithCopyByInt() { 77 | UNSAFE.copyMemory(null, address(bb), intArray, ARRAY_INT_BASE_OFFSET, intArray.length * 4); 78 | long sum = 0; 79 | for (int b : intArray) 80 | sum += b; 81 | return sum; 82 | } 83 | 84 | @Benchmark 85 | public long checkSumWithCopyByLong() { 86 | UNSAFE.copyMemory(null, address(bb), longArray, ARRAY_LONG_BASE_OFFSET, longArray.length * 8); 87 | long sum = 0; 88 | for (long l : longArray) 89 | sum += l; 90 | return sum; 91 | } 92 | 93 | @Benchmark 94 | public long checkSumByteBufferByByte() { 95 | long sum = 0; 96 | int len = bb.capacity(); 97 | for (int i = 0; i < len; i++) 98 | sum += bb.get(i); 99 | return sum; 100 | } 101 | 102 | @Benchmark 103 | public long checkSumByteBufferByInt() { 104 | long sum = 0; 105 | int len = bb.capacity(); 106 | for (int i = 0; i < len; i += 4) 107 | sum += bb.getInt(i); 108 | return sum; 109 | } 110 | 111 | @Benchmark 112 | public long checkSumByteBufferByLong() { 113 | long sum = 0; 114 | int len = bb.capacity(); 115 | for (int i = 0; i < len; i += 8) 116 | sum += bb.getLong(i); 117 | return sum; 118 | } 119 | 120 | @Benchmark 121 | public long checkSumNativeMemoryByByte() { 122 | long sum = 0; 123 | long address = address(bb); 124 | int len = bb.capacity(); 125 | for (int i = 0; i < len; i++) 126 | sum += UNSAFE.getByte(address + i); 127 | return sum; 128 | } 129 | 130 | @Benchmark 131 | public long checkSumNativeMemoryByInt() { 132 | long sum = 0; 133 | long address = address(bb); 134 | int len = bb.capacity(); 135 | for (int i = 0; i < len; i += 4) 136 | sum += UNSAFE.getInt(address + i); 137 | return sum; 138 | } 139 | 140 | @Benchmark 141 | public long checkSumNativeMemoryByLong() { 142 | long sum = 0; 143 | long address = address(bb); 144 | int len = bb.capacity(); 145 | for (int i = 0; i < len; i += 8) 146 | sum += UNSAFE.getLong(address + i); 147 | return sum; 148 | } 149 | 150 | } 151 | 152 | /* 153 | Java 6 update 45 154 | 155 | MemoryAccessMain.checkSumByteBufferByByte thrpt 180 15765664.870 ± 45281.627 ops/s 156 | MemoryAccessMain.checkSumByteBufferByInt thrpt 180 12623510.616 ± 16533.129 ops/s 157 | MemoryAccessMain.checkSumByteBufferByLong thrpt 180 12073116.876 ± 39165.995 ops/s 158 | MemoryAccessMain.checkSumNativeMemoryByByte thrpt 180 17155297.294 ± 21487.254 ops/s 159 | MemoryAccessMain.checkSumNativeMemoryByInt thrpt 180 44490609.186 ± 78431.971 ops/s 160 | MemoryAccessMain.checkSumNativeMemoryByLong thrpt 180 66721501.649 ± 99363.707 ops/s 161 | MemoryAccessMain.checkSumWithCopyByByte thrpt 180 20867969.278 ± 265946.406 ops/s 162 | MemoryAccessMain.checkSumWithCopyByInt thrpt 180 46016224.415 ± 569515.894 ops/s 163 | MemoryAccessMain.checkSumWithCopyByLong thrpt 180 60932722.843 ± 115947.869 ops/s 164 | */ 165 | 166 | /* 167 | Java 7 update 79 168 | Benchmark Mode Cnt Score Error Units 169 | MemoryAccessMain.checkSumByteBufferByByte thrpt 180 16918577.630 ± 51245.822 ops/s 170 | MemoryAccessMain.checkSumByteBufferByInt thrpt 180 36167662.991 ± 139725.872 ops/s 171 | MemoryAccessMain.checkSumByteBufferByLong thrpt 180 56660167.208 ± 276707.368 ops/s 172 | MemoryAccessMain.checkSumNativeMemoryByByte thrpt 180 17523037.640 ± 183608.284 ops/s 173 | MemoryAccessMain.checkSumNativeMemoryByInt thrpt 180 52735133.453 ± 397806.177 ops/s 174 | MemoryAccessMain.checkSumNativeMemoryByLong thrpt 180 83016876.842 ± 830511.972 ops/s 175 | MemoryAccessMain.checkSumWithCopyByByte thrpt 180 21979723.170 ± 52855.668 ops/s 176 | MemoryAccessMain.checkSumWithCopyByInt thrpt 180 49464500.478 ± 156216.776 ops/s 177 | MemoryAccessMain.checkSumWithCopyByLong thrpt 180 61204197.542 ± 882471.209 ops/s 178 | */ 179 | 180 | /* 181 | Java 8 update 51 182 | 183 | Benchmark Mode Cnt Score Error Units 184 | MemoryAccessMain.checkSumByteBufferByByte thrpt 180 16370833.979 ± 107792.167 ops/s 185 | MemoryAccessMain.checkSumByteBufferByInt thrpt 180 35119418.564 ± 588643.940 ops/s 186 | MemoryAccessMain.checkSumByteBufferByLong thrpt 180 53270687.238 ± 1159158.958 ops/s 187 | MemoryAccessMain.checkSumNativeMemoryByByte thrpt 180 16883728.154 ± 368126.958 ops/s 188 | MemoryAccessMain.checkSumNativeMemoryByInt thrpt 180 54721757.958 ± 528531.287 ops/s 189 | MemoryAccessMain.checkSumNativeMemoryByLong thrpt 180 94902919.608 ± 2540250.454 ops/s 190 | MemoryAccessMain.checkSumWithCopyByByte thrpt 180 21851803.842 ± 63869.431 ops/s 191 | MemoryAccessMain.checkSumWithCopyByInt thrpt 180 56224050.537 ± 572306.198 ops/s 192 | MemoryAccessMain.checkSumWithCopyByLong thrpt 180 70043182.790 ± 300654.953 ops/s 193 | */ 194 | -------------------------------------------------------------------------------- /src/main/java/javatest/InstanceOfMain.java: -------------------------------------------------------------------------------- 1 | package javatest; 2 | 3 | import org.openjdk.jmh.annotations.Benchmark; 4 | import org.openjdk.jmh.runner.Runner; 5 | import org.openjdk.jmh.runner.RunnerException; 6 | import org.openjdk.jmh.runner.options.Options; 7 | import org.openjdk.jmh.runner.options.OptionsBuilder; 8 | 9 | /** 10 | * This benchmark looks at the relative cost of different operations when use with memory access scan. 11 | */ 12 | /* performing 4 instanceof taking 2.2 ns each. 13 | Benchmark Mode Cnt Score Error Units 14 | InstanceOfMain.instanceOf thrpt 20 113904463.916 � 6213493.515 ops/s 15 | */ 16 | public class InstanceOfMain { 17 | static Object[] o = {(byte) 1, 1, 1.0, 1.0f}; 18 | 19 | public static void main(String[] args) throws RunnerException { 20 | Options opt = new OptionsBuilder() 21 | .include(InstanceOfMain.class.getSimpleName()) 22 | .forks(1) 23 | .build(); 24 | 25 | new Runner(opt).run(); 26 | } 27 | 28 | @Benchmark 29 | public boolean instanceOf() { 30 | boolean allNum = true; 31 | for (Object v : o) { 32 | allNum &= v instanceof Number; 33 | } 34 | return allNum; 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/java/lambda/LambdaSerialization.java: -------------------------------------------------------------------------------- 1 | package lambda; 2 | 3 | import net.openhft.chronicle.bytes.Bytes; 4 | import net.openhft.chronicle.core.Jvm; 5 | import net.openhft.chronicle.core.pool.ClassAliasPool; 6 | import net.openhft.chronicle.core.util.SerializableFunction; 7 | import net.openhft.chronicle.wire.BinaryWire; 8 | import net.openhft.chronicle.wire.TextWire; 9 | import net.openhft.chronicle.wire.Wire; 10 | import org.openjdk.jmh.annotations.Benchmark; 11 | import org.openjdk.jmh.annotations.Mode; 12 | import org.openjdk.jmh.annotations.Scope; 13 | import org.openjdk.jmh.annotations.State; 14 | import org.openjdk.jmh.runner.Runner; 15 | import org.openjdk.jmh.runner.RunnerException; 16 | import org.openjdk.jmh.runner.options.Options; 17 | import org.openjdk.jmh.runner.options.OptionsBuilder; 18 | import org.openjdk.jmh.runner.options.TimeValue; 19 | 20 | import java.io.*; 21 | import java.lang.reflect.InvocationTargetException; 22 | import java.lang.reflect.Method; 23 | import java.util.concurrent.TimeUnit; 24 | import java.util.function.Function; 25 | 26 | /** 27 | * Created by peter on 29/08/15. 28 | */ 29 | @State(Scope.Thread) 30 | public class LambdaSerialization { 31 | static { 32 | ClassAliasPool.CLASS_ALIASES.addAlias(Functions.class); 33 | } 34 | 35 | final Bytes bytes = Bytes.allocateElasticDirect(); 36 | final Wire wire = new BinaryWire(bytes); 37 | final Bytes tbytes = Bytes.allocateElasticDirect(); 38 | final TextWire twire = new TextWire(tbytes); 39 | byte[] byteArr = null; 40 | 41 | // run with -Xm1g 42 | public static void main(String[] args) throws RunnerException, InvocationTargetException, IllegalAccessException { 43 | if (Jvm.isDebug()) { 44 | LambdaSerialization main = new LambdaSerialization(); 45 | for (Method m : LambdaSerialization.class.getMethods()) { 46 | if (m.getAnnotation(Benchmark.class) != null) { 47 | // for (int i = 0; i < 1; i++) { 48 | main.byteArr = null; 49 | main.bytes.clear(); 50 | main.tbytes.clear(); 51 | System.out.println("Running " + m.getName()); 52 | Object ret = m.invoke(main); 53 | if (!"Hello*".equals(ret)) { 54 | throw new AssertionError(m + " returned " + ret); 55 | } 56 | // } 57 | System.out.println("```"); 58 | if (main.byteArr != null) { 59 | main.tbytes.readPosition(0); 60 | System.out.print(Bytes.wrapForRead(main.byteArr).toHexString()); 61 | } 62 | if (main.bytes.writePosition() > 0) { 63 | main.bytes.readPosition(0); 64 | System.out.print(main.bytes.toHexString()); 65 | } 66 | if (main.tbytes.writePosition() > 0) { 67 | main.tbytes.readPosition(0); 68 | System.out.print(main.tbytes.toString()); 69 | } 70 | System.out.println("```"); 71 | } 72 | } 73 | } else { 74 | int time = Boolean.getBoolean("longTest") ? 30 : 2; 75 | System.out.println("measurementTime: " + time + " secs"); 76 | Options opt = new OptionsBuilder() 77 | .include(LambdaSerialization.class.getSimpleName()) 78 | .warmupIterations(5) 79 | .measurementIterations(5) 80 | .forks(5) 81 | .mode(Mode.SampleTime) 82 | .measurementTime(TimeValue.seconds(time)) 83 | .timeUnit(TimeUnit.NANOSECONDS) 84 | .build(); 85 | 86 | new Runner(opt).run(); 87 | } 88 | } 89 | 90 | @Benchmark 91 | public String javaSerialization() throws IOException, ClassNotFoundException { 92 | SerializableFunction appendStar = s -> s + "*"; 93 | 94 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); 95 | ObjectOutputStream oos = new ObjectOutputStream(baos); 96 | oos.writeObject(appendStar); 97 | oos.close(); 98 | 99 | ByteArrayInputStream bais = new ByteArrayInputStream(byteArr = baos.toByteArray()); 100 | ObjectInputStream ois = new ObjectInputStream(bais); 101 | Function fun = (Function) ois.readObject(); 102 | return fun.apply("Hello"); 103 | } 104 | 105 | @Benchmark 106 | public String javaSerializationCapturing() throws IOException, ClassNotFoundException { 107 | String star = "*"; 108 | SerializableFunction appendStar = s -> s + star; 109 | 110 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); 111 | ObjectOutputStream oos = new ObjectOutputStream(baos); 112 | oos.writeObject(appendStar); 113 | oos.close(); 114 | 115 | ByteArrayInputStream bais = new ByteArrayInputStream(byteArr = baos.toByteArray()); 116 | ObjectInputStream ois = new ObjectInputStream(bais); 117 | Function fun = (Function) ois.readObject(); 118 | return fun.apply("Hello"); 119 | } 120 | 121 | @Benchmark 122 | public String javaSerializationWithEnum() throws IOException, ClassNotFoundException { 123 | SerializableFunction appendStar = Functions.APPEND_STAR; 124 | 125 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); 126 | ObjectOutputStream oos = new ObjectOutputStream(baos); 127 | oos.writeObject(appendStar); 128 | oos.close(); 129 | 130 | ByteArrayInputStream bais = new ByteArrayInputStream(byteArr = baos.toByteArray()); 131 | ObjectInputStream ois = new ObjectInputStream(bais); 132 | Function fun = (Function) ois.readObject(); 133 | return fun.apply("Hello"); 134 | } 135 | 136 | @Benchmark 137 | public String wireSerialization() throws IOException, ClassNotFoundException { 138 | SerializableFunction appendStar = s -> s + "*"; 139 | 140 | bytes.clear(); 141 | wire.write().object(appendStar); 142 | 143 | Function fun = (Function) wire.read().object(Object.class); 144 | return fun.apply("Hello"); 145 | } 146 | 147 | @Benchmark 148 | public String wireSerializationCapturing() throws IOException, ClassNotFoundException { 149 | String star = "*"; 150 | SerializableFunction appendStar = s -> s + star; 151 | 152 | bytes.clear(); 153 | wire.write().object(appendStar); 154 | 155 | Function fun = (Function) wire.read().object(Object.class); 156 | return fun.apply("Hello"); 157 | } 158 | 159 | @Benchmark 160 | public String wireSerializationWithEnum() throws IOException, ClassNotFoundException { 161 | SerializableFunction appendStar = Functions.APPEND_STAR; 162 | 163 | bytes.clear(); 164 | wire.write().object(appendStar); 165 | 166 | Function fun = (Function) wire.read().object(Object.class); 167 | return fun.apply("Hello"); 168 | } 169 | 170 | @Benchmark 171 | public String textWireSerialization() throws IOException, ClassNotFoundException { 172 | SerializableFunction appendStar = s -> s + "*"; 173 | 174 | tbytes.clear(); 175 | twire.getValueOut().object(appendStar); 176 | 177 | Function fun = (Function) twire.getValueIn().object(Object.class); 178 | return fun.apply("Hello"); 179 | } 180 | 181 | @Benchmark 182 | public String textWireSerializationCapturing() throws IOException, ClassNotFoundException { 183 | String star = "*"; 184 | SerializableFunction appendStar = s -> s + star; 185 | 186 | tbytes.clear(); 187 | twire.getValueOut().object(appendStar); 188 | 189 | Function fun = (Function) twire.getValueIn().object(Object.class); 190 | return fun.apply("Hello"); 191 | } 192 | 193 | @Benchmark 194 | public String textWireSerializationWithEnum() throws IOException, ClassNotFoundException { 195 | SerializableFunction appendStar = Functions.APPEND_STAR; 196 | 197 | tbytes.clear(); 198 | twire.getValueOut().object(appendStar); 199 | 200 | Function fun = (Function) twire.getValueIn().object(Object.class); 201 | return fun.apply("Hello"); 202 | } 203 | 204 | enum Functions implements SerializableFunction { 205 | APPEND_STAR { 206 | @Override 207 | public String apply(String s) { 208 | return s + '*'; 209 | } 210 | } 211 | } 212 | } 213 | -------------------------------------------------------------------------------- /src/main/java/lambda/README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | This test looks at different ways to serialize and deserialize using functions. 3 | 4 | ## Serialized form 5 | Running javaSerialization 6 | ``` 7 | 00000000 AC ED 00 05 73 72 00 21 6A 61 76 61 2E 6C 61 6E ····sr·! java.lan 8 | 00000010 67 2E 69 6E 76 6F 6B 65 2E 53 65 72 69 61 6C 69 g.invoke .Seriali 9 | 00000020 7A 65 64 4C 61 6D 62 64 61 6F 61 D0 94 2C 29 36 zedLambd aoa··,)6 10 | 00000030 85 02 00 0A 49 00 0E 69 6D 70 6C 4D 65 74 68 6F ····I··i mplMetho 11 | 00000040 64 4B 69 6E 64 5B 00 0C 63 61 70 74 75 72 65 64 dKind[·· captured 12 | 00000050 41 72 67 73 74 00 13 5B 4C 6A 61 76 61 2F 6C 61 Argst··[ Ljava/la 13 | 00000060 6E 67 2F 4F 62 6A 65 63 74 3B 4C 00 0E 63 61 70 ng/Objec t;L··cap 14 | 00000070 74 75 72 69 6E 67 43 6C 61 73 73 74 00 11 4C 6A turingCl asst··Lj 15 | 00000080 61 76 61 2F 6C 61 6E 67 2F 43 6C 61 73 73 3B 4C ava/lang /Class;L 16 | 00000090 00 18 66 75 6E 63 74 69 6F 6E 61 6C 49 6E 74 65 ··functi onalInte 17 | 000000a0 72 66 61 63 65 43 6C 61 73 73 74 00 12 4C 6A 61 rfaceCla sst··Lja 18 | 000000b0 76 61 2F 6C 61 6E 67 2F 53 74 72 69 6E 67 3B 4C va/lang/ String;L 19 | 000000c0 00 1D 66 75 6E 63 74 69 6F 6E 61 6C 49 6E 74 65 ··functi onalInte 20 | 000000d0 72 66 61 63 65 4D 65 74 68 6F 64 4E 61 6D 65 71 rfaceMet hodNameq 21 | 000000e0 00 7E 00 03 4C 00 22 66 75 6E 63 74 69 6F 6E 61 ·~··L·"f unctiona 22 | 000000f0 6C 49 6E 74 65 72 66 61 63 65 4D 65 74 68 6F 64 lInterfa ceMethod 23 | 00000100 53 69 67 6E 61 74 75 72 65 71 00 7E 00 03 4C 00 Signatur eq·~··L· 24 | 00000110 09 69 6D 70 6C 43 6C 61 73 73 71 00 7E 00 03 4C ·implCla ssq·~··L 25 | 00000120 00 0E 69 6D 70 6C 4D 65 74 68 6F 64 4E 61 6D 65 ··implMe thodName 26 | 00000130 71 00 7E 00 03 4C 00 13 69 6D 70 6C 4D 65 74 68 q·~··L·· implMeth 27 | 00000140 6F 64 53 69 67 6E 61 74 75 72 65 71 00 7E 00 03 odSignat ureq·~·· 28 | 00000150 4C 00 16 69 6E 73 74 61 6E 74 69 61 74 65 64 4D L··insta ntiatedM 29 | 00000160 65 74 68 6F 64 54 79 70 65 71 00 7E 00 03 78 70 ethodTyp eq·~··xp 30 | 00000170 00 00 00 06 75 72 00 13 5B 4C 6A 61 76 61 2E 6C ····ur·· [Ljava.l 31 | 00000180 61 6E 67 2E 4F 62 6A 65 63 74 3B 90 CE 58 9F 10 ang.Obje ct;··X·· 32 | 00000190 73 29 6C 02 00 00 78 70 00 00 00 00 76 72 00 1A s)l···xp ····vr·· 33 | 000001a0 6C 61 6D 62 64 61 2E 4C 61 6D 62 64 61 53 65 72 lambda.L ambdaSer 34 | 000001b0 69 61 6C 69 7A 61 74 69 6F 6E 00 00 00 00 00 00 ializati on······ 35 | 000001c0 00 00 00 00 00 78 70 74 00 34 6E 65 74 2F 6F 70 ·····xpt ·4net/op 36 | 000001d0 65 6E 68 66 74 2F 63 68 72 6F 6E 69 63 6C 65 2F enhft/ch ronicle/ 37 | 000001e0 63 6F 72 65 2F 75 74 69 6C 2F 53 65 72 69 61 6C core/uti l/Serial 38 | 000001f0 69 7A 61 62 6C 65 46 75 6E 63 74 69 6F 6E 74 00 izableFu nctiont· 39 | 00000200 05 61 70 70 6C 79 74 00 26 28 4C 6A 61 76 61 2F ·applyt· &(Ljava/ 40 | 00000210 6C 61 6E 67 2F 4F 62 6A 65 63 74 3B 29 4C 6A 61 lang/Obj ect;)Lja 41 | 00000220 76 61 2F 6C 61 6E 67 2F 4F 62 6A 65 63 74 3B 74 va/lang/ Object;t 42 | 00000230 00 1A 6C 61 6D 62 64 61 2F 4C 61 6D 62 64 61 53 ··lambda /LambdaS 43 | 00000240 65 72 69 61 6C 69 7A 61 74 69 6F 6E 74 00 23 6C erializa tiont·#l 44 | 00000250 61 6D 62 64 61 24 6A 61 76 61 53 65 72 69 61 6C ambda$ja vaSerial 45 | 00000260 69 7A 61 74 69 6F 6E 24 65 61 31 61 64 31 31 30 ization$ ea1ad110 46 | 00000270 24 31 74 00 26 28 4C 6A 61 76 61 2F 6C 61 6E 67 $1t·&(Lj ava/lang 47 | 00000280 2F 53 74 72 69 6E 67 3B 29 4C 6A 61 76 61 2F 6C /String; )Ljava/l 48 | 00000290 61 6E 67 2F 53 74 72 69 6E 67 3B 71 00 7E 00 0E ang/Stri ng;q·~·· 49 | ``` 50 | Running javaSerializationCapturing 51 | ``` 52 | 00000000 AC ED 00 05 73 72 00 21 6A 61 76 61 2E 6C 61 6E ····sr·! java.lan 53 | 00000010 67 2E 69 6E 76 6F 6B 65 2E 53 65 72 69 61 6C 69 g.invoke .Seriali 54 | 00000020 7A 65 64 4C 61 6D 62 64 61 6F 61 D0 94 2C 29 36 zedLambd aoa··,)6 55 | 00000030 85 02 00 0A 49 00 0E 69 6D 70 6C 4D 65 74 68 6F ····I··i mplMetho 56 | 00000040 64 4B 69 6E 64 5B 00 0C 63 61 70 74 75 72 65 64 dKind[·· captured 57 | 00000050 41 72 67 73 74 00 13 5B 4C 6A 61 76 61 2F 6C 61 Argst··[ Ljava/la 58 | 00000060 6E 67 2F 4F 62 6A 65 63 74 3B 4C 00 0E 63 61 70 ng/Objec t;L··cap 59 | 00000070 74 75 72 69 6E 67 43 6C 61 73 73 74 00 11 4C 6A turingCl asst··Lj 60 | 00000080 61 76 61 2F 6C 61 6E 67 2F 43 6C 61 73 73 3B 4C ava/lang /Class;L 61 | 00000090 00 18 66 75 6E 63 74 69 6F 6E 61 6C 49 6E 74 65 ··functi onalInte 62 | 000000a0 72 66 61 63 65 43 6C 61 73 73 74 00 12 4C 6A 61 rfaceCla sst··Lja 63 | 000000b0 76 61 2F 6C 61 6E 67 2F 53 74 72 69 6E 67 3B 4C va/lang/ String;L 64 | 000000c0 00 1D 66 75 6E 63 74 69 6F 6E 61 6C 49 6E 74 65 ··functi onalInte 65 | 000000d0 72 66 61 63 65 4D 65 74 68 6F 64 4E 61 6D 65 71 rfaceMet hodNameq 66 | 000000e0 00 7E 00 03 4C 00 22 66 75 6E 63 74 69 6F 6E 61 ·~··L·"f unctiona 67 | 000000f0 6C 49 6E 74 65 72 66 61 63 65 4D 65 74 68 6F 64 lInterfa ceMethod 68 | 00000100 53 69 67 6E 61 74 75 72 65 71 00 7E 00 03 4C 00 Signatur eq·~··L· 69 | 00000110 09 69 6D 70 6C 43 6C 61 73 73 71 00 7E 00 03 4C ·implCla ssq·~··L 70 | 00000120 00 0E 69 6D 70 6C 4D 65 74 68 6F 64 4E 61 6D 65 ··implMe thodName 71 | 00000130 71 00 7E 00 03 4C 00 13 69 6D 70 6C 4D 65 74 68 q·~··L·· implMeth 72 | 00000140 6F 64 53 69 67 6E 61 74 75 72 65 71 00 7E 00 03 odSignat ureq·~·· 73 | 00000150 4C 00 16 69 6E 73 74 61 6E 74 69 61 74 65 64 4D L··insta ntiatedM 74 | 00000160 65 74 68 6F 64 54 79 70 65 71 00 7E 00 03 78 70 ethodTyp eq·~··xp 75 | 00000170 00 00 00 06 75 72 00 13 5B 4C 6A 61 76 61 2E 6C ····ur·· [Ljava.l 76 | 00000180 61 6E 67 2E 4F 62 6A 65 63 74 3B 90 CE 58 9F 10 ang.Obje ct;··X·· 77 | 00000190 73 29 6C 02 00 00 78 70 00 00 00 01 74 00 01 2A s)l···xp ····t··* 78 | 000001a0 76 72 00 1A 6C 61 6D 62 64 61 2E 4C 61 6D 62 64 vr··lamb da.Lambd 79 | 000001b0 61 53 65 72 69 61 6C 69 7A 61 74 69 6F 6E 00 00 aSeriali zation·· 80 | 000001c0 00 00 00 00 00 00 00 00 00 78 70 74 00 34 6E 65 ········ ·xpt·4ne 81 | 000001d0 74 2F 6F 70 65 6E 68 66 74 2F 63 68 72 6F 6E 69 t/openhf t/chroni 82 | 000001e0 63 6C 65 2F 63 6F 72 65 2F 75 74 69 6C 2F 53 65 cle/core /util/Se 83 | 000001f0 72 69 61 6C 69 7A 61 62 6C 65 46 75 6E 63 74 69 rializab leFuncti 84 | 00000200 6F 6E 74 00 05 61 70 70 6C 79 74 00 26 28 4C 6A ont··app lyt·&(Lj 85 | 00000210 61 76 61 2F 6C 61 6E 67 2F 4F 62 6A 65 63 74 3B ava/lang /Object; 86 | 00000220 29 4C 6A 61 76 61 2F 6C 61 6E 67 2F 4F 62 6A 65 )Ljava/l ang/Obje 87 | 00000230 63 74 3B 74 00 1A 6C 61 6D 62 64 61 2F 4C 61 6D ct;t··la mbda/Lam 88 | 00000240 62 64 61 53 65 72 69 61 6C 69 7A 61 74 69 6F 6E bdaSeria lization 89 | 00000250 74 00 2C 6C 61 6D 62 64 61 24 6A 61 76 61 53 65 t·,lambd a$javaSe 90 | 00000260 72 69 61 6C 69 7A 61 74 69 6F 6E 43 61 70 74 75 rializat ionCaptu 91 | 00000270 72 69 6E 67 24 38 65 38 30 37 34 39 34 24 31 74 ring$8e8 07494$1t 92 | 00000280 00 38 28 4C 6A 61 76 61 2F 6C 61 6E 67 2F 53 74 ·8(Ljava /lang/St 93 | 00000290 72 69 6E 67 3B 4C 6A 61 76 61 2F 6C 61 6E 67 2F ring;Lja va/lang/ 94 | 000002a0 53 74 72 69 6E 67 3B 29 4C 6A 61 76 61 2F 6C 61 String;) Ljava/la 95 | 000002b0 6E 67 2F 53 74 72 69 6E 67 3B 74 00 26 28 4C 6A ng/Strin g;t·&(Lj 96 | 000002c0 61 76 61 2F 6C 61 6E 67 2F 53 74 72 69 6E 67 3B ava/lang /String; 97 | 000002d0 29 4C 6A 61 76 61 2F 6C 61 6E 67 2F 53 74 72 69 )Ljava/l ang/Stri 98 | 000002e0 6E 67 3B ng; 99 | ``` 100 | Running javaSerializationWithEnum 101 | ``` 102 | 00000000 AC ED 00 05 7E 72 00 24 6C 61 6D 62 64 61 2E 4C ····~r·$ lambda.L 103 | 00000010 61 6D 62 64 61 53 65 72 69 61 6C 69 7A 61 74 69 ambdaSer ializati 104 | 00000020 6F 6E 24 46 75 6E 63 74 69 6F 6E 73 00 00 00 00 on$Funct ions···· 105 | 00000030 00 00 00 00 12 00 00 78 72 00 0E 6A 61 76 61 2E ·······x r··java. 106 | 00000040 6C 61 6E 67 2E 45 6E 75 6D 00 00 00 00 00 00 00 lang.Enu m······· 107 | 00000050 00 12 00 00 78 70 74 00 0B 41 50 50 45 4E 44 5F ····xpt· ·APPEND_ 108 | 00000060 53 54 41 52 STAR 109 | ``` 110 | Running wireSerialization 111 | ``` 112 | 00000000 C0 B6 10 53 65 72 69 61 6C 69 7A 65 64 4C 61 6D ···Seria lizedLam 113 | 00000010 62 64 61 82 3D 01 00 00 C2 63 63 BC 1A 6C 61 6D bda·=··· ·cc··lam 114 | 00000020 62 64 61 2E 4C 61 6D 62 64 61 53 65 72 69 61 6C bda.Lamb daSerial 115 | 00000030 69 7A 61 74 69 6F 6E C3 66 69 63 B8 34 6E 65 74 ization· fic·4net 116 | 00000040 2F 6F 70 65 6E 68 66 74 2F 63 68 72 6F 6E 69 63 /openhft /chronic 117 | 00000050 6C 65 2F 63 6F 72 65 2F 75 74 69 6C 2F 53 65 72 le/core/ util/Ser 118 | 00000060 69 61 6C 69 7A 61 62 6C 65 46 75 6E 63 74 69 6F ializabl eFunctio 119 | 00000070 6E C4 66 69 6D 6E E5 61 70 70 6C 79 C4 66 69 6D n·fimn·a pply·fim 120 | 00000080 73 B8 26 28 4C 6A 61 76 61 2F 6C 61 6E 67 2F 4F s·&(Ljav a/lang/O 121 | 00000090 62 6A 65 63 74 3B 29 4C 6A 61 76 61 2F 6C 61 6E bject;)L java/lan 122 | 000000a0 67 2F 4F 62 6A 65 63 74 3B C3 69 6D 6B 06 C2 69 g/Object ;·imk··i 123 | 000000b0 63 FA 6C 61 6D 62 64 61 2F 4C 61 6D 62 64 61 53 c·lambda /LambdaS 124 | 000000c0 65 72 69 61 6C 69 7A 61 74 69 6F 6E C3 69 6D 6E erializa tion·imn 125 | 000000d0 B8 23 6C 61 6D 62 64 61 24 77 69 72 65 53 65 72 ·#lambda $wireSer 126 | 000000e0 69 61 6C 69 7A 61 74 69 6F 6E 24 65 61 31 61 64 ializati on$ea1ad 127 | 000000f0 31 31 30 24 31 C3 69 6D 73 B8 26 28 4C 6A 61 76 110$1·im s·&(Ljav 128 | 00000100 61 2F 6C 61 6E 67 2F 53 74 72 69 6E 67 3B 29 4C a/lang/S tring;)L 129 | 00000110 6A 61 76 61 2F 6C 61 6E 67 2F 53 74 72 69 6E 67 java/lan g/String 130 | 00000120 3B C3 69 6D 74 B8 26 28 4C 6A 61 76 61 2F 6C 61 ;·imt·&( Ljava/la 131 | 00000130 6E 67 2F 53 74 72 69 6E 67 3B 29 4C 6A 61 76 61 ng/Strin g;)Ljava 132 | 00000140 2F 6C 61 6E 67 2F 53 74 72 69 6E 67 3B C2 63 61 /lang/St ring;·ca 133 | 00000150 82 00 00 00 00 ····· 134 | ``` 135 | Running wireSerializationCapturing 136 | ``` 137 | 00000000 C0 B6 10 53 65 72 69 61 6C 69 7A 65 64 4C 61 6D ···Seria lizedLam 138 | 00000010 62 64 61 82 5A 01 00 00 C2 63 63 BC 1A 6C 61 6D bda·Z··· ·cc··lam 139 | 00000020 62 64 61 2E 4C 61 6D 62 64 61 53 65 72 69 61 6C bda.Lamb daSerial 140 | 00000030 69 7A 61 74 69 6F 6E C3 66 69 63 B8 34 6E 65 74 ization· fic·4net 141 | 00000040 2F 6F 70 65 6E 68 66 74 2F 63 68 72 6F 6E 69 63 /openhft /chronic 142 | 00000050 6C 65 2F 63 6F 72 65 2F 75 74 69 6C 2F 53 65 72 le/core/ util/Ser 143 | 00000060 69 61 6C 69 7A 61 62 6C 65 46 75 6E 63 74 69 6F ializabl eFunctio 144 | 00000070 6E C4 66 69 6D 6E E5 61 70 70 6C 79 C4 66 69 6D n·fimn·a pply·fim 145 | 00000080 73 B8 26 28 4C 6A 61 76 61 2F 6C 61 6E 67 2F 4F s·&(Ljav a/lang/O 146 | 00000090 62 6A 65 63 74 3B 29 4C 6A 61 76 61 2F 6C 61 6E bject;)L java/lan 147 | 000000a0 67 2F 4F 62 6A 65 63 74 3B C3 69 6D 6B 06 C2 69 g/Object ;·imk··i 148 | 000000b0 63 FA 6C 61 6D 62 64 61 2F 4C 61 6D 62 64 61 53 c·lambda /LambdaS 149 | 000000c0 65 72 69 61 6C 69 7A 61 74 69 6F 6E C3 69 6D 6E erializa tion·imn 150 | 000000d0 B8 2C 6C 61 6D 62 64 61 24 77 69 72 65 53 65 72 ·,lambda $wireSer 151 | 000000e0 69 61 6C 69 7A 61 74 69 6F 6E 43 61 70 74 75 72 ializati onCaptur 152 | 000000f0 69 6E 67 24 38 65 38 30 37 34 39 34 24 31 C3 69 ing$8e80 7494$1·i 153 | 00000100 6D 73 B8 38 28 4C 6A 61 76 61 2F 6C 61 6E 67 2F ms·8(Lja va/lang/ 154 | 00000110 53 74 72 69 6E 67 3B 4C 6A 61 76 61 2F 6C 61 6E String;L java/lan 155 | 00000120 67 2F 53 74 72 69 6E 67 3B 29 4C 6A 61 76 61 2F g/String ;)Ljava/ 156 | 00000130 6C 61 6E 67 2F 53 74 72 69 6E 67 3B C3 69 6D 74 lang/Str ing;·imt 157 | 00000140 B8 26 28 4C 6A 61 76 61 2F 6C 61 6E 67 2F 53 74 ·&(Ljava /lang/St 158 | 00000150 72 69 6E 67 3B 29 4C 6A 61 76 61 2F 6C 61 6E 67 ring;)Lj ava/lang 159 | 00000160 2F 53 74 72 69 6E 67 3B C2 63 61 82 02 00 00 00 /String; ·ca····· 160 | 00000170 E1 2A ·* 161 | ``` 162 | Running wireSerializationWithEnum 163 | ``` 164 | 00000000 C0 B6 09 46 75 6E 63 74 69 6F 6E 73 EB 41 50 50 ···Funct ions·APP 165 | 00000010 45 4E 44 5F 53 54 41 52 END_STAR 166 | ``` 167 | Running textWireSerialization 168 | ``` 169 | !SerializedLambda { 170 | cc: !type lambda.LambdaSerialization, 171 | fic: net/openhft/chronicle/core/util/SerializableFunction, 172 | fimn: apply, 173 | fims: (Ljava/lang/Object;)Ljava/lang/Object;, 174 | imk: 6, 175 | ic: lambda/LambdaSerialization, 176 | imn: lambda$textWireSerialization$ea1ad110$1, 177 | ims: (Ljava/lang/String;)Ljava/lang/String;, 178 | imt: (Ljava/lang/String;)Ljava/lang/String;, 179 | ca: [ 180 | ] 181 | } 182 | ``` 183 | Running textWireSerializationCapturing 184 | ``` 185 | !SerializedLambda { 186 | cc: !type lambda.LambdaSerialization, 187 | fic: net/openhft/chronicle/core/util/SerializableFunction, 188 | fimn: apply, 189 | fims: (Ljava/lang/Object;)Ljava/lang/Object;, 190 | imk: 6, 191 | ic: lambda/LambdaSerialization, 192 | imn: lambda$textWireSerializationCapturing$8e807494$1, 193 | ims: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;, 194 | imt: (Ljava/lang/String;)Ljava/lang/String;, 195 | ca: [ 196 | * 197 | ] 198 | } 199 | ``` 200 | Running textWireSerializationWithEnum 201 | ``` 202 | !Functions APPEND_STAR 203 | ``` 204 | -------------------------------------------------------------------------------- /src/main/java/lambda/Results.txt: -------------------------------------------------------------------------------- 1 | measurementTime: 2 secs 2 | # JMH 1.10.3 (released 43 days ago) 3 | # VM version: JDK 1.8.0_51, VM 25.51-b03 4 | # VM invoker: /opt/jdk1.8.0_51/jre/bin/java 5 | # VM options: -Xmx1g -Didea.launcher.port=7539 -Didea.launcher.bin.path=/opt/idea-IU-142.4245.2/bin -Dfile.encoding=UTF-8 6 | # Warmup: 5 iterations, 1 s each 7 | # Measurement: 5 iterations, 2 s each 8 | # Timeout: 10 min per iteration 9 | # Threads: 1 thread, will synchronize iterations 10 | # Benchmark mode: Sampling time 11 | # Benchmark: lambda.LambdaSerialization.javaSerialization 12 | 13 | # Run progress: 0.00% complete, ETA 00:07:30 14 | # Fork: 1 of 5 15 | # Warmup Iteration 1: n = 15317, mean = 64428 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 35904, 54144, 86400, 112909, 270336, 733192, 6505467, 7995392 ns/op 16 | # Warmup Iteration 2: n = 11042, mean = 45049 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 35584, 37696, 60077, 64896, 84297, 123600, 2587109, 2674688 ns/op 17 | # Warmup Iteration 3: n = 13208, mean = 37793 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 35328, 37312, 37760, 37952, 41984, 50611, 2445465, 2449408 ns/op 18 | # Warmup Iteration 4: n = 14067, mean = 35580 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33216, 35776, 36352, 36544, 39296, 48490, 1236949, 1411072 ns/op 19 | # Warmup Iteration 5: n = 14523, mean = 34381 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33216, 34112, 34496, 34688, 38272, 45662, 828000, 858112 ns/op 20 | Iteration 1: n = 28792, mean = 35099 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 32960, 33984, 34368, 34752, 40320, 52555, 4109652, 10125312 ns/op 21 | Iteration 2: n = 28268, mean = 34859 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 32896, 33856, 34240, 34432, 39040, 206385, 220382, 16941056 ns/op 22 | Iteration 3: n = 28864, mean = 34208 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33088, 33984, 34368, 34560, 39872, 46985, 212910, 218624 ns/op 23 | Iteration 4: n = 28916, mean = 34191 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 32960, 33856, 34240, 34432, 39872, 140138, 213873, 864256 ns/op 24 | Iteration 5: n = 28704, mean = 34681 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33024, 34048, 34368, 34560, 38208, 45286, 1085104, 8585216 ns/op 25 | 26 | # Run progress: 3.33% complete, ETA 00:07:29 27 | # Fork: 2 of 5 28 | # Warmup Iteration 1: n = 19525, mean = 50498 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 35520, 37760, 68096, 77056, 217088, 322021, 3687045, 4276224 ns/op 29 | # Warmup Iteration 2: n = 11710, mean = 42931 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 36352, 37504, 48960, 51584, 63865, 112421, 4162195, 4505600 ns/op 30 | # Warmup Iteration 3: n = 13044, mean = 38771 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 35712, 37248, 37696, 38464, 46307, 186557, 7146193, 8732672 ns/op 31 | # Warmup Iteration 4: n = 13872, mean = 35877 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33216, 36032, 36480, 36928, 41984, 114468, 220778, 222464 ns/op 32 | # Warmup Iteration 5: n = 14398, mean = 34604 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33280, 34112, 34496, 34944, 41985, 47706, 2109077, 3723264 ns/op 33 | Iteration 1: n = 28498, mean = 35103 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 31776, 34048, 34496, 35072, 42240, 48512, 5029172, 8421376 ns/op 34 | Iteration 2: n = 28848, mean = 34314 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33088, 34048, 34368, 34624, 40609, 48378, 215620, 221184 ns/op 35 | Iteration 3: n = 28783, mean = 35241 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33152, 33984, 34368, 34496, 38784, 45212, 5530675, 19922944 ns/op 36 | Iteration 4: n = 28812, mean = 35047 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33088, 33984, 34368, 34496, 38464, 45120, 220239, 25198592 ns/op 37 | Iteration 5: n = 28743, mean = 34605 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33216, 34112, 34496, 34624, 38208, 44560, 327895, 8847360 ns/op 38 | 39 | # Run progress: 6.67% complete, ETA 00:07:12 40 | # Fork: 3 of 5 41 | # Warmup Iteration 1: n = 18023, mean = 54746 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 36288, 47168, 69120, 78848, 205640, 311759, 4215102, 4382720 ns/op 42 | # Warmup Iteration 2: n = 9975, mean = 51099 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 36224, 51584, 61440, 64512, 94141, 170684, 9814016, 9814016 ns/op 43 | # Warmup Iteration 3: n = 12820, mean = 38628 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 36160, 37504, 38016, 38656, 49664, 215525, 1667671, 2228224 ns/op 44 | # Warmup Iteration 4: n = 13551, mean = 36690 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33408, 36544, 37056, 37248, 42399, 209152, 2530139, 3796992 ns/op 45 | # Warmup Iteration 5: n = 14423, mean = 34504 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33408, 34368, 34752, 34880, 39616, 46474, 58012, 59456 ns/op 46 | Iteration 1: n = 28595, mean = 35256 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33344, 34432, 34752, 34944, 39939, 46400, 1229131, 12517376 ns/op 47 | Iteration 2: n = 28720, mean = 35098 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33344, 34368, 34688, 34816, 38144, 44306, 5053782, 7593984 ns/op 48 | Iteration 3: n = 28632, mean = 34779 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33344, 34496, 34880, 35008, 38720, 45952, 51202, 4743168 ns/op 49 | Iteration 4: n = 28429, mean = 35579 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33536, 34560, 34944, 35008, 37914, 45001, 4782096, 14745600 ns/op 50 | Iteration 5: n = 28673, mean = 34790 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33472, 34496, 34880, 35072, 41280, 46485, 117683, 3960832 ns/op 51 | 52 | # Run progress: 10.00% complete, ETA 00:06:56 53 | # Fork: 4 of 5 54 | # Warmup Iteration 1: n = 18965, mean = 52056 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 35392, 41408, 68992, 75520, 194903, 307217, 5138334, 5652480 ns/op 55 | # Warmup Iteration 2: n = 11660, mean = 43707 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 36224, 37824, 49152, 50429, 77711, 249878, 7053897, 7225344 ns/op 56 | # Warmup Iteration 3: n = 12583, mean = 38845 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 35520, 37504, 43456, 45504, 49280, 214634, 224460, 226048 ns/op 57 | # Warmup Iteration 4: n = 13621, mean = 36794 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33472, 36736, 37184, 37440, 42368, 209602, 1933627, 2576384 ns/op 58 | # Warmup Iteration 5: n = 14462, mean = 34475 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33536, 34368, 34752, 34880, 38912, 45952, 60948, 66432 ns/op 59 | Iteration 1: n = 28763, mean = 34600 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33344, 34368, 34752, 34880, 38976, 45760, 48813, 3928064 ns/op 60 | Iteration 2: n = 28810, mean = 34641 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33600, 34496, 34880, 35008, 39168, 45680, 53697, 780288 ns/op 61 | Iteration 3: n = 28739, mean = 34888 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33536, 34432, 34816, 35008, 38656, 45376, 943108, 7495680 ns/op 62 | Iteration 4: n = 28776, mean = 34711 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33408, 34368, 34752, 34880, 39360, 46208, 328687, 5234688 ns/op 63 | Iteration 5: n = 28386, mean = 35098 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 33280, 34304, 34688, 34880, 41792, 182900, 358423, 9322496 ns/op 64 | 65 | # Run progress: 13.33% complete, ETA 00:06:40 66 | # Fork: 5 of 5 67 | # Warmup Iteration 1: n = 18686, mean = 52809 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 35392, 42688, 68864, 76288, 189384, 307841, 3821020, 4521984 ns/op 68 | # Warmup Iteration 2: n = 10979, mean = 45201 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 37632, 39104, 51840, 64960, 85914, 166779, 2113188, 2146304 ns/op 69 | # Warmup Iteration 3: n = 12385, mean = 40663 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 36800, 38464, 38976, 39360, 46601, 56196, 17052629, 21659648 ns/op 70 | # Warmup Iteration 4: n = 13042, mean = 39345 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 34688, 37184, 37696, 37888, 43172, 211957, 19263562, 27099136 ns/op 71 | # Warmup Iteration 5: n = 13635, mean = 35890 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 34368, 35392, 35776, 35968, 44480, 210200, 217810, 218368 ns/op 72 | Iteration 1: n = 27929, mean = 35776 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 34432, 35328, 35712, 35904, 42029, 48452, 55564, 7020544 ns/op 73 | Iteration 2: n = 27944, mean = 35599 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 34496, 35456, 35840, 36032, 40000, 47104, 50136, 55680 ns/op 74 | Iteration 3: n = 27703, mean = 36498 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 34496, 35520, 35840, 35968, 39296, 46035, 2069124, 18350080 ns/op 75 | Iteration 4: n = 27782, mean = 36163 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 34432, 35392, 35776, 35968, 41792, 47168, 676680, 13418496 ns/op 76 | Iteration 5: n = 27683, mean = 36161 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 34432, 35392, 35776, 35904, 40256, 46804, 58005, 18087936 ns/op 77 | 78 | 79 | Result "javaSerialization": 80 | 35072.375 ±(99.9%) 280.589 ns/op [Average] 81 | (min, avg, max) = (31776.000, 35072.375, 25198592.000), stdev = 71992.136 82 | CI (99.9%): [34791.786, 35352.964] (assumes normal distribution) 83 | Samples, N = 712792 84 | mean = 35072.375 ±(99.9%) 280.589 ns/op 85 | min = 31776.000 ns/op 86 | p( 0.0000) = 31776.000 ns/op 87 | p(50.0000) = 34304.000 ns/op 88 | p(90.0000) = 35520.000 ns/op 89 | p(95.0000) = 35712.000 ns/op 90 | p(99.0000) = 39616.000 ns/op 91 | p(99.9000) = 47168.000 ns/op 92 | p(99.9900) = 216218.496 ns/op 93 | p(99.9990) = 13303215.718 ns/op 94 | p(99.9999) = 25198592.000 ns/op 95 | max = 25198592.000 ns/op 96 | 97 | 98 | # JMH 1.10.3 (released 43 days ago) 99 | # VM version: JDK 1.8.0_51, VM 25.51-b03 100 | # VM invoker: /opt/jdk1.8.0_51/jre/bin/java 101 | # VM options: -Xmx1g -Didea.launcher.port=7539 -Didea.launcher.bin.path=/opt/idea-IU-142.4245.2/bin -Dfile.encoding=UTF-8 102 | # Warmup: 5 iterations, 1 s each 103 | # Measurement: 5 iterations, 2 s each 104 | # Timeout: 10 min per iteration 105 | # Threads: 1 thread, will synchronize iterations 106 | # Benchmark mode: Sampling time 107 | # Benchmark: lambda.LambdaSerialization.javaSerializationWithEnum 108 | 109 | # Run progress: 16.67% complete, ETA 00:06:24 110 | # Fork: 1 of 5 111 | # Warmup Iteration 1: n = 21815, mean = 12844 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7952, 9024, 16480, 18624, 63350, 191791, 3832041, 7168000 ns/op 112 | # Warmup Iteration 2: n = 14004, mean = 8991 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7888, 8416, 9888, 10448, 13519, 179197, 189848, 190976 ns/op 113 | # Warmup Iteration 3: n = 15002, mean = 8311 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7880, 8272, 8448, 8512, 8672, 15547, 181886, 185088 ns/op 114 | # Warmup Iteration 4: n = 15368, mean = 8133 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7440, 8192, 8416, 8480, 8624, 13222, 20808, 23712 ns/op 115 | # Warmup Iteration 5: n = 16040, mean = 7994 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7416, 7760, 7944, 8000, 8160, 12819, 1327802, 3325952 ns/op 116 | Iteration 1: n = 31621, mean = 7915 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7296, 7776, 7960, 8024, 8624, 11778, 65122, 2473984 ns/op 117 | Iteration 2: n = 31745, mean = 7823 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7408, 7776, 7960, 8024, 8368, 12593, 104365, 186880 ns/op 118 | Iteration 3: n = 31802, mean = 7823 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7400, 7784, 7976, 8040, 9056, 12307, 19314, 20800 ns/op 119 | Iteration 4: n = 31436, mean = 7833 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7424, 7784, 7976, 8056, 9456, 12196, 20630, 86272 ns/op 120 | Iteration 5: n = 31612, mean = 7869 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7408, 7760, 7952, 8016, 8896, 17120, 168481, 172288 ns/op 121 | 122 | # Run progress: 20.00% complete, ETA 00:06:09 123 | # Fork: 2 of 5 124 | # Warmup Iteration 1: n = 21544, mean = 12790 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 8432, 9328, 16176, 18144, 64518, 191977, 3071916, 4235264 ns/op 125 | # Warmup Iteration 2: n = 13718, mean = 9414 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 8208, 8688, 10256, 10944, 14829, 179335, 1548036, 2347008 ns/op 126 | # Warmup Iteration 3: n = 14247, mean = 8808 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 8304, 8640, 8816, 8896, 10001, 19065, 579035, 867328 ns/op 127 | # Warmup Iteration 4: n = 14712, mean = 8484 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7792, 8544, 8768, 8832, 9548, 15564, 18684, 18880 ns/op 128 | # Warmup Iteration 5: n = 15444, mean = 8087 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7760, 8072, 8192, 8240, 8400, 12099, 18219, 19648 ns/op 129 | Iteration 1: n = 30358, mean = 8505 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7704, 8080, 8208, 8256, 8400, 14778, 159652, 11124736 ns/op 130 | Iteration 2: n = 29933, mean = 8196 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7744, 8096, 8224, 8272, 8875, 16226, 185863, 186880 ns/op 131 | Iteration 3: n = 30516, mean = 8469 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7720, 8088, 8224, 8272, 9008, 13160, 821639, 8781824 ns/op 132 | Iteration 4: n = 30135, mean = 8175 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7592, 8088, 8224, 8272, 9328, 17820, 145553, 172800 ns/op 133 | Iteration 5: n = 30313, mean = 8447 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7744, 8088, 8224, 8272, 8464, 16214, 175599, 8798208 ns/op 134 | 135 | # Run progress: 23.33% complete, ETA 00:05:54 136 | # Fork: 3 of 5 137 | # Warmup Iteration 1: n = 22330, mean = 12107 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7872, 8896, 14512, 17280, 66520, 189271, 2053338, 3457024 ns/op 138 | # Warmup Iteration 2: n = 13150, mean = 9639 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 8024, 8672, 10784, 10960, 14272, 161780, 2252993, 3203072 ns/op 139 | # Warmup Iteration 3: n = 14353, mean = 8580 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7952, 8480, 8736, 8816, 10135, 14246, 188524, 190976 ns/op 140 | # Warmup Iteration 4: n = 14716, mean = 9475 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7528, 8384, 8672, 8768, 9088, 18206, 8316879, 10944512 ns/op 141 | # Warmup Iteration 5: n = 15534, mean = 7965 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7536, 7912, 8104, 8192, 8528, 13756, 87247, 141056 ns/op 142 | Iteration 1: n = 31142, mean = 7950 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7552, 7912, 8104, 8184, 8416, 12014, 19097, 19744 ns/op 143 | Iteration 2: n = 30948, mean = 8361 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7536, 7912, 8096, 8184, 8368, 11953, 18164, 12943360 ns/op 144 | Iteration 3: n = 31159, mean = 7995 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7512, 7920, 8112, 8192, 8800, 13584, 42919, 804864 ns/op 145 | Iteration 4: n = 31071, mean = 8364 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7528, 7928, 8144, 8288, 10084, 15101, 652993, 5357568 ns/op 146 | Iteration 5: n = 31112, mean = 7968 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7496, 7920, 8112, 8208, 9246, 13081, 23079, 94464 ns/op 147 | 148 | # Run progress: 26.67% complete, ETA 00:05:38 149 | # Fork: 4 of 5 150 | # Warmup Iteration 1: n = 22389, mean = 12368 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 8088, 9040, 16160, 18160, 62150, 192056, 2337806, 4415488 ns/op 151 | # Warmup Iteration 2: n = 13112, mean = 10291 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7976, 8800, 10256, 10720, 18108, 170759, 7004321, 10076160 ns/op 152 | # Warmup Iteration 3: n = 14134, mean = 8723 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 8128, 8624, 8816, 8864, 8992, 15800, 194483, 198400 ns/op 153 | # Warmup Iteration 4: n = 14635, mean = 8461 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7608, 8528, 8816, 8880, 9658, 12851, 68913, 113152 ns/op 154 | # Warmup Iteration 5: n = 15359, mean = 9021 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7608, 7968, 8208, 8272, 8918, 12060, 7252263, 14794752 ns/op 155 | Iteration 1: n = 30939, mean = 8014 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7560, 7960, 8208, 8272, 9136, 13434, 19545, 23872 ns/op 156 | Iteration 2: n = 30822, mean = 8012 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7448, 7952, 8192, 8256, 9676, 13156, 21995, 73984 ns/op 157 | Iteration 3: n = 30955, mean = 8306 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7584, 7944, 8184, 8240, 8384, 13057, 155450, 9125888 ns/op 158 | Iteration 4: n = 30892, mean = 7991 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7472, 7952, 8184, 8240, 8448, 12226, 19149, 20928 ns/op 159 | Iteration 5: n = 30893, mean = 8022 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7528, 7960, 8192, 8240, 8368, 12878, 18234, 830464 ns/op 160 | 161 | # Run progress: 30.00% complete, ETA 00:05:23 162 | # Fork: 5 of 5 163 | # Warmup Iteration 1: n = 21040, mean = 13059 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 8208, 9408, 16576, 18592, 64806, 194038, 5525842, 7962624 ns/op 164 | # Warmup Iteration 2: n = 13652, mean = 9134 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 8000, 8528, 10160, 10560, 14680, 88365, 189858, 189952 ns/op 165 | # Warmup Iteration 3: n = 14687, mean = 8583 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7968, 8368, 8576, 8640, 8992, 17108, 929770, 1587200 ns/op 166 | # Warmup Iteration 4: n = 15060, mean = 8260 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7528, 8304, 8544, 8608, 8784, 12800, 68839, 120064 ns/op 167 | # Warmup Iteration 5: n = 15813, mean = 7917 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7512, 7896, 8072, 8128, 8256, 12255, 16643, 16736 ns/op 168 | Iteration 1: n = 30677, mean = 8815 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7464, 7872, 8056, 8112, 8256, 12197, 19180, 19496960 ns/op 169 | Iteration 2: n = 31488, mean = 7929 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7504, 7880, 8064, 8128, 8256, 12915, 18267, 660480 ns/op 170 | Iteration 3: n = 31111, mean = 8183 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7472, 7880, 8064, 8120, 8272, 15765, 174506, 7643136 ns/op 171 | Iteration 4: n = 30815, mean = 8317 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7472, 7880, 8064, 8120, 8288, 21373, 588772, 8650752 ns/op 172 | Iteration 5: n = 31249, mean = 7928 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 7504, 7888, 8072, 8136, 8848, 13412, 22328, 42880 ns/op 173 | 174 | 175 | Result "javaSerializationWithEnum": 176 | 8125.881 ±(99.9%) 145.959 ns/op [Average] 177 | (min, avg, max) = (7296.000, 8125.881, 19496960.000), stdev = 39043.024 178 | CI (99.9%): [7979.922, 8271.840] (assumes normal distribution) 179 | Samples, N = 774744 180 | mean = 8125.881 ±(99.9%) 145.959 ns/op 181 | min = 7296.000 ns/op 182 | p( 0.0000) = 7296.000 ns/op 183 | p(50.0000) = 7928.000 ns/op 184 | p(90.0000) = 8160.000 ns/op 185 | p(95.0000) = 8224.000 ns/op 186 | p(99.0000) = 8784.000 ns/op 187 | p(99.9000) = 13536.000 ns/op 188 | p(99.9900) = 134413.056 ns/op 189 | p(99.9990) = 8626259.558 ns/op 190 | p(99.9999) = 19496960.000 ns/op 191 | max = 19496960.000 ns/op 192 | 193 | 194 | # JMH 1.10.3 (released 43 days ago) 195 | # VM version: JDK 1.8.0_51, VM 25.51-b03 196 | # VM invoker: /opt/jdk1.8.0_51/jre/bin/java 197 | # VM options: -Xmx1g -Didea.launcher.port=7539 -Didea.launcher.bin.path=/opt/idea-IU-142.4245.2/bin -Dfile.encoding=UTF-8 198 | # Warmup: 5 iterations, 1 s each 199 | # Measurement: 5 iterations, 2 s each 200 | # Timeout: 10 min per iteration 201 | # Threads: 1 thread, will synchronize iterations 202 | # Benchmark mode: Sampling time 203 | # Benchmark: lambda.LambdaSerialization.textWireSerialization 204 | 205 | # Run progress: 33.33% complete, ETA 00:05:08 206 | # Fork: 1 of 5 207 | # Warmup Iteration 1: n = 14307, mean = 37800 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 22976, 26944, 41805, 59622, 200172, 639046, 19385337, 32931840 ns/op 208 | # Warmup Iteration 2: n = 11245, mean = 22060 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20896, 21728, 22464, 23936, 26545, 49300, 202241, 202496 ns/op 209 | # Warmup Iteration 3: n = 11709, mean = 21388 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20608, 21312, 21728, 21952, 23296, 29724, 168135, 180480 ns/op 210 | # Warmup Iteration 4: n = 11964, mean = 21116 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20352, 20800, 21024, 21120, 23051, 29217, 2258934, 2801664 ns/op 211 | # Warmup Iteration 5: n = 11975, mean = 20876 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20384, 20832, 21024, 21120, 22240, 28483, 37263, 37440 ns/op 212 | Iteration 1: n = 23954, mean = 20876 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20352, 20832, 21056, 21120, 21632, 28417, 30855, 35904 ns/op 213 | Iteration 2: n = 23925, mean = 20976 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20352, 20800, 20992, 21088, 22848, 29425, 162689, 2086912 ns/op 214 | Iteration 3: n = 23997, mean = 20833 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20256, 20800, 20992, 21056, 21664, 28704, 32589, 33920 ns/op 215 | Iteration 4: n = 23688, mean = 21003 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 19584, 20800, 21056, 21344, 26368, 31910, 98950, 99712 ns/op 216 | Iteration 5: n = 23902, mean = 21055 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 19808, 20800, 21024, 21152, 25760, 30284, 100680, 2945024 ns/op 217 | 218 | # Run progress: 36.67% complete, ETA 00:04:52 219 | # Fork: 2 of 5 220 | # Warmup Iteration 1: n = 14351, mean = 36926 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20960, 31456, 40704, 55770, 178033, 483090, 17420832, 29851648 ns/op 221 | # Warmup Iteration 2: n = 11520, mean = 22014 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20416, 21312, 21696, 21856, 25184, 50388, 5226600, 6127616 ns/op 222 | # Warmup Iteration 3: n = 11846, mean = 21041 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20128, 20928, 21344, 21504, 25457, 29115, 65002, 70144 ns/op 223 | # Warmup Iteration 4: n = 12113, mean = 20688 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20064, 20576, 20800, 20896, 25212, 28089, 118086, 140288 ns/op 224 | # Warmup Iteration 5: n = 12130, mean = 20584 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20032, 20544, 20768, 20832, 21344, 28655, 30791, 30880 ns/op 225 | Iteration 1: n = 24147, mean = 20740 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 19616, 20512, 20736, 20832, 23552, 137179, 168173, 186880 ns/op 226 | Iteration 2: n = 24060, mean = 20638 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 19264, 20480, 20704, 20832, 27072, 28796, 49965, 164608 ns/op 227 | Iteration 3: n = 24153, mean = 20528 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20000, 20480, 20704, 20768, 21696, 27776, 34818, 43648 ns/op 228 | Iteration 4: n = 24302, mean = 20547 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 19936, 20512, 20736, 20800, 21024, 27693, 28800, 29280 ns/op 229 | Iteration 5: n = 23814, mean = 20550 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 19968, 20512, 20736, 20800, 21024, 27712, 29315, 30400 ns/op 230 | 231 | # Run progress: 40.00% complete, ETA 00:04:37 232 | # Fork: 3 of 5 233 | # Warmup Iteration 1: n = 14917, mean = 35686 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20832, 26048, 39680, 55373, 186726, 560683, 15561938, 29392896 ns/op 234 | # Warmup Iteration 2: n = 11635, mean = 21977 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 18304, 20992, 21504, 21728, 29172, 195375, 3200590, 3780608 ns/op 235 | # Warmup Iteration 3: n = 11831, mean = 21481 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20192, 21024, 21376, 21504, 24576, 31772, 3882372, 4734976 ns/op 236 | # Warmup Iteration 4: n = 12099, mean = 20735 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20160, 20672, 20896, 20992, 22784, 28765, 98798, 115840 ns/op 237 | # Warmup Iteration 5: n = 12056, mean = 20770 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20160, 20736, 20960, 21024, 22158, 28380, 31254, 31392 ns/op 238 | Iteration 1: n = 24136, mean = 20856 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20064, 20736, 20960, 21024, 22112, 28224, 33046, 2109440 ns/op 239 | Iteration 2: n = 24132, mean = 20739 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20128, 20704, 20928, 20992, 22389, 29103, 32907, 36800 ns/op 240 | Iteration 3: n = 24153, mean = 20730 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20064, 20672, 20896, 20960, 23375, 28832, 33195, 34304 ns/op 241 | Iteration 4: n = 24197, mean = 20792 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 19936, 20640, 20864, 20928, 21664, 27898, 30109, 2617344 ns/op 242 | Iteration 5: n = 24225, mean = 20738 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20032, 20640, 20864, 20928, 21176, 28178, 31245, 1544192 ns/op 243 | 244 | # Run progress: 43.33% complete, ETA 00:04:21 245 | # Fork: 4 of 5 246 | # Warmup Iteration 1: n = 14101, mean = 37549 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 21440, 29376, 42560, 58112, 189435, 537893, 18722276, 30834688 ns/op 247 | # Warmup Iteration 2: n = 11464, mean = 21787 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20512, 21408, 22272, 22432, 26816, 177966, 203988, 204288 ns/op 248 | # Warmup Iteration 3: n = 11857, mean = 21089 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20288, 21024, 21440, 21632, 23584, 30697, 161846, 179968 ns/op 249 | # Warmup Iteration 4: n = 12090, mean = 20753 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20192, 20704, 20928, 20992, 21219, 28666, 30796, 31104 ns/op 250 | # Warmup Iteration 5: n = 11988, mean = 20879 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20192, 20704, 20928, 20992, 23904, 57412, 184451, 189696 ns/op 251 | Iteration 1: n = 23906, mean = 21243 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20064, 20672, 20896, 20960, 24414, 68691, 228707, 7716864 ns/op 252 | Iteration 2: n = 23925, mean = 21179 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 19744, 20704, 20896, 20960, 23864, 81337, 1833050, 3887104 ns/op 253 | Iteration 3: n = 24018, mean = 21033 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 19808, 20672, 20864, 20960, 22394, 133557, 188107, 3182592 ns/op 254 | Iteration 4: n = 24144, mean = 20830 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20160, 20704, 20928, 20992, 21664, 28987, 160382, 1286144 ns/op 255 | Iteration 5: n = 24164, mean = 20803 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20192, 20704, 20928, 20992, 21344, 28416, 31715, 1267712 ns/op 256 | 257 | # Run progress: 46.67% complete, ETA 00:04:06 258 | # Fork: 5 of 5 259 | # Warmup Iteration 1: n = 14815, mean = 35851 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 21472, 26304, 40704, 55501, 167260, 534577, 16138558, 29949952 ns/op 260 | # Warmup Iteration 2: n = 11506, mean = 22100 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 20640, 21344, 21888, 22144, 25534, 54285, 4678412, 5472256 ns/op 261 | # Warmup Iteration 3: n = 11900, mean = 21039 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 19264, 20800, 21344, 21632, 24448, 81097, 185168, 188672 ns/op 262 | # Warmup Iteration 4: n = 12225, mean = 20492 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 19968, 20416, 20608, 20704, 22872, 28114, 29177, 29184 ns/op 263 | # Warmup Iteration 5: n = 12154, mean = 20557 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 19584, 20448, 20640, 20736, 22176, 29351, 187280, 197376 ns/op 264 | Iteration 1: n = 24414, mean = 20516 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 19040, 20448, 20640, 20704, 22459, 28576, 108547, 109568 ns/op 265 | Iteration 2: n = 24304, mean = 20671 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 19520, 20480, 20704, 20768, 24064, 29797, 69198, 2203648 ns/op 266 | Iteration 3: n = 24439, mean = 20597 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 19936, 20384, 20608, 20672, 23200, 28484, 33495, 3215360 ns/op 267 | Iteration 4: n = 24525, mean = 20558 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 19840, 20352, 20512, 20576, 22912, 29150, 34066, 3784704 ns/op 268 | Iteration 5: n = 24408, mean = 20863 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 19904, 20352, 20544, 20608, 23322, 29107, 798445, 9142272 ns/op 269 | 270 | 271 | Result "textWireSerialization": 272 | 20794.736 ±(99.9%) 84.241 ns/op [Average] 273 | (min, avg, max) = (19040.000, 20794.736, 9142272.000), stdev = 19880.511 274 | CI (99.9%): [20710.495, 20878.977] (assumes normal distribution) 275 | Samples, N = 603032 276 | mean = 20794.736 ±(99.9%) 84.241 ns/op 277 | min = 19040.000 ns/op 278 | p( 0.0000) = 19040.000 ns/op 279 | p(50.0000) = 20640.000 ns/op 280 | p(90.0000) = 20896.000 ns/op 281 | p(95.0000) = 20992.000 ns/op 282 | p(99.0000) = 23456.000 ns/op 283 | p(99.9000) = 29472.000 ns/op 284 | p(99.9900) = 151040.000 ns/op 285 | p(99.9990) = 3175386.563 ns/op 286 | p(99.9999) = 9142272.000 ns/op 287 | max = 9142272.000 ns/op 288 | 289 | 290 | # JMH 1.10.3 (released 43 days ago) 291 | # VM version: JDK 1.8.0_51, VM 25.51-b03 292 | # VM invoker: /opt/jdk1.8.0_51/jre/bin/java 293 | # VM options: -Xmx1g -Didea.launcher.port=7539 -Didea.launcher.bin.path=/opt/idea-IU-142.4245.2/bin -Dfile.encoding=UTF-8 294 | # Warmup: 5 iterations, 1 s each 295 | # Measurement: 5 iterations, 2 s each 296 | # Timeout: 10 min per iteration 297 | # Threads: 1 thread, will synchronize iterations 298 | # Benchmark mode: Sampling time 299 | # Benchmark: lambda.LambdaSerialization.textWireSerializationWithEnum 300 | 301 | # Run progress: 50.00% complete, ETA 00:03:51 302 | # Fork: 1 of 5 303 | # Warmup Iteration 1: n = 22738, mean = 3364 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 893, 1202, 2564, 7328, 45159, 117749, 245251, 13713408 ns/op 304 | # Warmup Iteration 2: n = 13158, mean = 1226 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 879, 1202, 1234, 1246, 1296, 3388, 123325, 176128 ns/op 305 | # Warmup Iteration 3: n = 13217, mean = 1205 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 876, 1200, 1224, 1230, 1242, 1357, 6788, 6824 ns/op 306 | # Warmup Iteration 4: n = 13208, mean = 1209 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 926, 1202, 1228, 1232, 1244, 1438, 7752, 7816 ns/op 307 | # Warmup Iteration 5: n = 13191, mean = 1206 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 972, 1200, 1226, 1230, 1240, 1284, 9452, 12400 ns/op 308 | Iteration 1: n = 26370, mean = 1205 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 964, 1200, 1224, 1228, 1242, 1281, 3756, 6120 ns/op 309 | Iteration 2: n = 26315, mean = 1206 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 1052, 1200, 1226, 1234, 1258, 1364, 3233, 6192 ns/op 310 | Iteration 3: n = 26059, mean = 1206 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 933, 1200, 1226, 1234, 1258, 1362, 4605, 8512 ns/op 311 | Iteration 4: n = 26052, mean = 1210 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 953, 1204, 1228, 1232, 1250, 1286, 5813, 7048 ns/op 312 | Iteration 5: n = 26229, mean = 1210 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 1162, 1204, 1228, 1232, 1250, 1309, 5213, 6416 ns/op 313 | 314 | # Run progress: 53.33% complete, ETA 00:03:35 315 | # Fork: 2 of 5 316 | # Warmup Iteration 1: n = 22558, mean = 3437 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 914, 1216, 2500, 7624, 45658, 120602, 243426, 14123008 ns/op 317 | # Warmup Iteration 2: n = 13157, mean = 1219 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 950, 1210, 1232, 1254, 1302, 1690, 10300, 10896 ns/op 318 | # Warmup Iteration 3: n = 13096, mean = 1220 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 945, 1214, 1234, 1240, 1258, 1413, 9030, 9952 ns/op 319 | # Warmup Iteration 4: n = 13127, mean = 1218 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 924, 1214, 1234, 1240, 1270, 1536, 7456, 7576 ns/op 320 | # Warmup Iteration 5: n = 13112, mean = 1219 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 982, 1214, 1236, 1240, 1252, 1294, 7740, 7752 ns/op 321 | Iteration 1: n = 26232, mean = 1218 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 914, 1214, 1234, 1238, 1254, 1307, 5428, 7488 ns/op 322 | Iteration 2: n = 26213, mean = 1220 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 915, 1214, 1234, 1238, 1256, 1401, 8445, 8896 ns/op 323 | Iteration 3: n = 25980, mean = 1219 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 934, 1216, 1234, 1236, 1254, 1334, 7038, 15344 ns/op 324 | Iteration 4: n = 26116, mean = 1220 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 923, 1214, 1234, 1238, 1254, 1411, 7967, 8544 ns/op 325 | Iteration 5: n = 26165, mean = 1216 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 899, 1212, 1234, 1236, 1252, 1343, 4194, 8056 ns/op 326 | 327 | # Run progress: 56.67% complete, ETA 00:03:20 328 | # Fork: 3 of 5 329 | # Warmup Iteration 1: n = 22829, mean = 3361 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 970, 1234, 2484, 7396, 42374, 115009, 259208, 14024704 ns/op 330 | # Warmup Iteration 2: n = 13224, mean = 1210 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 988, 1200, 1228, 1244, 1290, 1599, 7227, 7792 ns/op 331 | # Warmup Iteration 3: n = 13184, mean = 1207 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 912, 1200, 1224, 1232, 1244, 1530, 7093, 8112 ns/op 332 | # Warmup Iteration 4: n = 13209, mean = 1218 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 955, 1200, 1222, 1226, 1250, 1515, 94087, 123136 ns/op 333 | # Warmup Iteration 5: n = 13079, mean = 1225 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 931, 1212, 1240, 1252, 1274, 1481, 97595, 136704 ns/op 334 | Iteration 1: n = 26590, mean = 1207 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 915, 1200, 1224, 1234, 1258, 1396, 6160, 8640 ns/op 335 | Iteration 2: n = 26523, mean = 1212 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 912, 1200, 1222, 1224, 1256, 1522, 17433, 136960 ns/op 336 | Iteration 3: n = 26394, mean = 1205 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 1040, 1198, 1222, 1224, 1246, 1437, 6789, 9360 ns/op 337 | Iteration 4: n = 26564, mean = 1205 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 963, 1198, 1222, 1224, 1246, 1421, 7600, 11600 ns/op 338 | Iteration 5: n = 26475, mean = 1204 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 920, 1198, 1222, 1224, 1246, 1379, 4887, 6120 ns/op 339 | 340 | # Run progress: 60.00% complete, ETA 00:03:04 341 | # Fork: 4 of 5 342 | # Warmup Iteration 1: n = 22443, mean = 3449 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 894, 1208, 2476, 7662, 45391, 114930, 272693, 13942784 ns/op 343 | # Warmup Iteration 2: n = 13207, mean = 1218 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 899, 1198, 1224, 1240, 1272, 1577, 121827, 176384 ns/op 344 | # Warmup Iteration 3: n = 13212, mean = 1204 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 926, 1198, 1220, 1226, 1244, 1419, 8864, 8864 ns/op 345 | # Warmup Iteration 4: n = 13284, mean = 1201 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 950, 1196, 1218, 1224, 1238, 1399, 3688, 3760 ns/op 346 | # Warmup Iteration 5: n = 13258, mean = 1204 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 951, 1198, 1220, 1224, 1238, 1440, 9035, 9968 ns/op 347 | Iteration 1: n = 26486, mean = 1203 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 904, 1198, 1220, 1226, 1240, 1370, 5547, 9248 ns/op 348 | Iteration 2: n = 26210, mean = 1213 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 886, 1198, 1220, 1224, 1236, 1391, 64903, 125952 ns/op 349 | Iteration 3: n = 25996, mean = 1218 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 1046, 1198, 1220, 1224, 1236, 1422, 84292, 136192 ns/op 350 | Iteration 4: n = 26488, mean = 1205 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 918, 1200, 1222, 1226, 1240, 1395, 5712, 6648 ns/op 351 | Iteration 5: n = 26318, mean = 1204 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 921, 1200, 1222, 1226, 1240, 1329, 4011, 7976 ns/op 352 | 353 | # Run progress: 63.33% complete, ETA 00:02:49 354 | # Fork: 5 of 5 355 | # Warmup Iteration 1: n = 22514, mean = 3381 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 913, 1224, 1550, 7466, 46618, 116275, 246543, 14090240 ns/op 356 | # Warmup Iteration 2: n = 13132, mean = 1219 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 931, 1216, 1232, 1256, 1294, 1583, 3612, 3660 ns/op 357 | # Warmup Iteration 3: n = 13091, mean = 1212 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 900, 1214, 1228, 1232, 1246, 1357, 3226, 3280 ns/op 358 | # Warmup Iteration 4: n = 13234, mean = 1220 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 919, 1220, 1230, 1234, 1240, 1411, 13643, 16992 ns/op 359 | # Warmup Iteration 5: n = 13194, mean = 1216 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 961, 1216, 1230, 1238, 1316, 1432, 3083, 3092 ns/op 360 | Iteration 1: n = 26451, mean = 1217 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 952, 1216, 1230, 1234, 1242, 1315, 5688, 7312 ns/op 361 | Iteration 2: n = 26252, mean = 1224 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 923, 1212, 1230, 1236, 1254, 1384, 48079, 151296 ns/op 362 | Iteration 3: n = 26390, mean = 1218 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 911, 1210, 1232, 1236, 1256, 1429, 5714, 114560 ns/op 363 | Iteration 4: n = 26414, mean = 1214 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 949, 1210, 1230, 1236, 1254, 1447, 6022, 6240 ns/op 364 | Iteration 5: n = 26411, mean = 1214 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 956, 1210, 1230, 1236, 1252, 1385, 5428, 10528 ns/op 365 | 366 | 367 | Result "textWireSerializationWithEnum": 368 | 1211.706 ±(99.9%) 1.879 ns/op [Average] 369 | (min, avg, max) = (886.000, 1211.706, 151296.000), stdev = 462.999 370 | CI (99.9%): [1209.827, 1213.584] (assumes normal distribution) 371 | Samples, N = 657693 372 | mean = 1211.706 ±(99.9%) 1.879 ns/op 373 | min = 886.000 ns/op 374 | p( 0.0000) = 886.000 ns/op 375 | p(50.0000) = 1206.000 ns/op 376 | p(90.0000) = 1228.000 ns/op 377 | p(95.0000) = 1234.000 ns/op 378 | p(99.0000) = 1250.000 ns/op 379 | p(99.9000) = 1382.000 ns/op 380 | p(99.9900) = 6209.224 ns/op 381 | p(99.9990) = 117848.607 ns/op 382 | p(99.9999) = 151296.000 ns/op 383 | max = 151296.000 ns/op 384 | 385 | 386 | # JMH 1.10.3 (released 43 days ago) 387 | # VM version: JDK 1.8.0_51, VM 25.51-b03 388 | # VM invoker: /opt/jdk1.8.0_51/jre/bin/java 389 | # VM options: -Xmx1g -Didea.launcher.port=7539 -Didea.launcher.bin.path=/opt/idea-IU-142.4245.2/bin -Dfile.encoding=UTF-8 390 | # Warmup: 5 iterations, 1 s each 391 | # Measurement: 5 iterations, 2 s each 392 | # Timeout: 10 min per iteration 393 | # Threads: 1 thread, will synchronize iterations 394 | # Benchmark mode: Sampling time 395 | # Benchmark: lambda.LambdaSerialization.wireSerialization 396 | 397 | # Run progress: 66.67% complete, ETA 00:02:34 398 | # Fork: 1 of 5 399 | # Warmup Iteration 1: n = 26494, mean = 19917 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11584, 13344, 26304, 30464, 98586, 312863, 794888, 27066368 ns/op 400 | # Warmup Iteration 2: n = 20772, mean = 12272 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11248, 11856, 12384, 12592, 14372, 26848, 191861, 4456448 ns/op 401 | # Warmup Iteration 3: n = 10681, mean = 12026 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10848, 11696, 11872, 11968, 13987, 20615, 2695315, 2887680 ns/op 402 | # Warmup Iteration 4: n = 10621, mean = 11868 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11312, 11760, 12016, 12176, 15152, 19780, 37139, 38080 ns/op 403 | # Warmup Iteration 5: n = 10679, mean = 11873 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11392, 11840, 12016, 12080, 12912, 19519, 28537, 28896 ns/op 404 | Iteration 1: n = 21221, mean = 11919 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11376, 11872, 12048, 12112, 14268, 19506, 32879, 35968 ns/op 405 | Iteration 2: n = 21298, mean = 11843 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11376, 11808, 12016, 12080, 12368, 17178, 23145, 25984 ns/op 406 | Iteration 3: n = 21226, mean = 12169 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11424, 11840, 12048, 12096, 12240, 17158, 21752, 6406144 ns/op 407 | Iteration 4: n = 21120, mean = 12315 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11408, 11856, 12048, 12112, 12384, 16465, 22167, 9207808 ns/op 408 | Iteration 5: n = 21195, mean = 11876 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11408, 11840, 12032, 12096, 12384, 16724, 20888, 23840 ns/op 409 | 410 | # Run progress: 70.00% complete, ETA 00:02:18 411 | # Fork: 2 of 5 412 | # Warmup Iteration 1: n = 26961, mean = 19569 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11328, 12848, 26400, 30272, 104497, 315347, 781131, 27131904 ns/op 413 | # Warmup Iteration 2: n = 20710, mean = 12261 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11008, 11920, 12432, 12560, 15504, 38854, 207035, 3497984 ns/op 414 | # Warmup Iteration 3: n = 10618, mean = 12123 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11136, 11776, 12048, 12144, 14583, 21190, 2740600, 2916352 ns/op 415 | # Warmup Iteration 4: n = 10586, mean = 11882 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11136, 11776, 12208, 12352, 14224, 20202, 168031, 170240 ns/op 416 | # Warmup Iteration 5: n = 10645, mean = 11829 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11104, 11648, 11920, 12048, 15008, 45919, 141915, 142080 ns/op 417 | Iteration 1: n = 21358, mean = 11875 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11104, 11680, 11936, 12016, 12484, 20062, 140917, 2424832 ns/op 418 | Iteration 2: n = 21399, mean = 11713 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11120, 11680, 11936, 12016, 12272, 19027, 26074, 34176 ns/op 419 | Iteration 3: n = 21390, mean = 11720 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11088, 11664, 11920, 12000, 14449, 17730, 24259, 93056 ns/op 420 | Iteration 4: n = 21325, mean = 11687 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11088, 11664, 11904, 11968, 12160, 18827, 21587, 21632 ns/op 421 | Iteration 5: n = 21427, mean = 11698 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11040, 11648, 11888, 11968, 12144, 17011, 23113, 733184 ns/op 422 | 423 | # Run progress: 73.33% complete, ETA 00:02:03 424 | # Fork: 3 of 5 425 | # Warmup Iteration 1: n = 17249, mean = 30396 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 18528, 24800, 29056, 34432, 129216, 389120, 8148070, 27394048 ns/op 426 | # Warmup Iteration 2: n = 20008, mean = 12429 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10784, 11680, 15424, 16640, 19133, 49602, 196347, 222976 ns/op 427 | # Warmup Iteration 3: n = 11085, mean = 11347 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10816, 11296, 11504, 11584, 13362, 20103, 27450, 27808 ns/op 428 | # Warmup Iteration 4: n = 11111, mean = 11345 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10832, 11312, 11504, 11600, 11998, 18624, 20814, 20864 ns/op 429 | # Warmup Iteration 5: n = 11123, mean = 11375 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10768, 11296, 11536, 11664, 13436, 20508, 127075, 130816 ns/op 430 | Iteration 1: n = 22140, mean = 11387 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10832, 11328, 11536, 11616, 13952, 19754, 25164, 27840 ns/op 431 | Iteration 2: n = 22350, mean = 11279 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10784, 11264, 11440, 11520, 11776, 15688, 23720, 69248 ns/op 432 | Iteration 3: n = 22131, mean = 11349 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10720, 11232, 11424, 11520, 12588, 21580, 148815, 153856 ns/op 433 | Iteration 4: n = 22126, mean = 11380 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10832, 11280, 11456, 11536, 11920, 21218, 150877, 154368 ns/op 434 | Iteration 5: n = 22059, mean = 11332 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10800, 11280, 11456, 11520, 11808, 18134, 146152, 148992 ns/op 435 | 436 | # Run progress: 76.67% complete, ETA 00:01:47 437 | # Fork: 4 of 5 438 | # Warmup Iteration 1: n = 25419, mean = 20870 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11632, 13024, 29728, 39552, 115098, 340777, 1861716, 28311552 ns/op 439 | # Warmup Iteration 2: n = 20713, mean = 12038 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11136, 11824, 12304, 12544, 16576, 27996, 189915, 192256 ns/op 440 | # Warmup Iteration 3: n = 10716, mean = 11767 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11168, 11712, 11984, 12064, 14261, 19725, 56987, 59008 ns/op 441 | # Warmup Iteration 4: n = 10636, mean = 11805 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11232, 11760, 12080, 12176, 12734, 16486, 23746, 23872 ns/op 442 | # Warmup Iteration 5: n = 10858, mean = 11583 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11152, 11552, 11760, 11840, 12064, 18976, 52217, 55232 ns/op 443 | Iteration 1: n = 21639, mean = 11592 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11184, 11552, 11776, 11856, 12144, 16913, 21185, 21920 ns/op 444 | Iteration 2: n = 21606, mean = 11593 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11136, 11552, 11776, 11872, 12592, 17093, 20251, 20736 ns/op 445 | Iteration 3: n = 21655, mean = 11603 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11088, 11568, 11808, 11888, 12080, 18710, 26195, 27040 ns/op 446 | Iteration 4: n = 21643, mean = 11606 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11136, 11568, 11808, 11888, 12080, 17732, 19360, 19712 ns/op 447 | Iteration 5: n = 21624, mean = 11606 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 11152, 11568, 11808, 11888, 12096, 15308, 20424, 23136 ns/op 448 | 449 | # Run progress: 80.00% complete, ETA 00:01:32 450 | # Fork: 5 of 5 451 | # Warmup Iteration 1: n = 15349, mean = 34166 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 23360, 24704, 37376, 46880, 156928, 446618, 13379410, 27328512 ns/op 452 | # Warmup Iteration 2: n = 17800, mean = 13938 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10656, 11760, 20672, 25408, 29632, 180326, 224445, 227840 ns/op 453 | # Warmup Iteration 3: n = 10984, mean = 11579 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10784, 11312, 11600, 11728, 14373, 130319, 194637, 199680 ns/op 454 | # Warmup Iteration 4: n = 10872, mean = 11681 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10848, 11520, 11920, 12539, 15428, 19284, 30743, 31232 ns/op 455 | # Warmup Iteration 5: n = 11068, mean = 11431 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10832, 11376, 11648, 11728, 12645, 19644, 75308, 81664 ns/op 456 | Iteration 1: n = 22133, mean = 11411 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10800, 11376, 11648, 11728, 11952, 16407, 21997, 22560 ns/op 457 | Iteration 2: n = 22247, mean = 11324 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10704, 11296, 11568, 11648, 11864, 18424, 22040, 26784 ns/op 458 | Iteration 3: n = 22358, mean = 11268 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10656, 11232, 11488, 11568, 11943, 18111, 22681, 23296 ns/op 459 | Iteration 4: n = 22373, mean = 11531 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10768, 11232, 11488, 11568, 11760, 18272, 24287, 6045696 ns/op 460 | Iteration 5: n = 22250, mean = 11274 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 10704, 11232, 11488, 11584, 12216, 18808, 20558, 20768 ns/op 461 | 462 | 463 | Result "wireSerialization": 464 | 11609.247 ±(99.9%) 78.690 ns/op [Average] 465 | (min, avg, max) = (10656.000, 11609.247, 9207808.000), stdev = 17626.684 466 | CI (99.9%): [11530.557, 11687.937] (assumes normal distribution) 467 | Samples, N = 543293 468 | mean = 11609.247 ±(99.9%) 78.690 ns/op 469 | min = 10656.000 ns/op 470 | p( 0.0000) = 10656.000 ns/op 471 | p(50.0000) = 11536.000 ns/op 472 | p(90.0000) = 11904.000 ns/op 473 | p(95.0000) = 12000.000 ns/op 474 | p(99.0000) = 12240.000 ns/op 475 | p(99.9000) = 18400.000 ns/op 476 | p(99.9900) = 45973.837 ns/op 477 | p(99.9990) = 482591.401 ns/op 478 | p(99.9999) = 9207808.000 ns/op 479 | max = 9207808.000 ns/op 480 | 481 | 482 | # JMH 1.10.3 (released 43 days ago) 483 | # VM version: JDK 1.8.0_51, VM 25.51-b03 484 | # VM invoker: /opt/jdk1.8.0_51/jre/bin/java 485 | # VM options: -Xmx1g -Didea.launcher.port=7539 -Didea.launcher.bin.path=/opt/idea-IU-142.4245.2/bin -Dfile.encoding=UTF-8 486 | # Warmup: 5 iterations, 1 s each 487 | # Measurement: 5 iterations, 2 s each 488 | # Timeout: 10 min per iteration 489 | # Threads: 1 thread, will synchronize iterations 490 | # Benchmark mode: Sampling time 491 | # Benchmark: lambda.LambdaSerialization.wireSerializationWithEnum 492 | 493 | # Run progress: 83.33% complete, ETA 00:01:17 494 | # Fork: 1 of 5 495 | # Warmup Iteration 1: n = 25210, mean = 2883 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 736, 943, 2528, 5836, 36729, 88293, 302289, 13697024 ns/op 496 | # Warmup Iteration 2: n = 16965, mean = 948 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 756, 940, 951, 1009, 1074, 1260, 8999, 12560 ns/op 497 | # Warmup Iteration 3: n = 16633, mean = 966 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 798, 964, 973, 976, 985, 1068, 5173, 7184 ns/op 498 | # Warmup Iteration 4: n = 16589, mean = 970 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 762, 964, 974, 978, 1102, 1252, 7232, 7232 ns/op 499 | # Warmup Iteration 5: n = 16570, mean = 968 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 835, 964, 975, 978, 1064, 1233, 6972, 9264 ns/op 500 | Iteration 1: n = 33314, mean = 965 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 761, 963, 973, 976, 987, 1058, 5956, 7576 ns/op 501 | Iteration 2: n = 33307, mean = 967 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 767, 963, 974, 978, 989, 1179, 4294, 8800 ns/op 502 | Iteration 3: n = 33245, mean = 969 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 781, 964, 977, 983, 992, 1189, 7423, 8152 ns/op 503 | Iteration 4: n = 33235, mean = 968 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 782, 964, 977, 982, 991, 1158, 4888, 8192 ns/op 504 | Iteration 5: n = 33182, mean = 968 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 766, 964, 977, 983, 992, 1198, 7920, 10624 ns/op 505 | 506 | # Run progress: 86.67% complete, ETA 00:01:01 507 | # Fork: 2 of 5 508 | # Warmup Iteration 1: n = 25862, mean = 2914 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 732, 941, 1923, 6735, 38767, 93359, 313673, 13434880 ns/op 509 | # Warmup Iteration 2: n = 17014, mean = 944 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 751, 940, 951, 969, 1002, 1210, 4583, 5032 ns/op 510 | # Warmup Iteration 3: n = 16999, mean = 944 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 757, 942, 952, 957, 975, 1178, 5659, 6936 ns/op 511 | # Warmup Iteration 4: n = 16990, mean = 946 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 747, 944, 953, 956, 967, 1236, 4487, 5080 ns/op 512 | # Warmup Iteration 5: n = 16956, mean = 945 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 756, 943, 952, 956, 970, 1256, 9620, 10544 ns/op 513 | Iteration 1: n = 33983, mean = 944 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 738, 943, 953, 957, 975, 1342, 4092, 8624 ns/op 514 | Iteration 2: n = 33954, mean = 946 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 741, 944, 954, 958, 976, 1381, 6167, 9008 ns/op 515 | Iteration 3: n = 34021, mean = 943 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 747, 942, 951, 955, 970, 1178, 5749, 8432 ns/op 516 | Iteration 4: n = 33987, mean = 946 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 765, 943, 953, 958, 974, 1186, 8415, 12176 ns/op 517 | Iteration 5: n = 34002, mean = 945 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 753, 943, 952, 955, 968, 1114, 6584, 8720 ns/op 518 | 519 | # Run progress: 90.00% complete, ETA 00:00:46 520 | # Fork: 3 of 5 521 | # Warmup Iteration 1: n = 25185, mean = 2927 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 776, 984, 2858, 5790, 35657, 93601, 303959, 13484032 ns/op 522 | # Warmup Iteration 2: n = 16806, mean = 990 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 795, 984, 995, 1036, 1106, 1392, 6715, 7456 ns/op 523 | # Warmup Iteration 3: n = 16895, mean = 984 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 807, 984, 992, 994, 1002, 1122, 3234, 4384 ns/op 524 | # Warmup Iteration 4: n = 16539, mean = 2141 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 802, 987, 998, 1009, 1041, 1284, 6594676, 19005440 ns/op 525 | # Warmup Iteration 5: n = 16706, mean = 985 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 793, 984, 993, 998, 1016, 1111, 5572, 5712 ns/op 526 | Iteration 1: n = 33624, mean = 986 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 837, 985, 994, 997, 1010, 1066, 5105, 5896 ns/op 527 | Iteration 2: n = 33655, mean = 986 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 805, 986, 995, 999, 1013, 1059, 4590, 6296 ns/op 528 | Iteration 3: n = 33296, mean = 986 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 833, 985, 994, 998, 1011, 1104, 5136, 6440 ns/op 529 | Iteration 4: n = 33608, mean = 991 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 796, 985, 994, 998, 1012, 1070, 5607, 179456 ns/op 530 | Iteration 5: n = 33751, mean = 986 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 916, 985, 994, 999, 1013, 1069, 3379, 6024 ns/op 531 | 532 | # Run progress: 93.33% complete, ETA 00:00:30 533 | # Fork: 4 of 5 534 | # Warmup Iteration 1: n = 25406, mean = 2865 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 749, 942, 3144, 5709, 36476, 90218, 282579, 13336576 ns/op 535 | # Warmup Iteration 2: n = 16932, mean = 948 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 744, 941, 952, 965, 1144, 1348, 7684, 8072 ns/op 536 | # Warmup Iteration 3: n = 17041, mean = 944 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 769, 942, 955, 960, 978, 1170, 4626, 7632 ns/op 537 | # Warmup Iteration 4: n = 17019, mean = 946 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 754, 941, 955, 961, 1062, 1222, 7803, 8112 ns/op 538 | # Warmup Iteration 5: n = 17028, mean = 942 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 794, 941, 953, 957, 972, 1156, 3216, 7640 ns/op 539 | Iteration 1: n = 34091, mean = 944 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 754, 942, 954, 958, 973, 1125, 6024, 9472 ns/op 540 | Iteration 2: n = 33982, mean = 945 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 746, 941, 954, 960, 1060, 1206, 4955, 7560 ns/op 541 | Iteration 3: n = 33814, mean = 942 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 753, 940, 951, 955, 966, 1071, 6158, 7840 ns/op 542 | Iteration 4: n = 34060, mean = 943 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 807, 941, 953, 957, 969, 1064, 5159, 11856 ns/op 543 | Iteration 5: n = 34114, mean = 942 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 751, 940, 952, 956, 968, 1121, 4752, 8304 ns/op 544 | 545 | # Run progress: 96.67% complete, ETA 00:00:15 546 | # Fork: 5 of 5 547 | # Warmup Iteration 1: n = 24499, mean = 3006 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 734, 947, 2044, 7192, 38912, 98304, 338163, 13418496 ns/op 548 | # Warmup Iteration 2: n = 16856, mean = 954 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 751, 946, 956, 991, 1174, 1505, 5468, 6664 ns/op 549 | # Warmup Iteration 3: n = 16963, mean = 1144 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 744, 947, 955, 959, 1082, 1356, 1007559, 3289088 ns/op 550 | # Warmup Iteration 4: n = 16924, mean = 948 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 745, 947, 955, 958, 1028, 1236, 6146, 6224 ns/op 551 | # Warmup Iteration 5: n = 16735, mean = 949 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 750, 948, 956, 958, 972, 1152, 7193, 8864 ns/op 552 | Iteration 1: n = 33698, mean = 951 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 756, 950, 959, 961, 974, 1165, 4448, 7376 ns/op 553 | Iteration 2: n = 33565, mean = 953 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 756, 952, 960, 962, 973, 1108, 5078, 6496 ns/op 554 | Iteration 3: n = 32965, mean = 953 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 754, 952, 959, 962, 987, 1182, 7406, 9408 ns/op 555 | Iteration 4: n = 33300, mean = 959 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 747, 952, 960, 962, 974, 1155, 6309, 180992 ns/op 556 | Iteration 5: n = 33710, mean = 951 ns/op, p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = 769, 952, 959, 961, 971, 1071, 2806, 3268 ns/op 557 | 558 | 559 | Result "wireSerializationWithEnum": 560 | 959.071 ±(99.9%) 1.027 ns/op [Average] 561 | (min, avg, max) = (738.000, 959.071, 180992.000), stdev = 286.298 562 | CI (99.9%): [958.044, 960.098] (assumes normal distribution) 563 | Samples, N = 841463 564 | mean = 959.071 ±(99.9%) 1.027 ns/op 565 | min = 738.000 ns/op 566 | p( 0.0000) = 738.000 ns/op 567 | p(50.0000) = 954.000 ns/op 568 | p(90.0000) = 986.000 ns/op 569 | p(95.0000) = 990.000 ns/op 570 | p(99.0000) = 1002.000 ns/op 571 | p(99.9000) = 1146.000 ns/op 572 | p(99.9900) = 4885.658 ns/op 573 | p(99.9990) = 9341.658 ns/op 574 | p(99.9999) = 180992.000 ns/op 575 | max = 180992.000 ns/op 576 | 577 | 578 | # Run complete. Total time: 00:07:42 579 | 580 | Benchmark Mode Cnt Score Error Units 581 | LambdaSerialization.javaSerialization sample 712792 35072.375 ± 280.589 ns/op 582 | LambdaSerialization.javaSerializationWithEnum sample 774744 8125.881 ± 145.959 ns/op 583 | LambdaSerialization.textWireSerialization sample 603032 20794.736 ± 84.241 ns/op 584 | LambdaSerialization.textWireSerializationWithEnum sample 657693 1211.706 ± 1.879 ns/op 585 | LambdaSerialization.wireSerialization sample 543293 11609.247 ± 78.690 ns/op 586 | LambdaSerialization.wireSerializationWithEnum sample 841463 959.071 ± 1.027 ns/op 587 | -------------------------------------------------------------------------------- /src/main/java/utf8/AllMain.java: -------------------------------------------------------------------------------- 1 | package utf8; 2 | 3 | import org.openjdk.jmh.runner.Runner; 4 | import org.openjdk.jmh.runner.RunnerException; 5 | import org.openjdk.jmh.runner.options.Options; 6 | import org.openjdk.jmh.runner.options.OptionsBuilder; 7 | 8 | /** 9 | * Created by peter.lawrey on 25/07/2015. 10 | */ 11 | public class AllMain { 12 | 13 | // run with -Xmx64m 14 | public static void main(String[] args) throws RunnerException { 15 | Options opt = new OptionsBuilder() 16 | .include(DecodeMain.class.getSimpleName()) 17 | .include(EncodeMain.class.getSimpleName()) 18 | .forks(1) 19 | .build(); 20 | 21 | new Runner(opt).run(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/utf8/DecodeMain.java: -------------------------------------------------------------------------------- 1 | package utf8; 2 | 3 | import org.openjdk.jmh.annotations.Benchmark; 4 | import org.openjdk.jmh.annotations.Scope; 5 | import org.openjdk.jmh.annotations.State; 6 | import org.openjdk.jmh.runner.Runner; 7 | import org.openjdk.jmh.runner.RunnerException; 8 | import org.openjdk.jmh.runner.options.Options; 9 | import org.openjdk.jmh.runner.options.OptionsBuilder; 10 | import sun.misc.Unsafe; 11 | import sun.nio.ch.DirectBuffer; 12 | 13 | import java.lang.reflect.Field; 14 | import java.nio.ByteBuffer; 15 | import java.nio.charset.Charset; 16 | 17 | /** 18 | * Created by peter.lawrey on 24/07/2015. 19 | */ 20 | @State(Scope.Thread) 21 | public class DecodeMain { 22 | static final String text = "0123456789" + 23 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + 24 | "abcdefghijklmnopqrstuvwxyz-_" + 25 | "0123456789" + 26 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + 27 | "abcdefghijklmnopqrstuvwxyz-_"; 28 | 29 | static final Unsafe UNSAFE; 30 | 31 | static final Field VALUE, COUNT; 32 | private static final Charset UTF_8 = Charset.forName("UTF-8"); 33 | 34 | static { 35 | assert text.length() == 128; 36 | try { 37 | Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe"); 38 | theUnsafe.setAccessible(true); 39 | UNSAFE = (Unsafe) theUnsafe.get(null); 40 | 41 | VALUE = Class.forName("java.lang.AbstractStringBuilder").getDeclaredField("value"); 42 | VALUE.setAccessible(true); 43 | 44 | COUNT = Class.forName("java.lang.AbstractStringBuilder").getDeclaredField("count"); 45 | COUNT.setAccessible(true); 46 | 47 | } catch (Exception e) { 48 | throw new AssertionError(e); 49 | } 50 | } 51 | 52 | ByteBuffer bb = ByteBuffer.allocateDirect(128); // plenty for a 64 character string. 53 | StringBuilder sb = new StringBuilder(); 54 | 55 | { 56 | bb.clear(); 57 | bb.put(text.getBytes(UTF_8)); 58 | } 59 | 60 | public static void main(String[] args) throws RunnerException { 61 | Options opt = new OptionsBuilder() 62 | .include(DecodeMain.class.getSimpleName()) 63 | .forks(1) 64 | .build(); 65 | 66 | new Runner(opt).run(); 67 | } 68 | 69 | @Benchmark 70 | public CharSequence decode_fromUTF8() { 71 | bb.clear(); 72 | byte[] bytes = new byte[bb.remaining()]; 73 | bb.get(bytes); 74 | String s = new String(bytes, UTF_8); 75 | assert s.equals(text); 76 | return s; 77 | } 78 | 79 | @Benchmark 80 | public CharSequence decode_usingSimpleLoop() { 81 | bb.clear(); 82 | sb.setLength(0); 83 | ascii: 84 | { 85 | while (bb.remaining() > 0) { 86 | byte b = bb.get(); 87 | if (b < 0) break ascii; 88 | sb.append((char) b); 89 | } 90 | assert sb.toString().equals(text); 91 | return sb; 92 | } 93 | throw new UnsupportedOperationException("Handled in full implementation"); 94 | } 95 | 96 | @Benchmark 97 | public CharSequence decode_usingCharArray() throws IllegalAccessException { 98 | bb.clear(); 99 | sb.setLength(0); 100 | int len = bb.capacity(); 101 | sb.ensureCapacity(len); 102 | char[] chars = (char[]) VALUE.get(sb); 103 | int i = 0; 104 | ascii: 105 | { 106 | for (; i < len; i++) { 107 | byte b = bb.get(); 108 | if (b < 0) break ascii; 109 | chars[i] = (char) b; 110 | } 111 | COUNT.set(sb, len); 112 | assert sb.toString().equals(text); 113 | return sb; 114 | } 115 | throw new UnsupportedOperationException("Handled in full implementation"); 116 | } 117 | 118 | @Benchmark 119 | public CharSequence decode_usingCharArrayAndAddress() throws IllegalAccessException { 120 | long address = ((DirectBuffer) bb).address(); 121 | sb.setLength(0); 122 | int len = bb.capacity(); 123 | sb.ensureCapacity(len); 124 | char[] chars = (char[]) VALUE.get(sb); 125 | int i = 0; 126 | ascii: 127 | { 128 | for (; i < len; i++) { 129 | byte b = UNSAFE.getByte(address + i); 130 | if (b < 0) break ascii; 131 | chars[i] = (char) b; 132 | } 133 | COUNT.set(sb, len); 134 | assert sb.toString().equals(text); 135 | return sb; 136 | } 137 | throw new UnsupportedOperationException("Handled in full implementation"); 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /src/main/java/utf8/EncodeMain.java: -------------------------------------------------------------------------------- 1 | package utf8; 2 | 3 | import org.openjdk.jmh.annotations.Benchmark; 4 | import org.openjdk.jmh.annotations.Scope; 5 | import org.openjdk.jmh.annotations.State; 6 | import org.openjdk.jmh.runner.Runner; 7 | import org.openjdk.jmh.runner.RunnerException; 8 | import org.openjdk.jmh.runner.options.Options; 9 | import org.openjdk.jmh.runner.options.OptionsBuilder; 10 | import sun.misc.Unsafe; 11 | import sun.nio.ch.DirectBuffer; 12 | 13 | import java.lang.reflect.Field; 14 | import java.nio.ByteBuffer; 15 | import java.nio.charset.Charset; 16 | 17 | /** 18 | * The purpose of this test is to converting a CharSequence to a direct buffer. 19 | */ 20 | @State(Scope.Thread) 21 | public class EncodeMain { 22 | static final String text = "0123456789" + 23 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + 24 | "abcdefghijklmnopqrstuvwxyz-_" + 25 | "0123456789" + 26 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + 27 | "abcdefghijklmnopqrstuvwxyz-_"; 28 | 29 | static final Unsafe UNSAFE; 30 | 31 | static final Field VALUE; 32 | private static final Charset UTF_8 = Charset.forName("UTF-8"); 33 | 34 | static { 35 | assert text.length() == 128; 36 | try { 37 | Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe"); 38 | theUnsafe.setAccessible(true); 39 | UNSAFE = (Unsafe) theUnsafe.get(null); 40 | 41 | VALUE = String.class.getDeclaredField("value"); 42 | VALUE.setAccessible(true); 43 | 44 | } catch (Exception e) { 45 | throw new AssertionError(e); 46 | } 47 | } 48 | 49 | ByteBuffer bb = ByteBuffer.allocateDirect(128 * 3); // plenty for a 64 character string. 50 | 51 | public static void main(String[] args) throws RunnerException { 52 | Options opt = new OptionsBuilder() 53 | .include(EncodeMain.class.getSimpleName()) 54 | .forks(1) 55 | .build(); 56 | 57 | new Runner(opt).run(); 58 | } 59 | 60 | @Benchmark 61 | public ByteBuffer encode_simpleToUTF8() { 62 | bb.clear(); 63 | bb.put(text.getBytes(UTF_8)); 64 | return bb; 65 | } 66 | 67 | @Benchmark 68 | public ByteBuffer encode_usingSimpleLoop() { 69 | bb.clear(); 70 | ascii: 71 | { 72 | for (int i = 0; i < text.length(); i++) { 73 | char ch = text.charAt(i); 74 | if (ch > 0x7f) break ascii; 75 | bb.put((byte) ch); 76 | } 77 | return bb; 78 | } 79 | throw new UnsupportedOperationException("Handled in full implementation"); 80 | } 81 | 82 | @Benchmark 83 | public ByteBuffer encode_usingSimpleLoopUnrolled() { 84 | bb.clear(); 85 | ascii: 86 | { 87 | for (int i = 0; i < text.length() - 1; i += 2) { 88 | char ch = text.charAt(i); 89 | char ch2 = text.charAt(i + 1); 90 | if ((ch | ch2) > 0x7f) break ascii; 91 | bb.putShort((short) ((ch << 8) | ch2)); 92 | } 93 | return bb; 94 | } 95 | throw new UnsupportedOperationException("Handled in full implementation"); 96 | } 97 | 98 | @Benchmark 99 | public ByteBuffer encode_unsafeLoopCharArray() throws IllegalAccessException { 100 | long address = ((DirectBuffer) bb).address(), ptr = address; 101 | char[] value = (char[]) VALUE.get(text); 102 | if (bb.capacity() < value.length * 3) 103 | throw new AssertionError(); 104 | ascii: 105 | { 106 | for (char ch : value) { 107 | if (ch > 0x7f) break ascii; 108 | UNSAFE.putByte(ptr++, (byte) ch); 109 | } 110 | bb.position((int) (ptr - address)); 111 | return bb; 112 | } 113 | throw new UnsupportedOperationException("Handled in full implementation"); 114 | } 115 | 116 | @Benchmark 117 | public ByteBuffer encode_unsafeLoopCharAt() { 118 | long address = ((DirectBuffer) bb).address(), ptr = address; 119 | if (bb.capacity() < text.length() * 3) 120 | throw new AssertionError(); 121 | ascii: 122 | { 123 | for (int i = 0; i < text.length(); i++) { 124 | char ch = text.charAt(i); 125 | if (ch > 0x7f) break ascii; 126 | UNSAFE.putByte(ptr++, (byte) ch); 127 | } 128 | bb.position((int) (ptr - address)); 129 | return bb; 130 | } 131 | throw new UnsupportedOperationException("Handled in full implementation"); 132 | } 133 | 134 | @Benchmark 135 | public ByteBuffer encode_unsafeLoopCharAtUnrolled() { 136 | long address = ((DirectBuffer) bb).address(), ptr = address; 137 | if (bb.capacity() < text.length() * 3) 138 | throw new AssertionError(); 139 | ascii: 140 | { 141 | for (int i = 0; i < text.length() - 3; i += 4) { 142 | char ch = text.charAt(i); 143 | char ch2 = text.charAt(i + 1); 144 | char ch3 = text.charAt(i + 2); 145 | char ch4 = text.charAt(i + 3); 146 | if ((ch | ch2 | ch3 | ch4) > 0x7f) break ascii; 147 | UNSAFE.putInt(ptr, (ch << 24) | (ch2 << 16) | (ch3 << 8) | ch4); 148 | ptr += 4; 149 | } 150 | bb.position((int) (ptr - address)); 151 | return bb; 152 | } 153 | throw new UnsupportedOperationException("Handled in full implementation"); 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /src/main/java/utf8/README.md: -------------------------------------------------------------------------------- 1 | The comparison of different encoding and decoding approaches. 2 | 3 | The plan is to add more over time. 4 | 5 | Run on an i7-3790X with Oracle Java 8 update 51 and -Xmx64m (Ubuntu 15.04) 6 | ``` 7 | Benchmark Mode Cnt Score Error Units 8 | DecodeMain.decode_fromUTF8 thrpt 20 7253280.165 ± 65361.741 ops/s 9 | DecodeMain.decode_usingCharArray thrpt 20 8390367.697 ± 68847.882 ops/s 10 | DecodeMain.decode_usingCharArrayAndAddress thrpt 20 12741425.467 ± 195475.708 ops/s 11 | DecodeMain.decode_usingSimpleLoop thrpt 20 1940184.123 ± 14156.122 ops/s 12 | EncodeMain.encode_simpleToUTF8 thrpt 20 6499953.595 ± 69457.824 ops/s 13 | EncodeMain.encode_unsafeLoopCharArray thrpt 20 19799238.628 ± 107360.636 ops/s 14 | EncodeMain.encode_unsafeLoopCharAt thrpt 20 15252056.597 ± 98216.894 ops/s 15 | EncodeMain.encode_unsafeLoopCharAtUnrolled thrpt 20 15264096.424 ± 64860.594 ops/s 16 | EncodeMain.encode_usingSimpleLoop thrpt 20 8434139.748 ± 302338.290 ops/s 17 | EncodeMain.encode_usingSimpleLoopUnrolled thrpt 20 6338738.829 ± 47627.463 ops/s 18 | ``` 19 | 20 | Run on an i7-4770K with Oracle Java 8 update 51 and -Xmx64m (Windows 8.1) 21 | ``` 22 | Benchmark Mode Cnt Score Error Units 23 | DecodeMain.decode_fromUTF8 thrpt 20 6796923.881 � 22116.936 ops/s 24 | DecodeMain.decode_usingCharArray thrpt 20 8116746.205 � 26883.030 ops/s 25 | DecodeMain.decode_usingCharArrayAndAddress thrpt 20 11831718.908 � 109633.121 ops/s 26 | DecodeMain.decode_usingSimpleLoop thrpt 20 1852540.497 � 65251.968 ops/s 27 | EncodeMain.encode_simpleToUTF8 thrpt 20 6370133.609 � 50136.218 ops/s 28 | EncodeMain.encode_unsafeLoopCharArray thrpt 20 17010210.148 � 413837.676 ops/s 29 | EncodeMain.encode_unsafeLoopCharAt thrpt 20 12008413.335 � 125709.384 ops/s 30 | EncodeMain.encode_unsafeLoopCharAtUnrolled thrpt 20 11752050.579 � 43969.260 ops/s 31 | EncodeMain.encode_usingSimpleLoop thrpt 20 7895278.352 � 35139.565 ops/s 32 | EncodeMain.encode_usingSimpleLoopUnrolled thrpt 20 5620780.588 � 72783.775 ops/s 33 | ``` 34 | 35 | Run on an E5-2650 v2 with Oracle Java 8 update 51 with -Xmx64m (Ubuntu 15.04) 36 | 37 | ``` 38 | Benchmark Mode Cnt Score Error Units 39 | DecodeMain.decode_fromUTF8 thrpt 20 6286867.336 ± 86341.070 ops/s 40 | DecodeMain.decode_usingCharArray thrpt 20 8764641.857 ± 33268.734 ops/s 41 | DecodeMain.decode_usingCharArrayAndAddress thrpt 20 11328164.878 ± 75575.608 ops/s 42 | DecodeMain.decode_usingSimpleLoop thrpt 20 1832553.738 ± 7666.224 ops/s 43 | EncodeMain.encode_simpleToUTF8 thrpt 20 7545595.733 ± 185515.343 ops/s 44 | EncodeMain.encode_unsafeLoopCharArray thrpt 20 17461371.264 ± 149994.673 ops/s 45 | EncodeMain.encode_unsafeLoopCharAt thrpt 20 13724189.801 ± 79360.166 ops/s 46 | EncodeMain.encode_unsafeLoopCharAtUnrolled thrpt 20 13010919.319 ± 90522.062 ops/s 47 | EncodeMain.encode_usingSimpleLoop thrpt 20 7406851.039 ± 18440.248 ops/s 48 | EncodeMain.encode_usingSimpleLoopUnrolled thrpt 20 6316219.982 ± 53603.212 ops/s 49 | ``` --------------------------------------------------------------------------------