SlideShare a Scribd company logo
Is your profiler speaking the
same language as you?
Simon Maple
@sjmaple
@sjmapleSimon Maple -
Agenda
• Performance Tools
• Performance by numbers
• Sampling vs Tracing
• XRebel
• JRebel
3
Performance Tools
• Java Monitoring Tools
• Java Profilers
• Java Testing Tools
5
Performance report
6
RebelLabs reports
7
8
9
10
11
12
13
14
15
The Journey of Performance
16
https://twitter.com/shipilev/status/578193813946134529
A
B
C
D E
Performance
Code complexity
Improving
Optimizing
Last 5%
Last 1%
A
B
C
D E
Profiling
CPU
Tracing Sampling
Memory
Usage Allocation
We are only talking about this part today
JVM has ability to produce thread dump:
Press Ctrl+Break on Windows
kill -3 PID on *nix
"http-nio-8080-exec-1"#40 daemon prio=5 os_prio=31 tid=0x00007fd7057ed800 nid=0x7313 runnable
java.lang.Thread.State: RUNNABLE
at o.s.s.p.w.OwnerController.processFindForm(OwnerController.java:89)
at s.r.NativeMethodAccessorImpl.invoke0(Native Method)
at s.r.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at s.r.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at j.l.r.Method.invoke(Method.java:497)
What is a sample?
Sampling interval : 20 ms
Sample count: 4
Sampling interval : 1 ms
Sample count: 100+
Sampling
main()
foo()
bar()
baz()
never captured :(
Safepoint bias
Safepoints
main()
foo()
bar()
baz()
Safepoint bias
Safepoints
main()
foo()
bar()
baz()
Taming safepoint bias
Java Mission Control
Proprietary protocol
Java 7u40
Honest Profiler
https://github.com/RichardWarburton/honest-profiler
AsyncGetCallTrace
JVMTI
NB! not documented
public	
  void	
  businessMethod()	
  {

	
  	
  long	
  start	
  =	
  System.currentTimeMillis();

	
  	
  work();

	
  	
  Profiler.log(System.currentTimeMillis()-­‐start);	
  
}
Tracing
(Instrumentation)
Tracing
public	
  void	
  businessMethod()	
  {

	
  	
  long	
  start	
  =	
  System.nanoTime();

	
  	
  work();

	
  	
  Profiler.log(System.nanoTime()-­‐start);

}
Tracing
public	
  void	
  businessMethod()	
  {

	
  	
  Profiler.start(“businessMethod");	
  
	
  	
  try	
  {

	
  	
  	
  	
  work();

	
  	
  }	
  finally	
  {

	
  	
  	
  	
  Profiler.log("businessMethod");

	
  	
  }

}
System.nanoTime
System.currentTimeMillis
Parallel thread updating easily accessible
memory location
sleep-wakeup-update
yield-wakeup-update
busy-loop-update
class	
  Profiler	
  {	
  


	
  	
  Loop	
  loop;



	
  	
  public	
  static	
  void	
  start(String	
  method)	
  {

	
  	
  	
  	
  long	
  now	
  =	
  loop.getTime();	
  
	
  	
  	
  	
  …

	
  	
  }	
  
public	
  class	
  Loop	
  implements	
  Runnable	
  {

	
  	
  	
  	
  private	
  volatile	
  long	
  time;

	
  	
  	
  	
  public	
  void	
  run()	
  {

	
  	
  	
  	
  	
  	
  	
  	
  while	
  (running)	
  {

	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  time	
  =	
  System.nanoTime();

	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  sleep();

	
  	
  	
  	
  	
  	
  	
  	
  }

	
  	
  	
  	
  }	
  
	
  	
  	
  	
  public	
  final	
  long	
  getTime()	
  {

	
  	
  	
  	
  	
  	
  	
  	
  return	
  time;

	
  	
  	
  	
  }	
  
Busy Loop
Nano seconds put into perspective
Reading memory is not free.
It takes cycles = nanoseconds
Each (software) layer is not free.
JVM,JNI,OS,HW
http://shipilev.net/blog/2014/nanotrusting-nanotime/
Nanotrusting the NanoTime
Nano seconds put into perspective
http://shipilev.net/blog/2014/nanotrusting-nanotime/
Nanotrusting the NanoTime
granularity_nanotime: 26.300 +-0.205 ns
latency_nanotime: 25.542 +-0.024 ns
granularity_nanotime: 29.322 +-1.293 ns
latency_nanotime: 29.910 +-1.626 ns
granularity_nanotime: 371,419 +-1,541 ns
latency_nanotime: 14,415 +-0,389 ns
Linux
Solaris
Windows
Sleep timer: time-slicing & scheduling
Minimum sleep times:
Win8: 1.7 ms (1.0 ms using JNI + socket poll)
Linux: 0.1 ms
OS X: 0.05 ms
VirtualBox + Linux: don’t ask :)
Still uses 25-50% of CPU core
Yield?
Windows scheduler skips yielded threads in case of
CPU starvation
public	
  class	
  Loop	
  implements	
  Runnable	
  {

	
  	
  	
  	
  private	
  volatile	
  long	
  time;

	
  	
  	
  	
  public	
  void	
  run()	
  {

	
  	
  	
  	
  	
  	
  	
  	
  while	
  (running)	
  {

	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  time	
  =	
  System.nanoTime();

	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  sleep();

	
  	
  	
  	
  	
  	
  	
  	
  }

	
  	
  	
  	
  }	
  
	
  	
  	
  	
  private	
  void	
  sleep()	
  {

	
  	
  	
  	
  	
  	
  if	
  (!MiscUtil.isWindows())	
  {

	
  	
  	
  	
  	
  	
  	
  	
  	
  Thread.yield();

	
  	
  	
  	
  	
  	
  }

	
  	
  	
  	
  }
Busy Loop
public	
  class	
  Loop	
  implements	
  Runnable	
  {

	
  	
  	
  	
  private	
  volatile	
  long	
  time;

	
  	
  	
  	
  public	
  void	
  run()	
  {

	
  	
  	
  	
  	
  	
  	
  	
  while	
  (running)	
  {

	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  time	
  =	
  System.nanoTime();

	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  sleep();

	
  	
  	
  	
  	
  	
  	
  	
  }

	
  	
  	
  	
  }	
  
	
  	
  	
  	
  private	
  void	
  sleep()	
  {

	
  	
  	
  	
  	
  	
  if	
  (!MiscUtil.isWindows())	
  {

	
  	
  	
  	
  	
  	
  	
  	
  	
  Thread.yield();

	
  	
  	
  	
  	
  	
  }

	
  	
  	
  	
  }
Busy Loop
Busy Loop
public	
  class	
  Loop	
  implements	
  Runnable	
  {

	
  	
  	
  	
  private	
  volatile	
  long	
  time;

	
  	
  	
  	
  public	
  void	
  run()	
  {

	
  	
  	
  	
  	
  	
  	
  	
  while	
  (running)	
  {

	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  time	
  =	
  System.nanoTime();

	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  sleep();

	
  	
  	
  	
  	
  	
  	
  	
  }

	
  	
  	
  	
  }	
  
	
  	
  	
  	
  private	
  void	
  sleep()	
  {

	
  	
  	
  	
  	
  	
  if	
  (!MiscUtil.isWindows())	
  {

	
  	
  	
  	
  	
  	
  	
  	
  	
  Thread.yield();

	
  	
  	
  	
  	
  	
  }

	
  	
  	
  	
  }
public	
  class	
  Loop	
  implements	
  Runnable	
  {

	
  	
  	
  	
  private	
  volatile	
  long	
  time;

	
  	
  	
  	
  public	
  void	
  run()	
  {

	
  	
  	
  	
  	
  	
  	
  	
  while	
  (running)	
  {

	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  time	
  =	
  System.nanoTime();

	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  sleep();

	
  	
  	
  	
  	
  	
  	
  	
  }

	
  	
  	
  	
  }	
  
	
  	
  	
  	
  private	
  void	
  sleep()	
  {

	
  	
  	
  	
  	
  	
  if	
  (!MiscUtil.isWindows())	
  {

	
  	
  	
  	
  	
  	
  	
  	
  	
  Thread.yield();

	
  	
  	
  	
  	
  	
  }

	
  	
  	
  	
  }
Busy Loop
main()
foo()
bar()
baz()
Tracing
relatively higher overhead for fast methods :(
Database access
Web Services
RMI
Various application layers
3rd-party components
HTTP session
Exceptions
Caches
File system access
View rendering
Serialization
GC
What other performance
considerations should we have?
Questions you should be asking
……..
……..
……..
……..
Questions you should be asking
Where was most of the time spent?
How many SQL queries were executed?
How much time did the external calls take?
What’s my HTTP session state?
Is caching working properly?
Is there any excessive work done by the app?
Most improvement gained here!
This is where we should focus first!
A
B
C
D E
Download trials and get FREE
shirts :)
JRebel: http://0t.ee/docklandsjr
XRebel: http://0t.ee/docklandsxr
47

More Related Content

What's hot

Where the wild things are - Benchmarking and Micro-Optimisations
Where the wild things are - Benchmarking and Micro-OptimisationsWhere the wild things are - Benchmarking and Micro-Optimisations
Where the wild things are - Benchmarking and Micro-Optimisations
Matt Warren
 
GTAC 2014: What lurks in test suites?
GTAC 2014: What lurks in test suites?GTAC 2014: What lurks in test suites?
GTAC 2014: What lurks in test suites?
Patrick Lam
 
Performance and how to measure it - ProgSCon London 2016
Performance and how to measure it - ProgSCon London 2016Performance and how to measure it - ProgSCon London 2016
Performance and how to measure it - ProgSCon London 2016
Matt Warren
 
Embedded systems
Embedded systems Embedded systems
Embedded systems
Katy Anton
 
Performance is a Feature! at DDD 11
Performance is a Feature! at DDD 11Performance is a Feature! at DDD 11
Performance is a Feature! at DDD 11
Matt Warren
 
How to write memory efficient code?
How to write memory efficient code?How to write memory efficient code?
How to write memory efficient code?
Tier1 app
 
Profiling Ruby
Profiling RubyProfiling Ruby
Profiling Ruby
Ian Pointer
 
Real-time streams and logs with Storm and Kafka
Real-time streams and logs with Storm and KafkaReal-time streams and logs with Storm and Kafka
Real-time streams and logs with Storm and Kafka
Andrew Montalenti
 
Real Time Analytics - Stream Processing (Colombo big data meetup 18/05/2017)
Real Time Analytics - Stream Processing (Colombo big data meetup 18/05/2017)Real Time Analytics - Stream Processing (Colombo big data meetup 18/05/2017)
Real Time Analytics - Stream Processing (Colombo big data meetup 18/05/2017)
mahesh madushanka
 
Lets crash-applications
Lets crash-applicationsLets crash-applications
Lets crash-applications
Tier1 app
 
How & why-memory-efficient?
How & why-memory-efficient?How & why-memory-efficient?
How & why-memory-efficient?
Tier1 app
 
streamparse and pystorm: simple reliable parallel processing with storm
streamparse and pystorm: simple reliable parallel processing with stormstreamparse and pystorm: simple reliable parallel processing with storm
streamparse and pystorm: simple reliable parallel processing with storm
Daniel Blanchard
 
7 jvm-arguments-v1
7 jvm-arguments-v17 jvm-arguments-v1
7 jvm-arguments-v1
Tier1 app
 
Gor Nishanov, C++ Coroutines – a negative overhead abstraction
Gor Nishanov,  C++ Coroutines – a negative overhead abstractionGor Nishanov,  C++ Coroutines – a negative overhead abstraction
Gor Nishanov, C++ Coroutines – a negative overhead abstraction
Sergey Platonov
 
Segmentation Faults, Page Faults, Processes, Threads, and Tasks
Segmentation Faults, Page Faults, Processes, Threads, and TasksSegmentation Faults, Page Faults, Processes, Threads, and Tasks
Segmentation Faults, Page Faults, Processes, Threads, and Tasks
David Evans
 
Storm - As deep into real-time data processing as you can get in 30 minutes.
Storm - As deep into real-time data processing as you can get in 30 minutes.Storm - As deep into real-time data processing as you can get in 30 minutes.
Storm - As deep into real-time data processing as you can get in 30 minutes.
Dan Lynn
 
Profiling & Testing with Spark
Profiling & Testing with SparkProfiling & Testing with Spark
Profiling & Testing with Spark
Roger Rafanell Mas
 
Beirut Java User Group JVM presentation
Beirut Java User Group JVM presentationBeirut Java User Group JVM presentation
Beirut Java User Group JVM presentation
Mahmoud Anouti
 
Stream Processing Frameworks
Stream Processing FrameworksStream Processing Frameworks
Stream Processing Frameworks
SirKetchup
 
JVM Garbage Collection Tuning
JVM Garbage Collection TuningJVM Garbage Collection Tuning
JVM Garbage Collection Tuning
ihji
 

What's hot (20)

Where the wild things are - Benchmarking and Micro-Optimisations
Where the wild things are - Benchmarking and Micro-OptimisationsWhere the wild things are - Benchmarking and Micro-Optimisations
Where the wild things are - Benchmarking and Micro-Optimisations
 
GTAC 2014: What lurks in test suites?
GTAC 2014: What lurks in test suites?GTAC 2014: What lurks in test suites?
GTAC 2014: What lurks in test suites?
 
Performance and how to measure it - ProgSCon London 2016
Performance and how to measure it - ProgSCon London 2016Performance and how to measure it - ProgSCon London 2016
Performance and how to measure it - ProgSCon London 2016
 
Embedded systems
Embedded systems Embedded systems
Embedded systems
 
Performance is a Feature! at DDD 11
Performance is a Feature! at DDD 11Performance is a Feature! at DDD 11
Performance is a Feature! at DDD 11
 
How to write memory efficient code?
How to write memory efficient code?How to write memory efficient code?
How to write memory efficient code?
 
Profiling Ruby
Profiling RubyProfiling Ruby
Profiling Ruby
 
Real-time streams and logs with Storm and Kafka
Real-time streams and logs with Storm and KafkaReal-time streams and logs with Storm and Kafka
Real-time streams and logs with Storm and Kafka
 
Real Time Analytics - Stream Processing (Colombo big data meetup 18/05/2017)
Real Time Analytics - Stream Processing (Colombo big data meetup 18/05/2017)Real Time Analytics - Stream Processing (Colombo big data meetup 18/05/2017)
Real Time Analytics - Stream Processing (Colombo big data meetup 18/05/2017)
 
Lets crash-applications
Lets crash-applicationsLets crash-applications
Lets crash-applications
 
How & why-memory-efficient?
How & why-memory-efficient?How & why-memory-efficient?
How & why-memory-efficient?
 
streamparse and pystorm: simple reliable parallel processing with storm
streamparse and pystorm: simple reliable parallel processing with stormstreamparse and pystorm: simple reliable parallel processing with storm
streamparse and pystorm: simple reliable parallel processing with storm
 
7 jvm-arguments-v1
7 jvm-arguments-v17 jvm-arguments-v1
7 jvm-arguments-v1
 
Gor Nishanov, C++ Coroutines – a negative overhead abstraction
Gor Nishanov,  C++ Coroutines – a negative overhead abstractionGor Nishanov,  C++ Coroutines – a negative overhead abstraction
Gor Nishanov, C++ Coroutines – a negative overhead abstraction
 
Segmentation Faults, Page Faults, Processes, Threads, and Tasks
Segmentation Faults, Page Faults, Processes, Threads, and TasksSegmentation Faults, Page Faults, Processes, Threads, and Tasks
Segmentation Faults, Page Faults, Processes, Threads, and Tasks
 
Storm - As deep into real-time data processing as you can get in 30 minutes.
Storm - As deep into real-time data processing as you can get in 30 minutes.Storm - As deep into real-time data processing as you can get in 30 minutes.
Storm - As deep into real-time data processing as you can get in 30 minutes.
 
Profiling & Testing with Spark
Profiling & Testing with SparkProfiling & Testing with Spark
Profiling & Testing with Spark
 
Beirut Java User Group JVM presentation
Beirut Java User Group JVM presentationBeirut Java User Group JVM presentation
Beirut Java User Group JVM presentation
 
Stream Processing Frameworks
Stream Processing FrameworksStream Processing Frameworks
Stream Processing Frameworks
 
JVM Garbage Collection Tuning
JVM Garbage Collection TuningJVM Garbage Collection Tuning
JVM Garbage Collection Tuning
 

Similar to Is your profiler speaking the same language as you? -- Docklands JUG

Devoxx PL: Is your profiler speaking the same language as you?
Devoxx PL: Is your profiler speaking the same language as you?Devoxx PL: Is your profiler speaking the same language as you?
Devoxx PL: Is your profiler speaking the same language as you?
Simon Maple
 
Devoxx PL: Is your profiler speaking the same language as you?
Devoxx PL: Is your profiler speaking the same language as you?Devoxx PL: Is your profiler speaking the same language as you?
Devoxx PL: Is your profiler speaking the same language as you?
Simon Maple
 
DevoxxUK: Is your profiler speaking the same language as you?
DevoxxUK: Is your profiler speaking the same language as you?DevoxxUK: Is your profiler speaking the same language as you?
DevoxxUK: Is your profiler speaking the same language as you?
Simon Maple
 
Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)
Felix Geisendörfer
 
Basic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsBasic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.js
Gary Yeh
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
orkaplan
 
Server Side JavaScript - You ain't seen nothing yet
Server Side JavaScript - You ain't seen nothing yetServer Side JavaScript - You ain't seen nothing yet
Server Side JavaScript - You ain't seen nothing yetTom Croucher
 
Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014Hajime Tazaki
 
LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1
Hajime Tazaki
 
Microservices with Micronaut
Microservices with MicronautMicroservices with Micronaut
Microservices with Micronaut
QAware GmbH
 
OS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switchOS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switch
Daniel Ben-Zvi
 
Nodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredevNodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredev
Felix Geisendörfer
 
Hs java open_party
Hs java open_partyHs java open_party
Hs java open_party
Open Party
 
Apache Submarine: Unified Machine Learning Platform
Apache Submarine: Unified Machine Learning PlatformApache Submarine: Unified Machine Learning Platform
Apache Submarine: Unified Machine Learning Platform
Wangda Tan
 
May2010 hex-core-opt
May2010 hex-core-optMay2010 hex-core-opt
May2010 hex-core-optJeff Larkin
 
Nodejs Intro Part One
Nodejs Intro Part OneNodejs Intro Part One
Nodejs Intro Part One
Budh Ram Gurung
 
1032 cs208 g operation system ip camera case share.v0.2
1032 cs208 g operation system ip camera case share.v0.21032 cs208 g operation system ip camera case share.v0.2
1032 cs208 g operation system ip camera case share.v0.2
Stanley Ho
 
Here comes the Loom - Ya!vaConf.pdf
Here comes the Loom - Ya!vaConf.pdfHere comes the Loom - Ya!vaConf.pdf
Here comes the Loom - Ya!vaConf.pdf
Krystian Zybała
 

Similar to Is your profiler speaking the same language as you? -- Docklands JUG (20)

Devoxx PL: Is your profiler speaking the same language as you?
Devoxx PL: Is your profiler speaking the same language as you?Devoxx PL: Is your profiler speaking the same language as you?
Devoxx PL: Is your profiler speaking the same language as you?
 
Devoxx PL: Is your profiler speaking the same language as you?
Devoxx PL: Is your profiler speaking the same language as you?Devoxx PL: Is your profiler speaking the same language as you?
Devoxx PL: Is your profiler speaking the same language as you?
 
DevoxxUK: Is your profiler speaking the same language as you?
DevoxxUK: Is your profiler speaking the same language as you?DevoxxUK: Is your profiler speaking the same language as you?
DevoxxUK: Is your profiler speaking the same language as you?
 
Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)
 
Basic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsBasic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.js
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
JavaScript Event Loop
JavaScript Event LoopJavaScript Event Loop
JavaScript Event Loop
 
Server Side JavaScript - You ain't seen nothing yet
Server Side JavaScript - You ain't seen nothing yetServer Side JavaScript - You ain't seen nothing yet
Server Side JavaScript - You ain't seen nothing yet
 
Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014
 
LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1
 
Microservices with Micronaut
Microservices with MicronautMicroservices with Micronaut
Microservices with Micronaut
 
OS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switchOS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switch
 
Nodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredevNodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredev
 
Hs java open_party
Hs java open_partyHs java open_party
Hs java open_party
 
Java multi thread programming on cmp system
Java multi thread programming on cmp systemJava multi thread programming on cmp system
Java multi thread programming on cmp system
 
Apache Submarine: Unified Machine Learning Platform
Apache Submarine: Unified Machine Learning PlatformApache Submarine: Unified Machine Learning Platform
Apache Submarine: Unified Machine Learning Platform
 
May2010 hex-core-opt
May2010 hex-core-optMay2010 hex-core-opt
May2010 hex-core-opt
 
Nodejs Intro Part One
Nodejs Intro Part OneNodejs Intro Part One
Nodejs Intro Part One
 
1032 cs208 g operation system ip camera case share.v0.2
1032 cs208 g operation system ip camera case share.v0.21032 cs208 g operation system ip camera case share.v0.2
1032 cs208 g operation system ip camera case share.v0.2
 
Here comes the Loom - Ya!vaConf.pdf
Here comes the Loom - Ya!vaConf.pdfHere comes the Loom - Ya!vaConf.pdf
Here comes the Loom - Ya!vaConf.pdf
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 

Is your profiler speaking the same language as you? -- Docklands JUG

  • 1. Is your profiler speaking the same language as you? Simon Maple @sjmaple
  • 3. Agenda • Performance Tools • Performance by numbers • Sampling vs Tracing • XRebel • JRebel 3
  • 4.
  • 5. Performance Tools • Java Monitoring Tools • Java Profilers • Java Testing Tools 5
  • 8. 8
  • 9. 9
  • 10. 10
  • 11. 11
  • 12. 12
  • 13. 13
  • 14. 14
  • 15. 15
  • 16. The Journey of Performance 16
  • 20. Profiling CPU Tracing Sampling Memory Usage Allocation We are only talking about this part today
  • 21. JVM has ability to produce thread dump: Press Ctrl+Break on Windows kill -3 PID on *nix "http-nio-8080-exec-1"#40 daemon prio=5 os_prio=31 tid=0x00007fd7057ed800 nid=0x7313 runnable java.lang.Thread.State: RUNNABLE at o.s.s.p.w.OwnerController.processFindForm(OwnerController.java:89) at s.r.NativeMethodAccessorImpl.invoke0(Native Method) at s.r.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at s.r.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at j.l.r.Method.invoke(Method.java:497) What is a sample?
  • 22. Sampling interval : 20 ms Sample count: 4
  • 23. Sampling interval : 1 ms Sample count: 100+
  • 27. Taming safepoint bias Java Mission Control Proprietary protocol Java 7u40 Honest Profiler https://github.com/RichardWarburton/honest-profiler AsyncGetCallTrace JVMTI NB! not documented
  • 28. public  void  businessMethod()  {
    long  start  =  System.currentTimeMillis();
    work();
    Profiler.log(System.currentTimeMillis()-­‐start);   } Tracing (Instrumentation)
  • 29. Tracing public  void  businessMethod()  {
    long  start  =  System.nanoTime();
    work();
    Profiler.log(System.nanoTime()-­‐start);
 }
  • 30. Tracing public  void  businessMethod()  {
    Profiler.start(“businessMethod");      try  {
        work();
    }  finally  {
        Profiler.log("businessMethod");
    }
 }
  • 31. System.nanoTime System.currentTimeMillis Parallel thread updating easily accessible memory location sleep-wakeup-update yield-wakeup-update busy-loop-update
  • 32. class  Profiler  {   
    Loop  loop;
 
    public  static  void  start(String  method)  {
        long  now  =  loop.getTime();          …
    }  
  • 33. public  class  Loop  implements  Runnable  {
        private  volatile  long  time;
        public  void  run()  {
                while  (running)  {
                        time  =  System.nanoTime();
                        sleep();
                }
        }          public  final  long  getTime()  {
                return  time;
        }   Busy Loop
  • 34. Nano seconds put into perspective Reading memory is not free. It takes cycles = nanoseconds Each (software) layer is not free. JVM,JNI,OS,HW http://shipilev.net/blog/2014/nanotrusting-nanotime/ Nanotrusting the NanoTime
  • 35. Nano seconds put into perspective http://shipilev.net/blog/2014/nanotrusting-nanotime/ Nanotrusting the NanoTime granularity_nanotime: 26.300 +-0.205 ns latency_nanotime: 25.542 +-0.024 ns granularity_nanotime: 29.322 +-1.293 ns latency_nanotime: 29.910 +-1.626 ns granularity_nanotime: 371,419 +-1,541 ns latency_nanotime: 14,415 +-0,389 ns Linux Solaris Windows
  • 36. Sleep timer: time-slicing & scheduling Minimum sleep times: Win8: 1.7 ms (1.0 ms using JNI + socket poll) Linux: 0.1 ms OS X: 0.05 ms VirtualBox + Linux: don’t ask :) Still uses 25-50% of CPU core Yield? Windows scheduler skips yielded threads in case of CPU starvation
  • 37. public  class  Loop  implements  Runnable  {
        private  volatile  long  time;
        public  void  run()  {
                while  (running)  {
                        time  =  System.nanoTime();
                        sleep();
                }
        }          private  void  sleep()  {
            if  (!MiscUtil.isWindows())  {
                  Thread.yield();
            }
        } Busy Loop
  • 38. public  class  Loop  implements  Runnable  {
        private  volatile  long  time;
        public  void  run()  {
                while  (running)  {
                        time  =  System.nanoTime();
                        sleep();
                }
        }          private  void  sleep()  {
            if  (!MiscUtil.isWindows())  {
                  Thread.yield();
            }
        } Busy Loop
  • 39. Busy Loop public  class  Loop  implements  Runnable  {
        private  volatile  long  time;
        public  void  run()  {
                while  (running)  {
                        time  =  System.nanoTime();
                        sleep();
                }
        }          private  void  sleep()  {
            if  (!MiscUtil.isWindows())  {
                  Thread.yield();
            }
        }
  • 40. public  class  Loop  implements  Runnable  {
        private  volatile  long  time;
        public  void  run()  {
                while  (running)  {
                        time  =  System.nanoTime();
                        sleep();
                }
        }          private  void  sleep()  {
            if  (!MiscUtil.isWindows())  {
                  Thread.yield();
            }
        } Busy Loop
  • 42. Database access Web Services RMI Various application layers 3rd-party components HTTP session Exceptions Caches File system access View rendering Serialization GC What other performance considerations should we have?
  • 43. Questions you should be asking …….. …….. …….. ……..
  • 44. Questions you should be asking Where was most of the time spent? How many SQL queries were executed? How much time did the external calls take? What’s my HTTP session state? Is caching working properly? Is there any excessive work done by the app?
  • 45. Most improvement gained here! This is where we should focus first! A B C D E
  • 46.
  • 47. Download trials and get FREE shirts :) JRebel: http://0t.ee/docklandsjr XRebel: http://0t.ee/docklandsxr 47