[foreign-memaccess+abi] Integrated: Add AllocTest benchmark

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Aug 18 17:34:49 UTC 2023


On Fri, 18 Aug 2023 16:45:13 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> This patch adds a benchmark that tests a simple allocation (of varying size).
> The allocation request requires zeroing, so we compare against calloc, and bare use of Unsafe::allocateMemory/setMemory/freeMemory.
> 
> Results are as follows:
> 
> 
> Benchmark                     (size)  Mode  Cnt   Score   Error  Units
> AllocTest.alloc_calloc_arena       5  avgt   30  40.620 ? 0.360  ns/op
> AllocTest.alloc_calloc_arena      20  avgt   30  41.648 ? 1.460  ns/op
> AllocTest.alloc_calloc_arena     100  avgt   30  39.885 ? 0.478  ns/op
> AllocTest.alloc_calloc_arena     500  avgt   30  67.802 ? 2.258  ns/op
> AllocTest.alloc_calloc_arena    1000  avgt   30  67.403 ? 1.034  ns/op
> AllocTest.alloc_confined           5  avgt   30  51.874 ? 0.554  ns/op
> AllocTest.alloc_confined          20  avgt   30  52.717 ? 1.214  ns/op
> AllocTest.alloc_confined         100  avgt   30  52.760 ? 0.716  ns/op
> AllocTest.alloc_confined         500  avgt   30  58.661 ? 2.379  ns/op
> AllocTest.alloc_confined        1000  avgt   30  65.374 ? 0.711  ns/op
> AllocTest.alloc_unsafe_arena       5  avgt   30  56.086 ? 0.710  ns/op
> AllocTest.alloc_unsafe_arena      20  avgt   30  52.492 ? 0.835  ns/op
> AllocTest.alloc_unsafe_arena     100  avgt   30  54.579 ? 0.748  ns/op
> AllocTest.alloc_unsafe_arena     500  avgt   30  60.528 ? 1.024  ns/op
> AllocTest.alloc_unsafe_arena    1000  avgt   30  67.619 ? 1.020  ns/op
> 
> 
> So, confined arenas are quite close to calloc. There remains a gap, especially on lower allocation sizes, which is a consequence of:
> https://bugs.openjdk.org/browse/JDK-8314294

This pull request has now been integrated.

Changeset: 622a36cb
Author:    Maurizio Cimadamore <mcimadamore at openjdk.org>
URL:       https://git.openjdk.org/panama-foreign/commit/622a36cbc5f1293b933eb878da8cf953712ce369
Stats:     145 lines in 1 file changed: 145 ins; 0 del; 0 mod

Add AllocTest benchmark

Reviewed-by: jvernee

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

PR: https://git.openjdk.org/panama-foreign/pull/870


More information about the panama-dev mailing list