Innectis Community Forum

Author Topic: Lag, such pathetic lag  (Read 2321 times)

Vector

  • Owner
  • Administrator
  • Legendary Member
  • *****
  • Posts: 2153
  • Gender: Male
  • I am the exception, not the rule
    • View Profile
    • Code Speak
Lag, such pathetic lag
« on: October 24, 2013, 01:12:10 AM »
Over the course of my time as a developer for the IDP, I've had the privilege of adding onto existing features / creating entirely new ones. It was a fun process, and I enjoyed it very much. However, there was one very inherent problem from all of this. Since I was new to Java when I started out I had really no experience of broader programming concepts such as interfaces, abstraction, generics, etc. (Non programming people: A better way to program, makes things neater, and lets you add things easier). Most of my time involved writing just to write. Add a feature here, fix or expand a feature there.

Sometimes one of us will write something because we have to, and there is no better way to do it at the time. Time goes on, bukkit adds a very useful tool, and we may not even revisit what we wrote, but what was added by bukkit may improve upon it even more. I've done that a few times, improve upon existing systems others have written, as well as myself.

Somewhere in all of this we ended up having a ton of lag coming from I'm not sure where. One of the ways to figure it out is to use a tool called a profile to let you figure out what the problem areas are and to figure out how to fix them. I'm not really experienced with such a tool and I've tried to use them before. Another strategy required, at least for me, over a year before I realized the impact of my own code and how it would relate to the functionality of the server.

Our lag is a recurring issue, and it is mostly NOT networking related, but in fact related to our own coding design. Our project has been contributed to by 4 authors over time, and we hadn't even really worked together to write code that would not contribute to lag. Now the IDP is in my hands and I have over 2 years experience working with the IDP. I have made improvements with our code in the past and will continue to make improvements in the future. Trying to hammer out the lag is not simple, but at least I can figure out if a given piece of code does more than it really should, and, if I see any improvements needing to be made, I will make them.

This is not something that I will just sit by and do nothing about. It is probably a reason some people choose not to play on our server, because it seriously interferes with the experience of the game.
  • AlphaBlend
    AlphaBlend
    AlphaBlend
I like to make things. That pretty much describes the kind of person I am.

Nortan360

  • Retired Staff
  • Full Member
  • *****
  • Posts: 147
    • View Profile
Re: Lag, such pathetic lag
« Reply #1 on: October 25, 2013, 05:57:41 AM »
Nested if statements rather than switches :P
  • Nortan360
    Nortan360
    Nortan360