CaptainHastings
CaptainHastings

Reputation: 1597

Performance hit of using an agent

I am evaluating a product which works by instrumenting bytecode. I launch my application via the provided agent which instruments bytecode, profiles and generates reports about my application.

What would be the best way to determine the performance penalty imposed by running the agent? Would it be enough if I were to capture latency of a few of operation in my app via JMH with and without the agent? Also, is there a baseline expected drop in performance by using an agent which does bytecode instrumentation?

Thanks

Upvotes: 0

Views: 140

Answers (2)

Imaskar
Imaskar

Reputation: 2949

If your application is some kind of a server, you can launch it with an agent and run a separate JMH benchmark that would measure calls to your app. That way you have your app running with or without this agent and benchmark code wouldn't interfere with it. But you'll have to isolate a lot of factors like call latency, cpu usage by the caller (if you run caller from the same host), calls distribution (you have a lot of different calls on a server, but only a couple in a benchmark), etc.

If instead you would benchmark inside a process agent is attached to, I wouldn't trust this result, unless actions take really long time, like >5ms.

Upvotes: 1

Amir Afghani
Amir Afghani

Reputation: 38541

You can download an existing Java performance benchmark like SPECjvm2008 and run it with/without your agent. I wouldn't only write a microbenchmark sourced from the application you are monitoring because that might not highlight the bottlenecks of various operations and instrumentation techniques used by this product(method/memory/system).

The baseline that is advertised for a typical agent is 5%, which is a number I would take with a huge grain of salt.

Upvotes: 3

Related Questions