1. 14 Jun, 2018 6 commits
    • Jason Zaugg's avatar
      Switch to using a precompiled class for the ClassWriter bench · 7b36b41b
      Jason Zaugg authored
      The gains are not as big as for scala.Predef.
      
      ```
      Benchmark                                                                   Mode  Cnt      Score      Error   Units
      ClassWriterBenchmark.recreateClassWriter                                   thrpt   20  48570.817 ± 2100.589   ops/s
      ClassWriterBenchmark.recreateClassWriter:+memory.used                      thrpt   20        ≈ 0              bytes
      ClassWriterBenchmark.recreateClassWriter:·gc.alloc.rate                    thrpt   20   1399.418 ±   60.651  MB/sec
      ClassWriterBenchmark.recreateClassWriter:·gc.alloc.rate.norm               thrpt   20  45392.022 ±    0.049    B/op
      ClassWriterBenchmark.recreateClassWriter:·gc.churn.PS_Eden_Space           thrpt   20   1354.515 ±   66.035  MB/sec
      ClassWriterBenchmark.recreateClassWriter:·gc.churn.PS_Eden_Space.norm      thrpt   20  43934.670 ±  910.390    B/op
      ClassWriterBenchmark.recreateClassWriter:·gc.churn.PS_Survivor_Space       thrpt   20      0.239 ±    0.080  MB/sec
      ClassWriterBenchmark.recreateClassWriter:·gc.churn.PS_Survivor_Space.norm  thrpt   20      7.696 ±    2.499    B/op
      ClassWriterBenchmark.recreateClassWriter:·gc.count                         thrpt   20    275.000             counts
      ClassWriterBenchmark.recreateClassWriter:·gc.time                          thrpt   20    171.000                 ms
      ClassWriterBenchmark.reuseClassWriter                                      thrpt   20  53216.337 ± 1275.213   ops/s
      ClassWriterBenchmark.reuseClassWriter:+memory.used                         thrpt   20        ≈ 0              bytes
      ClassWriterBenchmark.reuseClassWriter:·gc.alloc.rate                       thrpt   20   1037.234 ±   24.764  MB/sec
      ClassWriterBenchmark.reuseClassWriter:·gc.alloc.rate.norm                  thrpt   20  30688.021 ±    0.049    B/op
      ClassWriterBenchmark.reuseClassWriter:·gc.churn.PS_Eden_Space              thrpt   20    995.349 ±   32.375  MB/sec
      ClassWriterBenchmark.reuseClassWriter:·gc.churn.PS_Eden_Space.norm         thrpt   20  29453.143 ±  775.669    B/op
      ClassWriterBenchmark.reuseClassWriter:·gc.churn.PS_Survivor_Space          thrpt   20      0.214 ±    0.069  MB/sec
      ClassWriterBenchmark.reuseClassWriter:·gc.churn.PS_Survivor_Space.norm     thrpt   20      6.323 ±    2.010    B/op
      ClassWriterBenchmark.reuseClassWriter:·gc.count                            thrpt   20    273.000             counts
      ClassWriterBenchmark.reuseClassWriter:·gc.time                             thrpt   20    163.000                 ms
      ```
      7b36b41b
    • Jason Zaugg's avatar
      Create a dedicated benchmark for ClassWriter reuse · 0d0558a3
      Jason Zaugg authored
      Test with a dump of scala/Predef.class for a more realistic workload
      than the previous "hello world" example n ASMGenerator.
      
      ```
      Benchmark                                                                   Mode  Cnt       Score      Error   Units
      ClassWriterBenchmark.recreateClassWriter                                   thrpt   20   19663.640 ±  539.701   ops/s
      ClassWriterBenchmark.recreateClassWriter:+memory.used                      thrpt   20       0.233 ±    0.377   bytes
      ClassWriterBenchmark.recreateClassWriter:·gc.alloc.rate                    thrpt   20    1542.841 ±   42.255  MB/sec
      ClassWriterBenchmark.recreateClassWriter:·gc.alloc.rate.norm               thrpt   20  123578.119 ±    8.020    B/op
      ClassWriterBenchmark.recreateClassWriter:·gc.churn.PS_Eden_Space           thrpt   20    1490.451 ±   62.050  MB/sec
      ClassWriterBenchmark.recreateClassWriter:·gc.churn.PS_Eden_Space.norm      thrpt   20  119352.164 ± 2918.083    B/op
      ClassWriterBenchmark.recreateClassWriter:·gc.churn.PS_Survivor_Space       thrpt   20       0.216 ±    0.036  MB/sec
      ClassWriterBenchmark.recreateClassWriter:·gc.churn.PS_Survivor_Space.norm  thrpt   20      17.329 ±    2.857    B/op
      ClassWriterBenchmark.recreateClassWriter:·gc.count                         thrpt   20     234.000             counts
      ClassWriterBenchmark.recreateClassWriter:·gc.time                          thrpt   20     164.000                 ms
      ClassWriterBenchmark.recreateClassWriter:·stack                            thrpt              NaN                ---
      ClassWriterBenchmark.reuseClassWriter                                      thrpt   20   23196.568 ±  525.351   ops/s
      ClassWriterBenchmark.reuseClassWriter:+memory.used                         thrpt   20         ≈ 0              bytes
      ClassWriterBenchmark.reuseClassWriter:·gc.alloc.rate                       thrpt   20     857.921 ±   19.528  MB/sec
      ClassWriterBenchmark.reuseClassWriter:·gc.alloc.rate.norm                  thrpt   20   58280.049 ±    0.103    B/op
      ClassWriterBenchmark.reuseClassWriter:·gc.churn.PS_Eden_Space              thrpt   20     815.545 ±   23.318  MB/sec
      ClassWriterBenchmark.reuseClassWriter:·gc.churn.PS_Eden_Space.norm         thrpt   20   55409.507 ± 1280.670    B/op
      ClassWriterBenchmark.reuseClassWriter:·gc.churn.PS_Survivor_Space          thrpt   20       0.217 ±    0.063  MB/sec
      ClassWriterBenchmark.reuseClassWriter:·gc.churn.PS_Survivor_Space.norm     thrpt   20      14.704 ±    4.255    B/op
      ClassWriterBenchmark.reuseClassWriter:·gc.count                            thrpt   20     213.000             counts
      ClassWriterBenchmark.reuseClassWriter:·gc.time                             thrpt   20     159.000                 ms
      ClassWriterBenchmark.reuseClassWriter:·stack                               thrpt              NaN                ---
      ```
      0d0558a3
    • Jason Zaugg's avatar
      486455f5
    • Jason Zaugg's avatar
    • Jason Zaugg's avatar
    • Jason Zaugg's avatar
  2. 13 Jun, 2018 1 commit
    • Jason Zaugg's avatar
      Make ClassWriter reusable · 4ebe76b8
      Jason Zaugg authored
      Adds a `clear()` method to `ClassWriter` to allow the user to
      reuse it to write another class without needing to allocate
      new buffers for the constant pool, etc.
      
      Furthermore, add a mode that enabled internal reuse of of
      buffers class writing.
      
      Exposes an overload of `toByteArray` that does not require
      a copy of the internal buffer, but rather returns the `ByteVector`
      directly. `ByteVector` has been updated to expose its contents
      in a read-only manner as a `ByteBuffer` or a `ByteArrayInputStream`.
      
      I've made an initial attempt to include this in the benchmark
      framework.
      
      ```
       # VM version: JDK 1.8.0_162, VM 25.162-b12
      Benchmark                                                          Mode  Cnt        Score       Error   Units
      GeneratorBenchmark.asm6_1                                         thrpt   20   874896.336 ± 10360.316   ops/s
      GeneratorBenchmark.asm6_1:+memory.used                            thrpt   20          ≈ 0               bytes
      GeneratorBenchmark.asm6_1:·gc.alloc.rate                          thrpt   20     2777.524 ±    31.962  MB/sec
      GeneratorBenchmark.asm6_1:·gc.alloc.rate.norm                     thrpt   20     5000.001 ±     0.003    B/op
      GeneratorBenchmark.asm6_1:·gc.churn.PS_Eden_Space                 thrpt   20     2689.738 ±    71.334  MB/sec
      GeneratorBenchmark.asm6_1:·gc.churn.PS_Eden_Space.norm            thrpt   20     4841.558 ±   101.258    B/op
      GeneratorBenchmark.asm6_1:·gc.churn.PS_Survivor_Space             thrpt   20        0.162 ±     0.044  MB/sec
      GeneratorBenchmark.asm6_1:·gc.churn.PS_Survivor_Space.norm        thrpt   20        0.291 ±     0.079    B/op
      GeneratorBenchmark.asm6_1:·gc.count                               thrpt   20      264.000              counts
      GeneratorBenchmark.asm6_1:·gc.time                                thrpt   20      176.000                  ms
      GeneratorBenchmark.asm6_1_reuse                                   thrpt   20  1053280.540 ± 38925.306   ops/s
      GeneratorBenchmark.asm6_1_reuse:+memory.used                      thrpt   20          ≈ 0               bytes
      GeneratorBenchmark.asm6_1_reuse:·gc.alloc.rate                    thrpt   20     1525.059 ±    56.375  MB/sec
      GeneratorBenchmark.asm6_1_reuse:·gc.alloc.rate.norm               thrpt   20     2280.001 ±     0.002    B/op
      GeneratorBenchmark.asm6_1_reuse:·gc.churn.PS_Eden_Space           thrpt   20     1455.204 ±    57.245  MB/sec
      GeneratorBenchmark.asm6_1_reuse:·gc.churn.PS_Eden_Space.norm      thrpt   20     2175.987 ±    47.373    B/op
      GeneratorBenchmark.asm6_1_reuse:·gc.churn.PS_Survivor_Space       thrpt   20        0.171 ±     0.046  MB/sec
      GeneratorBenchmark.asm6_1_reuse:·gc.churn.PS_Survivor_Space.norm  thrpt   20        0.257 ±     0.070    B/op
      GeneratorBenchmark.asm6_1_reuse:·gc.count                         thrpt   20      248.000              counts
      GeneratorBenchmark.asm6_1_reuse:·gc.time                          thrpt   20      166.000                  ms
      ```
      
      ```
       # VM version: JDK 10.0.1, VM 10.0.1+10
      Benchmark                                                                         Mode  Cnt       Score      Error   Units
      GeneratorBenchmark.asm6_1                                                        thrpt   20  808490.379 ± 9597.741   ops/s
      GeneratorBenchmark.asm6_1:·gc.alloc.rate                                         thrpt   20    2567.604 ±   30.110  MB/sec
      GeneratorBenchmark.asm6_1:·gc.alloc.rate.norm                                    thrpt   20    5000.001 ±    0.002    B/op
      GeneratorBenchmark.asm6_1:·gc.churn.CodeHeap_'non-profiled_nmethods'             thrpt   20       0.008 ±    0.002  MB/sec
      GeneratorBenchmark.asm6_1:·gc.churn.CodeHeap_'non-profiled_nmethods'.norm        thrpt   20       0.016 ±    0.004    B/op
      GeneratorBenchmark.asm6_1:·gc.churn.G1_Old_Gen                                   thrpt   20    2574.135 ±   84.224  MB/sec
      GeneratorBenchmark.asm6_1:·gc.churn.G1_Old_Gen.norm                              thrpt   20    5012.769 ±  155.361    B/op
      GeneratorBenchmark.asm6_1:·gc.count                                              thrpt   20     235.000             counts
      GeneratorBenchmark.asm6_1:·gc.time                                               thrpt   20     250.000                 ms
      GeneratorBenchmark.asm6_1_reuse                                                  thrpt   20  874917.363 ± 2517.632   ops/s
      GeneratorBenchmark.asm6_1_reuse:·gc.alloc.rate                                   thrpt   20    1266.731 ±    4.102  MB/sec
      GeneratorBenchmark.asm6_1_reuse:·gc.alloc.rate.norm                              thrpt   20    2280.001 ±    0.002    B/op
      GeneratorBenchmark.asm6_1_reuse:·gc.churn.CodeHeap_'non-profiled_nmethods'       thrpt   20       0.004 ±    0.002  MB/sec
      GeneratorBenchmark.asm6_1_reuse:·gc.churn.CodeHeap_'non-profiled_nmethods'.norm  thrpt   20       0.008 ±    0.004    B/op
      GeneratorBenchmark.asm6_1_reuse:·gc.churn.G1_Old_Gen                             thrpt   20    1266.407 ±   62.495  MB/sec
      GeneratorBenchmark.asm6_1_reuse:·gc.churn.G1_Old_Gen.norm                        thrpt   20    2279.504 ±  113.687    B/op
      GeneratorBenchmark.asm6_1_reuse:·gc.count                                        thrpt   20     144.000             counts
      GeneratorBenchmark.asm6_1_reuse:·gc.time                                         thrpt   20     147.000                 ms
      ```
      4ebe76b8
  3. 12 Jun, 2018 2 commits
  4. 11 Jun, 2018 2 commits
  5. 24 May, 2018 1 commit
  6. 22 May, 2018 1 commit
  7. 19 May, 2018 2 commits
    • Eric Bruneton's avatar
      Fix wrong import! Correct benchmarks results on my machine: · 63efb1aa
      Eric Bruneton authored
      CURRENT CODE (3 runs)
      
      getArgumentsAndReturnSizeFromDescriptor                thrpt   10  7841,639 ± 202,570  ops/s
      getArgumentsAndReturnTypesFromDescriptor               thrpt   10  1444,529 ±  41,936  ops/s
      getTypeFromDescriptor                                  thrpt   10  4586,855 ± 109,614  ops/s
      
      getArgumentsAndReturnSizeFromDescriptor                thrpt   10  7884,111 ± 187,510  ops/s
      getArgumentsAndReturnTypesFromDescriptor               thrpt   10  1448,835 ±  37,332  ops/s
      getTypeFromDescriptor                                  thrpt   10  4578,097 ± 115,033  ops/s
      
      getArgumentsAndReturnSizeFromDescriptor                thrpt   10  7868,005 ± 165,286  ops/s
      getArgumentsAndReturnTypesFromDescriptor               thrpt   10  1453,131 ±  32,611  ops/s
      getTypeFromDescriptor                                  thrpt   10  4537,437 ± 111,732  ops/s
      
      NEW CODE (3 runs)
      
      getArgumentsAndReturnSizeFromDescriptor                thrpt   10   7868,311 ± 205,813  ops/s
      getArgumentsAndReturnTypesFromDescriptor               thrpt   10   1400,616 ±  47,122  ops/s
      getTypeFromDescriptor                                  thrpt   10  10447,278 ± 285,315  ops/s
      
      getArgumentsAndReturnSizeFromDescriptor                thrpt   10   7822,970 ± 180,999  ops/s
      getArgumentsAndReturnTypesFromDescriptor               thrpt   10   1430,244 ±  39,596  ops/s
      getTypeFromDescriptor                                  thrpt   10  10371,893 ± 308,044  ops/s
      
      getArgumentsAndReturnSizeFromDescriptor                thrpt   10  7709,202 ± 168,070  ops/s
      getArgumentsAndReturnTypesFromDescriptor               thrpt   10  1402,382 ±  34,459  ops/s
      getTypeFromDescriptor                                  thrpt   10  8851,335 ± 259,663  ops/s
      63efb1aa
    • Eric Bruneton's avatar
      Remove the use of toCharArray() to remove some memory allocations. Also add a benchmark for Type. · 5db12737
      Eric Bruneton authored
      Results of the benchmark on my machine:
      
      CURRENT CODE (3 runs)
      
      getArgumentsAndReturnSizeFromDescriptor                thrpt   10  8002,137 ± 309,542  ops/s
      getArgumentsAndReturnTypesFromDescriptor               thrpt   10  1393,701 ±  37,392  ops/s
      getTypeFromDescriptor                                  thrpt   10  3469,877 ±  90,339  ops/s
      
      getArgumentsAndReturnSizeFromDescriptor                thrpt   10  7950,019 ± 320,668  ops/s
      getArgumentsAndReturnTypesFromDescriptor               thrpt   10  1326,380 ±  29,934  ops/s
      getTypeFromDescriptor                                  thrpt   10  3232,627 ±  89,893  ops/s
      
      getArgumentsAndReturnSizeFromDescriptor                thrpt   10  7931,430 ± 243,812  ops/s
      getArgumentsAndReturnTypesFromDescriptor               thrpt   10  1355,610 ±  27,042  ops/s
      getTypeFromDescriptor                                  thrpt   10  3469,378 ±  84,797  ops/s
      
      NEW CODE (3 runs)
      
      getArgumentsAndReturnSizeFromDescriptor                thrpt   10  7984,723 ± 211,592  ops/s
      getArgumentsAndReturnTypesFromDescriptor               thrpt   10  1260,854 ±  26,638  ops/s
      getTypeFromDescriptor                                  thrpt   10  3442,509 ±  83,137  ops/s
      
      getArgumentsAndReturnSizeFromDescriptor                thrpt   10  7863,562 ± 158,205  ops/s
      getArgumentsAndReturnTypesFromDescriptor               thrpt   10  1389,624 ±  39,087  ops/s
      getTypeFromDescriptor                                  thrpt   10  3201,957 ±  53,120  ops/s
      
      getArgumentsAndReturnSizeFromDescriptor                thrpt   10  7871,202 ± 231,629  ops/s
      getArgumentsAndReturnTypesFromDescriptor               thrpt   10  1374,364 ±  32,216  ops/s
      getTypeFromDescriptor                                  thrpt   10  3265,688 ±  72,233  ops/s
      5db12737
  8. 14 May, 2018 4 commits
  9. 13 May, 2018 3 commits
  10. 05 May, 2018 3 commits
  11. 04 May, 2018 4 commits
  12. 02 May, 2018 4 commits
  13. 01 May, 2018 3 commits
  14. 26 Apr, 2018 1 commit
    • Eric Bruneton's avatar
      Add an experimental suffix to the new features (also mark them deprecated and... · a05bf33d
      Eric Bruneton authored
      Add an experimental suffix to the new features (also mark them deprecated and show a big warning in the Javadoc). Revert to ASM6 for the default api of the visitors, and use ASM7_EXPERIMENTAL only in tests (only exception: Trace*Visitor classes, which are final). This pattern could allow us to develop any new feature directly in 'master'.
      a05bf33d
  15. 25 Apr, 2018 3 commits