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

Optimize BlockPosition helper methods #1339

Merged
merged 1 commit into from Aug 17, 2018
Merged

Conversation

Spottedleaf
Copy link
Member

Resolves #1338

Copy link
Contributor

@hugmanrique hugmanrique left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you could call the direction() and direction(int) from the body of both shift methods to avoid code duplication. I know it's an extra call, but it should be fine as the JIT will perform trivial inlining (this is a very hot path)

@aikar
Copy link
Member

aikar commented Aug 15, 2018

@hugmanrique the whole purpose of the patch is to remove method calls heh, see the link in the issue linked. reducing method calls helps inlining, and these are hot enough it shows good improvements.

@Spottedleaf
Copy link
Member Author

Spottedleaf commented Aug 15, 2018

To be fair the JIT would probably inline and optmize it to what is shown in patch, I just didn't consider diff size

@aikar aikar merged commit 9c4490b into PaperMC:master Aug 17, 2018
aikar added a commit that referenced this pull request Aug 19, 2018
* pre/1.13: (45 commits)
  [CI-SKIP] Remove old optimize hopper patch from removed
  Restore Optimized Hoppers patch
  [CI-SKIP] Remove some unneeded patches from removed folder
  restore vanilla default mob-spawn-range
  Fix some performance regression in last patch
  Don't iterate twice - Fixes GH-1346
  Send nearby packets from world list instead of server list (#1196)
  [CI-SKIP] [Auto] Rebuild Patches
  1.13: Player launch projectile event (#1249)
  Allow Blocks to be accessed via a long key (#1335)
  Optimize BlockPosition helper methods (#1339)
  Fix watchdog restarting on short timeout (#1344)
  [Auto] Updated Upstream (Bukkit/CraftBukkit)
  Cleanup javadoc warnings for 1.13
  Cleanup javadoc warnings
  [Auto] Updated Upstream (Bukkit)
  Fix bug in last patch
  Ensure chunks are always loaded on hard position sets
  Improve Watchdog Early Warning Feature - Closes #1319
  [Auto] Updated Upstream (CraftBukkit)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants