SlideShare a Scribd company logo
Follow your code: Node/V8 tracing
Gireesh Punathil, 26th Aug 2016
Agenda
♨ Overview of Node/V8 Runtime environment
♨ Eclipse as a Node.js development platform
♨ Debug Server-side Javascript through Browser
♨ Overview of in-built tracing
♨ Top tracing options in Node/V8
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
Philosophy of event-driven programming
Traditional synchronous multi-threaded model Asynchronous event driven model
Source: http://bit.ly/2baQkwp
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
4
dns
file
net
timer
Hello event driven
world!
=> dnscb
127.0.0.1
=> fscb
Name: node …
=> netcb
<html> …
=> timercb
I am timed out
Anatomy of event loop
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
var a = 10
var b = ‘g’
var c = new Object()
res.on(‘data’, function(d) {
data += d
});
dynamic typing
async, event driven
born for the cloud
isomorphic
single threaded
Major features of Node.js
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
Eclipse for Node.js
 Node.js a first class citizen in Eclipse
 Nodeclipse is the Eclipse plugin for the Node.js
 Professional Node.js development made easy, productive
and a cool experience
 Syntax high-lighting, in-built semantic validation, live
debugging, Content assist and much more
 Active community support
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
Prepare Eclipse for Node.js
 Get the latest Node.js
 Get the latest Java
 Get the latest Eclipse
 In Eclipse install new software
 Switch to Node perspective
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
Debug Server side script in the browser
♨ Server side code can be very large
♨ Quite difficult to follow the control flow and logic
♨ console logging very inefficient, and bad practice
♨ Native debugging is even more complex
♨ At the same time, vetting critical for reliable production
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
Debug Server side script in the browser
♨ Install a debugger module
♨ Start the application in the debugger
♨ Get the debugger port, and access it in the Browser
♨ Start following the code!
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
Tracing the script
Purpose
Trace Javascript functions with input and output
Output
Syntax (Heavy profile)
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
Log APIs
Purpose
Collect all the V8 API calls emanating from the application
Output
Syntax
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
Log Script execution
Purpose
Collect all the script / function information as and when they are loaded
/ compiled / recompiled
Output
Syntax
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
Tracing Garbage Collection
Purpose
Trace load in the v8 heap and collection patterns
Output
Syntax
Scavenge collection
Mark-sweep collection
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
Tracing Call Sequence
Purpose
Trace the code flow path on uncaught exception scenarios
Output
Syntax
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
Tracing Compilation
Purpose
Trace optimize compilation decisions and their reasons
Output
Syntax
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
Tracing Compiled Code
Purpose
Trace the generated native code for the Javascript source
Output
Syntax
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
Selectively disable Compilation
Purpose
Identify and omit optimize compilation on problematic methods
Output
Syntax
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
Profile the application for Performance
♨ Manual profiling inefficient and impractical
♨ Adding time measurement cause further burden
♨ Native profilers do not provide Javascript insights
♨ Large applications often contain performance hideouts
♨ Precise performance measures is a hallmark qualifier for
software modules
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
Profile with v8 profiler, view with tick
♨ Run the code inside light-weight profiler
♨ Rename the generated log file to v8.log
♨ Install tick module
♨ Post-process the profile log
♨ Start analyzing the profile!
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
For further learning
♨ Learn Node.js: https://nodejs.org/en/docs/
♨ Learn Javascript: http://www.w3schools.com/js/
♨ Learn V8: https://developers.google.com/v8/intro
♨ Learn Nodeclipse: http://www.nodeclipse.org
♨ Chrome developer tools: https://developer.chrome.com/devtools
Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing

More Related Content

Similar to Follow your code: Node tracing

Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2
Naveen Pete
 
Gestire la qualità del codice con Visual Studio, SonarQube ed Azure Devops
Gestire la qualità del codice con Visual Studio, SonarQube ed Azure DevopsGestire la qualità del codice con Visual Studio, SonarQube ed Azure Devops
Gestire la qualità del codice con Visual Studio, SonarQube ed Azure Devops
Gian Maria Ricci
 
Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017
Matt Raible
 
Jon Stace Web Cryptography API
Jon Stace Web Cryptography APIJon Stace Web Cryptography API
Jon Stace Web Cryptography API
Jon Stace
 
A (XPages) developers guide to Cloudant
A (XPages) developers guide to CloudantA (XPages) developers guide to Cloudant
A (XPages) developers guide to Cloudant
Frank van der Linden
 
OWASP Testing Guide v3
OWASP Testing Guide v3OWASP Testing Guide v3
OWASP Testing Guide v3
Rastislav Turek
 
Owasp Eu Summit 2008 Owasp Testing Guide V3
Owasp Eu Summit 2008 Owasp Testing Guide V3Owasp Eu Summit 2008 Owasp Testing Guide V3
Owasp Eu Summit 2008 Owasp Testing Guide V3
Matteo Meucci
 
Angular2 & Native Script GDG DevFest 2016
Angular2 & Native Script GDG DevFest 2016Angular2 & Native Script GDG DevFest 2016
Angular2 & Native Script GDG DevFest 2016
Luciano Murruni
 
Swift 2.2 Design Patterns CocoaConf Austin 2016
Swift 2.2 Design Patterns CocoaConf Austin 2016Swift 2.2 Design Patterns CocoaConf Austin 2016
Swift 2.2 Design Patterns CocoaConf Austin 2016
Carl Brown
 
PopcornSAR Specialized in AUTOSAR_Company profile
PopcornSAR Specialized in AUTOSAR_Company profilePopcornSAR Specialized in AUTOSAR_Company profile
PopcornSAR Specialized in AUTOSAR_Company profile
PopcornSAR
 
DSAG Jahreskongress 2018 - DevOps and Deployment Pipelines in SAP ABAP Landsc...
DSAG Jahreskongress 2018 - DevOps and Deployment Pipelines in SAP ABAP Landsc...DSAG Jahreskongress 2018 - DevOps and Deployment Pipelines in SAP ABAP Landsc...
DSAG Jahreskongress 2018 - DevOps and Deployment Pipelines in SAP ABAP Landsc...
Sascha Junkert
 
VSSML16 L7. REST API, Bindings, and Basic Workflows
VSSML16 L7. REST API, Bindings, and Basic WorkflowsVSSML16 L7. REST API, Bindings, and Basic Workflows
VSSML16 L7. REST API, Bindings, and Basic Workflows
BigML, Inc
 
Everybody loves Swagger
Everybody loves SwaggerEverybody loves Swagger
Everybody loves Swagger
BizTalk360
 
SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진
VMware Tanzu Korea
 
Test Automation Frameworks: Assumptions, Concepts & Tools
Test Automation Frameworks: Assumptions, Concepts & ToolsTest Automation Frameworks: Assumptions, Concepts & Tools
Test Automation Frameworks: Assumptions, Concepts & Tools
Amit Rawat
 
Introduction to angular 2
Introduction to angular 2Introduction to angular 2
Introduction to angular 2
Dhyego Fernando
 
Rolando Santamaría Masó - Simplicity meets scalability - code.talks 2015
Rolando Santamaría Masó - Simplicity meets scalability - code.talks 2015Rolando Santamaría Masó - Simplicity meets scalability - code.talks 2015
Rolando Santamaría Masó - Simplicity meets scalability - code.talks 2015
AboutYouGmbH
 
Javaeeconf 2016 how to cook apache kafka with camel and spring boot
Javaeeconf 2016 how to cook apache kafka with camel and spring bootJavaeeconf 2016 how to cook apache kafka with camel and spring boot
Javaeeconf 2016 how to cook apache kafka with camel and spring boot
Ivan Vasyliev
 
Appium workshop technopark trivandrum
Appium workshop technopark trivandrumAppium workshop technopark trivandrum
Appium workshop technopark trivandrum
Syam Sasi
 
Create and Manage APIs with API Connect, Swagger and Bluemix
Create and Manage APIs with API Connect, Swagger and BluemixCreate and Manage APIs with API Connect, Swagger and Bluemix
Create and Manage APIs with API Connect, Swagger and Bluemix
Dev_Events
 

Similar to Follow your code: Node tracing (20)

Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2
 
Gestire la qualità del codice con Visual Studio, SonarQube ed Azure Devops
Gestire la qualità del codice con Visual Studio, SonarQube ed Azure DevopsGestire la qualità del codice con Visual Studio, SonarQube ed Azure Devops
Gestire la qualità del codice con Visual Studio, SonarQube ed Azure Devops
 
Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017
 
Jon Stace Web Cryptography API
Jon Stace Web Cryptography APIJon Stace Web Cryptography API
Jon Stace Web Cryptography API
 
A (XPages) developers guide to Cloudant
A (XPages) developers guide to CloudantA (XPages) developers guide to Cloudant
A (XPages) developers guide to Cloudant
 
OWASP Testing Guide v3
OWASP Testing Guide v3OWASP Testing Guide v3
OWASP Testing Guide v3
 
Owasp Eu Summit 2008 Owasp Testing Guide V3
Owasp Eu Summit 2008 Owasp Testing Guide V3Owasp Eu Summit 2008 Owasp Testing Guide V3
Owasp Eu Summit 2008 Owasp Testing Guide V3
 
Angular2 & Native Script GDG DevFest 2016
Angular2 & Native Script GDG DevFest 2016Angular2 & Native Script GDG DevFest 2016
Angular2 & Native Script GDG DevFest 2016
 
Swift 2.2 Design Patterns CocoaConf Austin 2016
Swift 2.2 Design Patterns CocoaConf Austin 2016Swift 2.2 Design Patterns CocoaConf Austin 2016
Swift 2.2 Design Patterns CocoaConf Austin 2016
 
PopcornSAR Specialized in AUTOSAR_Company profile
PopcornSAR Specialized in AUTOSAR_Company profilePopcornSAR Specialized in AUTOSAR_Company profile
PopcornSAR Specialized in AUTOSAR_Company profile
 
DSAG Jahreskongress 2018 - DevOps and Deployment Pipelines in SAP ABAP Landsc...
DSAG Jahreskongress 2018 - DevOps and Deployment Pipelines in SAP ABAP Landsc...DSAG Jahreskongress 2018 - DevOps and Deployment Pipelines in SAP ABAP Landsc...
DSAG Jahreskongress 2018 - DevOps and Deployment Pipelines in SAP ABAP Landsc...
 
VSSML16 L7. REST API, Bindings, and Basic Workflows
VSSML16 L7. REST API, Bindings, and Basic WorkflowsVSSML16 L7. REST API, Bindings, and Basic Workflows
VSSML16 L7. REST API, Bindings, and Basic Workflows
 
Everybody loves Swagger
Everybody loves SwaggerEverybody loves Swagger
Everybody loves Swagger
 
SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진
 
Test Automation Frameworks: Assumptions, Concepts & Tools
Test Automation Frameworks: Assumptions, Concepts & ToolsTest Automation Frameworks: Assumptions, Concepts & Tools
Test Automation Frameworks: Assumptions, Concepts & Tools
 
Introduction to angular 2
Introduction to angular 2Introduction to angular 2
Introduction to angular 2
 
Rolando Santamaría Masó - Simplicity meets scalability - code.talks 2015
Rolando Santamaría Masó - Simplicity meets scalability - code.talks 2015Rolando Santamaría Masó - Simplicity meets scalability - code.talks 2015
Rolando Santamaría Masó - Simplicity meets scalability - code.talks 2015
 
Javaeeconf 2016 how to cook apache kafka with camel and spring boot
Javaeeconf 2016 how to cook apache kafka with camel and spring bootJavaeeconf 2016 how to cook apache kafka with camel and spring boot
Javaeeconf 2016 how to cook apache kafka with camel and spring boot
 
Appium workshop technopark trivandrum
Appium workshop technopark trivandrumAppium workshop technopark trivandrum
Appium workshop technopark trivandrum
 
Create and Manage APIs with API Connect, Swagger and Bluemix
Create and Manage APIs with API Connect, Swagger and BluemixCreate and Manage APIs with API Connect, Swagger and Bluemix
Create and Manage APIs with API Connect, Swagger and Bluemix
 

Recently uploaded

Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
devvsandy
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
Rakesh Kumar R
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
GohKiangHock
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 

Recently uploaded (20)

Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 

Follow your code: Node tracing

  • 1. Follow your code: Node/V8 tracing Gireesh Punathil, 26th Aug 2016
  • 2. Agenda ♨ Overview of Node/V8 Runtime environment ♨ Eclipse as a Node.js development platform ♨ Debug Server-side Javascript through Browser ♨ Overview of in-built tracing ♨ Top tracing options in Node/V8 Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 3. Philosophy of event-driven programming Traditional synchronous multi-threaded model Asynchronous event driven model Source: http://bit.ly/2baQkwp Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 4. 4 dns file net timer Hello event driven world! => dnscb 127.0.0.1 => fscb Name: node … => netcb <html> … => timercb I am timed out Anatomy of event loop Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 5. var a = 10 var b = ‘g’ var c = new Object() res.on(‘data’, function(d) { data += d }); dynamic typing async, event driven born for the cloud isomorphic single threaded Major features of Node.js Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 6. Eclipse for Node.js  Node.js a first class citizen in Eclipse  Nodeclipse is the Eclipse plugin for the Node.js  Professional Node.js development made easy, productive and a cool experience  Syntax high-lighting, in-built semantic validation, live debugging, Content assist and much more  Active community support Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 7. Prepare Eclipse for Node.js  Get the latest Node.js  Get the latest Java  Get the latest Eclipse  In Eclipse install new software  Switch to Node perspective Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 8. Debug Server side script in the browser ♨ Server side code can be very large ♨ Quite difficult to follow the control flow and logic ♨ console logging very inefficient, and bad practice ♨ Native debugging is even more complex ♨ At the same time, vetting critical for reliable production Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 9. Debug Server side script in the browser ♨ Install a debugger module ♨ Start the application in the debugger ♨ Get the debugger port, and access it in the Browser ♨ Start following the code! Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 10. Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 11. Tracing the script Purpose Trace Javascript functions with input and output Output Syntax (Heavy profile) Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 12. Log APIs Purpose Collect all the V8 API calls emanating from the application Output Syntax Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 13. Log Script execution Purpose Collect all the script / function information as and when they are loaded / compiled / recompiled Output Syntax Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 14. Tracing Garbage Collection Purpose Trace load in the v8 heap and collection patterns Output Syntax Scavenge collection Mark-sweep collection Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 15. Tracing Call Sequence Purpose Trace the code flow path on uncaught exception scenarios Output Syntax Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 16. Tracing Compilation Purpose Trace optimize compilation decisions and their reasons Output Syntax Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 17. Tracing Compiled Code Purpose Trace the generated native code for the Javascript source Output Syntax Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 18. Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 19. Selectively disable Compilation Purpose Identify and omit optimize compilation on problematic methods Output Syntax Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 20. Profile the application for Performance ♨ Manual profiling inefficient and impractical ♨ Adding time measurement cause further burden ♨ Native profilers do not provide Javascript insights ♨ Large applications often contain performance hideouts ♨ Precise performance measures is a hallmark qualifier for software modules Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 21. Profile with v8 profiler, view with tick ♨ Run the code inside light-weight profiler ♨ Rename the generated log file to v8.log ♨ Install tick module ♨ Post-process the profile log ♨ Start analyzing the profile! Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 22. Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing
  • 23. For further learning ♨ Learn Node.js: https://nodejs.org/en/docs/ ♨ Learn Javascript: http://www.w3schools.com/js/ ♨ Learn V8: https://developers.google.com/v8/intro ♨ Learn Nodeclipse: http://www.nodeclipse.org ♨ Chrome developer tools: https://developer.chrome.com/devtools Thursday, August 25, 2016EclipseSummit 2016, Bangalore Follow your code: Node / V8 tracing