Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

So I've wanted to try and get some details on how long some of my code takes to execute, and thought I'd hook right in to the Shift-F3 display and was able to dig up these calls (this being a location-agnostic call to the server's profiler) from where it is used elsewhere in the code:

 

MinecraftServer.getServer().theProfiler.startSection("_NAME_");
MinecraftServer.getServer().theProfiler.endSection();

 

Though I've never been able to find any of the sections I name in the F3 overlay (and frequently see a lot of time spent in

root.tick.gameMode.checkLight.checkPosition < toCheckCount

, on the order of 17% of the entire game loop time, and which I have no idea what that even is).

 

My code that I'm trying to profile is inside a tick handler, so it should be in root.tick somewhere.

 

Anyone have any experience with this?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

Are you using ServerTickEvent? Because if so... good luck.

The profiler is cleared up right after the START phase (it fires before the vanilla code) and it's main category is ended right before the END phase.

 

Ahhh, I see.  I'm running my code on TickPhase.End, but if the main profiler section was already ended then its too late.

Bummer.

 

Any idea on "checkPosition < toCheckCount"?  When I get a lot of lag in dev, that's the section that's using the most CPU (over a third of the total is root.tick, two thirds of that is root.tick.gameMode, two thirds of that is root.tick.gameMode.checkLight or about 17% of the grand total).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

Make sure you are running the latest forge. There was a bug with chunk packets which caused client-side chunk loading to be highly inefficient.

 

Ah, that could be.  I've mostly not worried about it, as I can't trace it back to my code, thought it has been annoying at times.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

From memory the "checkPosition < toCheckCount" is related to lighting calculations.  I once did troubleshooting on a mod which had extreme lag during startup and world generation, it was caused because he had a lot of objects in the sky and rather poor initial guess for the skylight grid.  The way lighting calculations are done causes a recursive cascade of updates to the lighting values of blocks and their neighbours, which is extremely slow.

 

-TGG

  • Author

That was my guess, too.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.