On Thu, 17 Sep 2026 12:42:35 GMT, Per Minborg <[email protected]> wrote:

>> This PR proposes removing the entire internal `BufferStack` and associated 
>> classes and tests. Instead, we can now simply rely on a `Arena.ofConfined` 
>> which will provide pooling for us automatically.
>> 
>> If integrated, this PR would imply:
>> 1,511 lines removed net across 13 files compared with master:
>> - 602 production-source lines
>> - 909 test and benchmark lines
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Per Minborg has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Reintroduce a bounded arena

With the bounded arena, we get the following benchmark results on an M4:

```Benchmark                                                 Mode  Cnt   Score  
  Error   Units
CallOverheadByValue.OfVirtual.byPtr                       avgt   50   2.261 ±  
0.025   ns/op
CallOverheadByValue.OfVirtual.byPtr:gc.alloc.rate         avgt   50   0.006 ±  
0.001  MB/sec
CallOverheadByValue.OfVirtual.byPtr:gc.alloc.rate.norm    avgt   50  ≈ 10⁻⁵     
        B/op
CallOverheadByValue.OfVirtual.byPtr:gc.count              avgt   50     ≈ 0     
      counts
CallOverheadByValue.OfVirtual.byValue                     avgt   50   5.765 ±  
0.108   ns/op <-- 2x Faster
CallOverheadByValue.OfVirtual.byValue:gc.alloc.rate       avgt   50   0.006 ±  
0.001  MB/sec
CallOverheadByValue.OfVirtual.byValue:gc.alloc.rate.norm  avgt   50  ≈ 10⁻⁴     
        B/op
CallOverheadByValue.OfVirtual.byValue:gc.count            avgt   50     ≈ 0     
      counts
CallOverheadByValue.byPtr                                 avgt   50   2.260 ±  
0.014   ns/op
CallOverheadByValue.byPtr:gc.alloc.rate                   avgt   50   0.006 ±  
0.001  MB/sec
CallOverheadByValue.byPtr:gc.alloc.rate.norm              avgt   50  ≈ 10⁻⁵     
        B/op
CallOverheadByValue.byPtr:gc.count                        avgt   50     ≈ 0     
      counts
CallOverheadByValue.byValue                               avgt   50   5.097 ±  
0.040   ns/op <-- 7% Faster
CallOverheadByValue.byValue:gc.alloc.rate                 avgt   50   0.006 ±  
0.001  MB/sec
CallOverheadByValue.byValue:gc.alloc.rate.norm            avgt   50  ≈ 10⁻⁴     
        B/op
CallOverheadByValue.byValue:gc.count                      avgt   50     ≈ 0     
      counts

-------------

PR Comment: https://git.openjdk.org/jdk/pull/32924#issuecomment-5714536358

Reply via email to