RFR: 8317432: Async UL: Do not recompute strlen()
Johan Sjölen
jsjolen at openjdk.org
Wed Oct 4 09:18:12 UTC 2023
Hi,
This change does three things:
1. At construction of message we used to compute `strlen` and then `strcpy`, we change this to do only one `strlen` and then a `memcpy` instead.
2. A `strlen` used to be required to calculate the size when finding the next message in the iterator. We instead store the previously computed message length and so the `strlen` is no longer necessary. The cost of this is 8 bytes extra per message (64 -> 72 bytes).
3. There's also some code which alters the alignment to explicitly handle the alignment of `Message` and ensure that `_pos` starts at a `Message`-aligned pointer.
-------------
Commit messages:
- Copyright
- Ensure alignment of _pos on reset()
- Copyright
- Use alignof() and fix comments
- Fix potential alignment issue
- Store the message length in Message
Changes: https://git.openjdk.org/jdk/pull/16029/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16029&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8317432
Stats: 24 lines in 2 files changed: 11 ins; 1 del; 12 mod
Patch: https://git.openjdk.org/jdk/pull/16029.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/16029/head:pull/16029
PR: https://git.openjdk.org/jdk/pull/16029
More information about the hotspot-runtime-dev
mailing list