AUTHOR
Adservio Team
DATE
September 29, 2021
CATEGORY
Digital Quality
Bringing Performance to Java Developers

Digital Quality

7 min

Bringing Performance to Java Developers

For those who have been doing Java development, we assume you already realized that Performance is the key for any Java application. Enhancing the Performance is enhancing your services and the product as a last result.

 In performance engineering, there are two dogmas:

  • Premature optimization is the root of all evil" as coined by Donald Knuth in 1974.

Versus

  • Never ship shit" — Robert C. Martin (Uncle Bob)

At Adservio, we work on improving java applications (and others) performance on a daily basis. We believe that prevention is the mother of all cures (an Arab proverb) and code is worthy of being optimized by default (we are in favor of Uncle Bob dogma).

Java developers can improve their notoriety by getting the best from java APIs, the Jvm and the Garbage collector.

We don't minimize the enormous progress that has been made in the performance of the Java platform and successive JVMs over the past 25 years.

The JIT compiler (introduced in java 1.1.8) makes the code 8 times faster than the same code in java 1.0, simply because java was interpreted in version 1.0. Parallelizing the garbage collector was a huge performance improvement, but more recent changes have been more incremental.

However, performance issues still happen because the Java platform continues to evolve and each new edition of Java provides new language features and new APIs that improve the productivity of developers— and impact the performance of their applications.

Good developer, not only ship functional and clean code but also a performance bug-free code.

As a developer, why performance is important for me?

Performance is an essential non-functional quality for software. Being aware of performance best practices helps developers attain better code quality and progress to higher levels of optimization, code cleanliness.

As a developer, performance matters for you for the following reasons:

Technical advantages:

  • You will deliver performant code, that's executes quickly and efficiently
  • Performance is an important quality KPI
  • Performance enhance the testability of your code
  • Performance reduces the complexity of your code

Personal advantages:

  • Performance is a key differentiator, you design, code and deliver performant software features
  • You will be a hero, a save if you resolve performance issues
  • You will gain notoriety and called for help if performance issues occurred
  • You will be invited for technical or architectural instances and you can climb the ladder faster

For a long time, these were considered separate areas of expertise:

  • developers code,
  • and the performance team tests, tunes and recommends fixes for performance issues.

That was certainly not a convenient discrepancy—anyone who code Java applications should be aware of how code behaves in the JVM and what kinds of tuning are likely to enhance its performance.

As projects shift to a DevOps delivery model, this distinction is commencing to become less firm. Knowledge of the performance sphere will help a developer to add a new string to his bow.

The cost of non performance

On the other hand, non performance has a lot of drawbacks and can lead to high pressure, failure and loss of path, track and self-esteem.

As a developer, non performance can have a set of prejudices:

Technical downsides:

  • Each performance issue reduces velocity and slow down your ability to ship
  • Performance issue can be hard to solve in advanced stages of the project
  • As a developer, you will have tendency (and it happens unfortunately) to integrate quick and dirty solutions into the code (we call them temporary but will be forgotten quickly)
  • Quick and dirty solutions can lead to unmaintainable code and impact the whole work
  • Non performance augment the technical debt
  • Bad code in general and bad performance code in particular can be a reason for good team members’ to early quit from the project or even the company.

Personal downsides:

  • Combating against time (to deliver) and time (execution) can be very stressful
  • Non performance of the code can be visible by the whole team and lead to bad reputation
  • Explaining a non performant code to your development team while reviewing a pull request or during peer review may be painful
  • Bad performance reduces developer’s motivation.

What to do

No matter a team's level of java performance maturing, the focus should be on developing the fundamentals of continuous performance analysis and enhancement.

Once the basic engine of performance awareness is in place, additional checks and performance tuning complexity can be introduced to accelerate transformation.

Java performance knowledge falls into 3 categories:

  • Performance of Java Virtual Machine (JVM) itself: the way that the JVM is configured affects many aspects of a program’s performance
  • Performance of our code and how we use Java APIs: The second aspect is to understand how the features of the Java platform affect performance (threads, synchronization, String, streams, etc.).
  • Environment: The ecosystem where the program runs is important to guarantee the overall performance. The OS limitations (for example, a threshold in Linux soft Open Files can limits networks socket connections to 1024 and creates java http communication bottlenecks)

The performance of the JVM is based largely on tuning flags, while the performance of the platform is determined more by using best practices within your application code.

It's not only a technical problem, it is a mindset

To break things down a bit, Performance awareness doesn't get solved overnight. The continuum is the key to bring performance as habit and automatism to java developers.

That's why it's essential to share knowledge.

Small performance committee or seminar can be an occasion to share benchmarks, return on experience and drive toward the right outcome of capitalization.

To get real, tangible performance outcomes can be through small steps, it's imperative to get alignment from the management to ensure minimum time for java developers to analyze, benchmark their code, brainstorm together to decide on the best choice possible.

Remember

Performance isn't just a non functional requirement that should be validated at the end of the project, it should be built-in.

It’s never too soon to start optimizing the performance of your code and projects.

Technical debt can grow seven times faster with performance issues in code.

  • Non performance brings quick and dirty fixes
  • Quick and dirty fixes break the code and its initial design
  • Once broke and other follow it, debt will scale considerably

To jumpstart your transformation, Adservio can help you assess your organization's maturity across the four stages of our modern code performance maturity model. 

We offer a range of offerings from best practices workshops to deep-dive assessments, audit capability definition, and co-creation of performance in your software initiatives.

Industry insights you won’t delete. Delivered to your inbox weekly.

Other posts

Any questions for us?