Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GR-50774] ByteArrayAccessCloneBenchmark#unsafeCopyMemory does not use ARRAY_BYTE_BASE_OFFSET #8763

Open
Marcono1234 opened this issue Apr 12, 2024 · 1 comment
Assignees
Labels

Comments

@Marcono1234
Copy link

Describe the issue
The class ByteArrayAccessCloneBenchmark#unsafeCopyMemory uses 0 as offset values for the Unsafe#copyMemory call:

I think this is incorrect; it should instead use Unsafe#ARRAY_BYTE_BASE_OFFSET1. Otherwise the current code actually also copies the array header and misses the last elements. This is not only incorrect behavior, but it might also distort the benchmark since it is accessing a slightly different memory section than all other methods (?).

Footnotes

  1. And technically it should maybe also multiply array.length by ARRAY_BYTE_INDEX_SCALE? But since that value is 1 it might not matter much.

@selhagani selhagani self-assigned this Apr 15, 2024
@selhagani
Copy link
Member

Hi @Marcono1234, thank you for sharing this with us!
I will share this with our dev team and I will keep you updated.

@selhagani selhagani changed the title ByteArrayAccessCloneBenchmark#unsafeCopyMemory does not use ARRAY_BYTE_BASE_OFFSET [GR-50774] ByteArrayAccessCloneBenchmark#unsafeCopyMemory does not use ARRAY_BYTE_BASE_OFFSET Apr 15, 2024
@selhagani selhagani assigned chumer and unassigned selhagani Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants