Skip to content
New issue

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

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

Already on GitHub? # to your account

Update getCode so it does not make a copy of the array #2365

Merged
merged 1 commit into from
May 29, 2024

Conversation

rmoreliovlabs
Copy link
Contributor

Description

Removed the call to Arrays.copyOf() method and made getCode() return the array directly. As per @asoto-iov suggestion the getCodeLength() method.

Motivation and Context

Currently the doCODESIZE() and doCODECOPY() methods can, under certain conditions, make a call to the getCode() method that returns a deep copy of the underlying array which can cause perfomance issues if the code array is too big.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • Tests for the changes have been added (for bug fixes / features)
  • Requires Activation Code (Hard Fork)
  • Other information:

@rmoreliovlabs rmoreliovlabs force-pushed the improve_performance_codesize_codecopy branch from 587a06c to 64d1f63 Compare May 29, 2024 14:55
Copy link

@Vovchyk Vovchyk merged commit 07e9c13 into master May 29, 2024
10 checks passed
@Vovchyk Vovchyk deleted the improve_performance_codesize_codecopy branch May 29, 2024 15:32
@aeidelman aeidelman added this to the Arrowhead 6.3.0 milestone Jul 2, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants