SlideShare ist ein Scribd-Unternehmen logo
1 von 22
JS Engine Performance
               Scutariu Paul
               Stirban Ionut




                               1
Table of contents




1.   Introduction
2.   V8 engine – Google Chrome 16
3.   SpiderMonkey - FireFox 9
4.   Chakra – IE 9
5.   Carakan – Opera 11
6.   Case study – Chrome vs FireFox vs IE vs Opera
7.   Bibliography




                                                     2
Introduction


■ The performance of javascript engine is an important feature of a
web browser when developing a client web application.

■ The user will obvious be more satisfied if some elements of the
application are working better. In that case he may use that
browser where the javascript engine is much faster

■ By far, v8 engine used by google is faster than other browsers like
FireFox, IE 9 or Opera. This will be shown is the last chapter at case
study

■ So, regarding these, we will talk about in this presentation about
the improvements of all these engines . Also the statistics at the end
of presentation will show the results of every engine




                                                                  3
V8 Engine – Google Chrome 1


■ V8 is Google's open source JavaScript engine

■ V8 is written in C++ and is used in Google Chrome, the open
source browser from Google

■ V8 can run standalone, or can be embedded into any C++
application

■ V8 increases performance by compiling JavaScript to native
machine code before executing it, rather than to execute bytecode
or interpreting it. Further performance increases are acheived by
employing optimization techniques such as inline caching

■ With these features, JavaScript applications running within V8 are
said to have an effective speed comparable to a compiled binary



                                                                4
V8 Engine – Google Chrome 2


Improvements:

1. fast property access + hidden classes
function Point(x,y){
          this.x = x;
          this.y = y;
}
var p1 = new Point(1,2);
var p2 = new Point(2,3);
- most JavaScript engines would store p1 and p2 like they don’t
belong to the same class, but in v8 p1 and p2 shares the same
hidden class.

2. Dynamic machine code generation
- javascript source code is compiled into machine code when first
execution occurs.

                                                                  5
V8 Engine – Google Chrome 3


Improvements:

3. Garbage collector
v8 engine:
- stops program execution when performing a garbage collection
cycle.

- processes only part of the object heap in most garbage collection
cycles. This minimizes the impact of stopping the application.

- always knows exactly where all objects and pointers are in
memory. This avoids falsely identifying objects as pointers which can
result in memory leaks.

http://code.google.com/apis/v8/design.html
http://en.wikipedia.org/wiki/Inline_caching

                                                                 6
SpiderMonkey – FireFox 9 1


■ SpiderMonkey: 30% faster

■ SpiderMonkey integrates type inference with Jaegermonkey JIT
compiler to generate efficient code

■ SpiderMonkey is written in C++ and contains an interpreter,
several JIT compilers (TraceMonkey, JägerMonkey, and IonMonkey),
a decompiler, and a garbage collector.




                                                            7
SpiderMonkey – FireFox 9 2


TraceMonkey

- TraceMonkey is the first JIT compiler written for the JavaScript
language

- The compiler was first released as part of SpiderMonkey in Firefox
3.5, providing "performance improvements ranging between 20 and
40 times faster" than the baseline interpreter in Firefox 3

- Instead of compiling whole functions, TraceMonkey operates by
recording control flow and data types during interpreter execution.
This data then informs the construction of Trace Trees, highly
specialized paths of native code




                                                                     8
SpiderMonkey – FireFox 9 3

JägerMonkey

- JägerMonkey, internally named MethodJIT, is a whole-method JIT
compiler designed to improve performance in cases where
TraceMonkey cannot generate stable native code.

- JägerMonkey operates very differently from other compilers in its
class: while typical compilers work by constructing and optimizing
a control flow graph representing the function, JägerMonkey
instead operates by iterating linearly forward through
SpiderMonkey bytecode, the internal function representation.
Although this prohibits optimizations that require instruction
reordering, JägerMonkey compilation has the advantage of being
extremely fast, which is useful for JavaScript since recompilation due
to changing variable types is frequent




                                                                 9
SpiderMonkey – FireFox 9 4

JägerMonkey

 Mozilla implemented a number of critical optimizations in
JägerMonkey, most importantly Polymorphic Inline Caches and
Type inference

http://en.wikipedia.org/wiki/Type_inference


IonMonkey

 IonMonkey is a compiler in the traditional sense: it translates
SpiderMonkey bytecode into a control flow graph, using SSA for the
intermediate representation. This architecture enables well-known
optimizations from other programming languages to be used for
JavaScript, including type specialization, function inlining, linear-
scan register allocation, dead code elimination, and loop-invariant
code motion
                                                                10
Chakra – IE 9 1

■ Chakra is the new JScript engine developed by Microsoft for their
upcoming Internet Explorer 9 (IE9) web browser

■ A distinctive feature of the engine is that it compiles scripts on a
separate CPU core, parallel to the web browser

■ Chakra improves the performance of the browser and the web
pages render and respond much faster




                                                                  11
Chakra – IE 9 2

■ Chakra, fundamentally changes the performance characteristics
of JavaScript inside Internet Explorer 9. Chakra includes a new
JavaScript compiler that compiles JavaScript source code into high-
quality native machine code, a new interpreter for executing script
on traditional web pages, and improvements to the JavaScript
runtime and libraries. You can read more details on Chakra
at TechNet.




                                                             12
Carakan – Opera 11 1

■ So how fast is Carakan? Using a regular cross-platform switch
dispatch mechanism (without any generated native code) Carakan
is currently about two and a half times faster at the SunSpider
benchmark than the ECMAScript engine in Presto 2.2 (Opera 10
Alpha). Since Opera is ported to many different hardware
architectures, this cross-platform improvement is on its own very
important

■ The native code generation in Carakan is not yet ready for full-
scale testing, but the few individual benchmark tests that it is
already compatible with runs between 5 and 50 times faster, so it is
looking promising so far




                                                                13
Carakan – Opera 11 2

Improvements:

1. Automatic object classification

-   A major improvement over this engine is in the representation of
    ECMAScript objects. Each object is assigned a class that collects
    various information about the object, such as its prototype and
    the order and names of some or all of its properties

-   Class assignment is naturally very dynamic, since ECMAScript is a
    very dynamic language, but it is organized such that objects with
    the same prototype and the same set of properties are assigned
    the same class




                                                                14
Carakan – Opera 11 3

Improvements:

1. Automatic object classification

-   This representation allows compact storage of individual objects,
    since most of the complicated structures representing the
    object's properties are stored in the class, where they are shared
    with all other objects with the same class. In real-world programs
    with many objects of the same classes, this can save significant
    amounts of memory.

-   For two objects with the same class, if the lookup of a property
    "X" on the first object gave the result Y, we know that the same
    lookup on the second object will also give the result Y. We use
    this to cache the result of individual property lookups in
    ECMAScript programs, which greatly speeds up code that
    contains many property reads or writes


                                                                 15
Carakan – Opera 11 4

Improvements:

2. Native code generation

- Although engine's bytecode instruction set permits the
implementation of a significantly faster bytecode execution engine,
there is still significant overhead involved in executing simple
ECMAScript code, such as loops performing integer arithmetics, in a
bytecode interpreter.

- In addition to generating native code from regular ECMAScript
code, we also generate native code that performs the matching of
simple regular expressions. This improves performance a lot when
searching for matches of simple regular expressions in long strings.
For sufficiently long strings, this actually makes searching for a
substring using a regular expression faster than the same search
using String.prototype.indexOf. For shorter strings, the speed is limited
by the overhead of compiling the regular expression

                                                                   16
Carakan – Opera 11 5

Improvements:

3. Register-based bytecode

- The last couple of generations of Opera's ECMAScript engine have
used a stack-based bytecode instruction set. This type of instruction
set is based around a stack of values, where most instructions "pop"
input operands from the value stack, process them, and "push" the
result back onto the value stack. Some instructions simply push
values onto the value stack, and others rearrange the values on the
stack. This gives compact bytecode programs and is easy to
generate bytecode for




                                                                17
Case study – Chrome vs FireFox vs IE vs Opera 1

Now we will se some performance statistics using v8 and kraken
benchmarks.

V8 benchmark:http://v8.googlecode.com/svn/data/benchmarks/v5/run

                                      Score
  2500


  2000


  1500


  1000                                                      2085

                                                1354
   500                      959
            629

     0
            IE 9         Opera 11.6           FireFox 9   Chrome 16




                                                                      18
Case study – Chrome vs FireFox vs IE vs Opera 2

Now we will se some performance statistics using v8 and kraken
benchmarks.

V8 benchmark:http://v8.googlecode.com/svn/data/benchmarks/v5/run

              Browser            Speed
              Google Chrome 16   2085 ms

              Opera 11.6         959 ms

              FireFox 9          1354 ms

              IE 9               629 ms




 The biggest score indicates the browser’s engine with the best
 performance




                                                                 19
Case study – Chrome vs FireFox vs IE vs Opera 3

Now we will se some performance statistics using v8 and kraken
benchmarks.

Kraken benchmark:http://krakenbenchmark.mozilla.org/

                       Time in milliseconds
 60000


 50000


 40000


 30000
                                                        55878

 20000                                   42685


 10000
            13399         15315.4

     0
          Chrome 16      FireFox 9     Opera 11.6        IE 9




                                                                 20
Case study – Chrome vs FireFox vs IE vs Opera 4

Now we will se some performance statistics using v8 and kraken
benchmarks.

Kraken benchmark:http://krakenbenchmark.mozilla.org/

              Browser            Speed
              Google Chrome 16   13399.3ms +/- 1.8%
              FireFox 9          15315.4ms +/- 0.6%
              Opera 11.6         42685.0ms +/- 1.2%
              IE 9               55878.0ms +/- 1.8%




 Now time is being calculated in miliseconds and obvious the lowest is
 the best engine

 As we can see, Google’s v8 is the best engine by far, and the
 statistics show this.


                                                                 21
Bibliography

http://code.google.com/apis/v8/design.html
http://blog.mozilla.com/blog/2011/12/20/major-javascript-enhancements-
make-firefox-speedy-up-to-30-faster/
http://my.opera.com/core/blog/2009/02/04/carakan
http://www.thewindowsclub.com/microsofts-new-javascript-engine-
codenamed-chakra-for-internet-explorer-9
http://en.wikipedia.org/wiki/SpiderMonkey_(JavaScript_engine)
http://en.wikipedia.org/wiki/V8_(JavaScript_engine)




                                                            22

Weitere ähnliche Inhalte

Was ist angesagt?

OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersJavan Rasokat
 
Module 2 introduction à asp.net web forms
Module 2   introduction à asp.net web formsModule 2   introduction à asp.net web forms
Module 2 introduction à asp.net web formsMohammed Amine Mostefai
 
Agile Methodology in Software Development
Agile Methodology in Software DevelopmentAgile Methodology in Software Development
Agile Methodology in Software DevelopmentRaghav Seth
 
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스NAVER D2
 
Grokking Techtalk #39: Gossip protocol and applications
Grokking Techtalk #39: Gossip protocol and applicationsGrokking Techtalk #39: Gossip protocol and applications
Grokking Techtalk #39: Gossip protocol and applicationsGrokking VN
 
Kafka: All an engineer needs to know
Kafka: All an engineer needs to knowKafka: All an engineer needs to know
Kafka: All an engineer needs to knowThao Huynh Quang
 
MongoDB WiredTiger Internals
MongoDB WiredTiger InternalsMongoDB WiredTiger Internals
MongoDB WiredTiger InternalsNorberto Leite
 
Introduction à l’intégration continue avec Jenkins
Introduction à l’intégration continue avec JenkinsIntroduction à l’intégration continue avec Jenkins
Introduction à l’intégration continue avec JenkinsEric Hogue
 
Agile Methodology and Tools
Agile Methodology and ToolsAgile Methodology and Tools
Agile Methodology and ToolsNaresh Gajuveni
 
Web automation using selenium.ppt
Web automation using selenium.pptWeb automation using selenium.ppt
Web automation using selenium.pptAna Sarbescu
 
Intégration continue
Intégration continueIntégration continue
Intégration continueKlee Group
 
Agile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingAgile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingDimitri Ponomareff
 
Introducing Confluent labs Parallel Consumer client | Anthony Stubbes, Confluent
Introducing Confluent labs Parallel Consumer client | Anthony Stubbes, ConfluentIntroducing Confluent labs Parallel Consumer client | Anthony Stubbes, Confluent
Introducing Confluent labs Parallel Consumer client | Anthony Stubbes, ConfluentHostedbyConfluent
 
Automating security test using Selenium and OWASP ZAP - Practical DevSecOps
Automating security test using Selenium and OWASP ZAP - Practical DevSecOpsAutomating security test using Selenium and OWASP ZAP - Practical DevSecOps
Automating security test using Selenium and OWASP ZAP - Practical DevSecOpsMohammed A. Imran
 
Expose your event-driven data to the outside world using webhooks powered by ...
Expose your event-driven data to the outside world using webhooks powered by ...Expose your event-driven data to the outside world using webhooks powered by ...
Expose your event-driven data to the outside world using webhooks powered by ...HostedbyConfluent
 

Was ist angesagt? (20)

Jenkins Overview
Jenkins OverviewJenkins Overview
Jenkins Overview
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
 
Module 2 introduction à asp.net web forms
Module 2   introduction à asp.net web formsModule 2   introduction à asp.net web forms
Module 2 introduction à asp.net web forms
 
Agile Methodology in Software Development
Agile Methodology in Software DevelopmentAgile Methodology in Software Development
Agile Methodology in Software Development
 
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
 
Grokking Techtalk #39: Gossip protocol and applications
Grokking Techtalk #39: Gossip protocol and applicationsGrokking Techtalk #39: Gossip protocol and applications
Grokking Techtalk #39: Gossip protocol and applications
 
Kafka: All an engineer needs to know
Kafka: All an engineer needs to knowKafka: All an engineer needs to know
Kafka: All an engineer needs to know
 
MongoDB WiredTiger Internals
MongoDB WiredTiger InternalsMongoDB WiredTiger Internals
MongoDB WiredTiger Internals
 
How to start performance testing project
How to start performance testing projectHow to start performance testing project
How to start performance testing project
 
Introduction à l’intégration continue avec Jenkins
Introduction à l’intégration continue avec JenkinsIntroduction à l’intégration continue avec Jenkins
Introduction à l’intégration continue avec Jenkins
 
Agile Methodology and Tools
Agile Methodology and ToolsAgile Methodology and Tools
Agile Methodology and Tools
 
Web automation using selenium.ppt
Web automation using selenium.pptWeb automation using selenium.ppt
Web automation using selenium.ppt
 
Intégration continue
Intégration continueIntégration continue
Intégration continue
 
Agile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingAgile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated Testing
 
Introducing Confluent labs Parallel Consumer client | Anthony Stubbes, Confluent
Introducing Confluent labs Parallel Consumer client | Anthony Stubbes, ConfluentIntroducing Confluent labs Parallel Consumer client | Anthony Stubbes, Confluent
Introducing Confluent labs Parallel Consumer client | Anthony Stubbes, Confluent
 
RabbitMQ
RabbitMQRabbitMQ
RabbitMQ
 
Automating security test using Selenium and OWASP ZAP - Practical DevSecOps
Automating security test using Selenium and OWASP ZAP - Practical DevSecOpsAutomating security test using Selenium and OWASP ZAP - Practical DevSecOps
Automating security test using Selenium and OWASP ZAP - Practical DevSecOps
 
Methodes agile
Methodes agileMethodes agile
Methodes agile
 
Fundamentals Performance Testing
Fundamentals Performance TestingFundamentals Performance Testing
Fundamentals Performance Testing
 
Expose your event-driven data to the outside world using webhooks powered by ...
Expose your event-driven data to the outside world using webhooks powered by ...Expose your event-driven data to the outside world using webhooks powered by ...
Expose your event-driven data to the outside world using webhooks powered by ...
 

Ähnlich wie Js engine performance

Chrome v8 web: the open source javascript
Chrome v8 web: the open source javascriptChrome v8 web: the open source javascript
Chrome v8 web: the open source javascriptabn17p
 
Apache Big Data Europe 2016
Apache Big Data Europe 2016Apache Big Data Europe 2016
Apache Big Data Europe 2016Tim Ellison
 
Java dev mar_2021_keynote
Java dev mar_2021_keynoteJava dev mar_2021_keynote
Java dev mar_2021_keynoteSuyash Joshi
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuningJerry Kurian
 
Isomorphic JavaScript with Nashorn
Isomorphic JavaScript with NashornIsomorphic JavaScript with Nashorn
Isomorphic JavaScript with NashornMaxime Najim
 
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.J On The Beach
 
The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)Geekstone
 
Developing Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's GuideDeveloping Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's GuideMohanraj Thirumoorthy
 
EXPath Webapp - CXAN: a case-study for Servlex, an XML web framework
EXPath Webapp - CXAN: a case-study for Servlex, an XML web frameworkEXPath Webapp - CXAN: a case-study for Servlex, an XML web framework
EXPath Webapp - CXAN: a case-study for Servlex, an XML web frameworkFlorent Georges
 
Phil Basford - machine learning at scale with aws sage maker
Phil Basford - machine learning at scale with aws sage makerPhil Basford - machine learning at scale with aws sage maker
Phil Basford - machine learning at scale with aws sage makerAWSCOMSUM
 
Machine learning at scale with aws sage maker
Machine learning at scale with aws sage makerMachine learning at scale with aws sage maker
Machine learning at scale with aws sage makerPhilipBasford
 
[Draft] Fast Prototyping with DPDK and eBPF in Containernet
[Draft] Fast Prototyping with DPDK and eBPF in Containernet[Draft] Fast Prototyping with DPDK and eBPF in Containernet
[Draft] Fast Prototyping with DPDK and eBPF in ContainernetAndrew Wang
 
Node JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applicationsNode JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applicationsExpeed Software
 
Lightning web components
Lightning web components Lightning web components
Lightning web components Cloud Analogy
 
The features of java 11 vs. java 12
The features of  java 11 vs. java 12The features of  java 11 vs. java 12
The features of java 11 vs. java 12FarjanaAhmed3
 
JS digest. November 2017
JS digest. November 2017JS digest. November 2017
JS digest. November 2017ElifTech
 

Ähnlich wie Js engine performance (20)

Jsep
JsepJsep
Jsep
 
Chrome v8 web: the open source javascript
Chrome v8 web: the open source javascriptChrome v8 web: the open source javascript
Chrome v8 web: the open source javascript
 
Apache Big Data Europe 2016
Apache Big Data Europe 2016Apache Big Data Europe 2016
Apache Big Data Europe 2016
 
What's wrong with web
What's wrong with webWhat's wrong with web
What's wrong with web
 
Java dev mar_2021_keynote
Java dev mar_2021_keynoteJava dev mar_2021_keynote
Java dev mar_2021_keynote
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
 
Isomorphic JavaScript with Nashorn
Isomorphic JavaScript with NashornIsomorphic JavaScript with Nashorn
Isomorphic JavaScript with Nashorn
 
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
 
The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)
 
Developing Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's GuideDeveloping Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's Guide
 
EXPath Webapp - CXAN: a case-study for Servlex, an XML web framework
EXPath Webapp - CXAN: a case-study for Servlex, an XML web frameworkEXPath Webapp - CXAN: a case-study for Servlex, an XML web framework
EXPath Webapp - CXAN: a case-study for Servlex, an XML web framework
 
Phil Basford - machine learning at scale with aws sage maker
Phil Basford - machine learning at scale with aws sage makerPhil Basford - machine learning at scale with aws sage maker
Phil Basford - machine learning at scale with aws sage maker
 
Machine learning at scale with aws sage maker
Machine learning at scale with aws sage makerMachine learning at scale with aws sage maker
Machine learning at scale with aws sage maker
 
Reactjs Basics
Reactjs BasicsReactjs Basics
Reactjs Basics
 
[Draft] Fast Prototyping with DPDK and eBPF in Containernet
[Draft] Fast Prototyping with DPDK and eBPF in Containernet[Draft] Fast Prototyping with DPDK and eBPF in Containernet
[Draft] Fast Prototyping with DPDK and eBPF in Containernet
 
Node JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applicationsNode JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applications
 
Lightning web components
Lightning web components Lightning web components
Lightning web components
 
The features of java 11 vs. java 12
The features of  java 11 vs. java 12The features of  java 11 vs. java 12
The features of java 11 vs. java 12
 
JS digest. November 2017
JS digest. November 2017JS digest. November 2017
JS digest. November 2017
 
Java unit 1
Java unit 1Java unit 1
Java unit 1
 

Kürzlich hochgeladen

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Kürzlich hochgeladen (20)

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

Js engine performance

  • 1. JS Engine Performance Scutariu Paul Stirban Ionut 1
  • 2. Table of contents 1. Introduction 2. V8 engine – Google Chrome 16 3. SpiderMonkey - FireFox 9 4. Chakra – IE 9 5. Carakan – Opera 11 6. Case study – Chrome vs FireFox vs IE vs Opera 7. Bibliography 2
  • 3. Introduction ■ The performance of javascript engine is an important feature of a web browser when developing a client web application. ■ The user will obvious be more satisfied if some elements of the application are working better. In that case he may use that browser where the javascript engine is much faster ■ By far, v8 engine used by google is faster than other browsers like FireFox, IE 9 or Opera. This will be shown is the last chapter at case study ■ So, regarding these, we will talk about in this presentation about the improvements of all these engines . Also the statistics at the end of presentation will show the results of every engine 3
  • 4. V8 Engine – Google Chrome 1 ■ V8 is Google's open source JavaScript engine ■ V8 is written in C++ and is used in Google Chrome, the open source browser from Google ■ V8 can run standalone, or can be embedded into any C++ application ■ V8 increases performance by compiling JavaScript to native machine code before executing it, rather than to execute bytecode or interpreting it. Further performance increases are acheived by employing optimization techniques such as inline caching ■ With these features, JavaScript applications running within V8 are said to have an effective speed comparable to a compiled binary 4
  • 5. V8 Engine – Google Chrome 2 Improvements: 1. fast property access + hidden classes function Point(x,y){ this.x = x; this.y = y; } var p1 = new Point(1,2); var p2 = new Point(2,3); - most JavaScript engines would store p1 and p2 like they don’t belong to the same class, but in v8 p1 and p2 shares the same hidden class. 2. Dynamic machine code generation - javascript source code is compiled into machine code when first execution occurs. 5
  • 6. V8 Engine – Google Chrome 3 Improvements: 3. Garbage collector v8 engine: - stops program execution when performing a garbage collection cycle. - processes only part of the object heap in most garbage collection cycles. This minimizes the impact of stopping the application. - always knows exactly where all objects and pointers are in memory. This avoids falsely identifying objects as pointers which can result in memory leaks. http://code.google.com/apis/v8/design.html http://en.wikipedia.org/wiki/Inline_caching 6
  • 7. SpiderMonkey – FireFox 9 1 ■ SpiderMonkey: 30% faster ■ SpiderMonkey integrates type inference with Jaegermonkey JIT compiler to generate efficient code ■ SpiderMonkey is written in C++ and contains an interpreter, several JIT compilers (TraceMonkey, JägerMonkey, and IonMonkey), a decompiler, and a garbage collector. 7
  • 8. SpiderMonkey – FireFox 9 2 TraceMonkey - TraceMonkey is the first JIT compiler written for the JavaScript language - The compiler was first released as part of SpiderMonkey in Firefox 3.5, providing "performance improvements ranging between 20 and 40 times faster" than the baseline interpreter in Firefox 3 - Instead of compiling whole functions, TraceMonkey operates by recording control flow and data types during interpreter execution. This data then informs the construction of Trace Trees, highly specialized paths of native code 8
  • 9. SpiderMonkey – FireFox 9 3 JägerMonkey - JägerMonkey, internally named MethodJIT, is a whole-method JIT compiler designed to improve performance in cases where TraceMonkey cannot generate stable native code. - JägerMonkey operates very differently from other compilers in its class: while typical compilers work by constructing and optimizing a control flow graph representing the function, JägerMonkey instead operates by iterating linearly forward through SpiderMonkey bytecode, the internal function representation. Although this prohibits optimizations that require instruction reordering, JägerMonkey compilation has the advantage of being extremely fast, which is useful for JavaScript since recompilation due to changing variable types is frequent 9
  • 10. SpiderMonkey – FireFox 9 4 JägerMonkey Mozilla implemented a number of critical optimizations in JägerMonkey, most importantly Polymorphic Inline Caches and Type inference http://en.wikipedia.org/wiki/Type_inference IonMonkey IonMonkey is a compiler in the traditional sense: it translates SpiderMonkey bytecode into a control flow graph, using SSA for the intermediate representation. This architecture enables well-known optimizations from other programming languages to be used for JavaScript, including type specialization, function inlining, linear- scan register allocation, dead code elimination, and loop-invariant code motion 10
  • 11. Chakra – IE 9 1 ■ Chakra is the new JScript engine developed by Microsoft for their upcoming Internet Explorer 9 (IE9) web browser ■ A distinctive feature of the engine is that it compiles scripts on a separate CPU core, parallel to the web browser ■ Chakra improves the performance of the browser and the web pages render and respond much faster 11
  • 12. Chakra – IE 9 2 ■ Chakra, fundamentally changes the performance characteristics of JavaScript inside Internet Explorer 9. Chakra includes a new JavaScript compiler that compiles JavaScript source code into high- quality native machine code, a new interpreter for executing script on traditional web pages, and improvements to the JavaScript runtime and libraries. You can read more details on Chakra at TechNet. 12
  • 13. Carakan – Opera 11 1 ■ So how fast is Carakan? Using a regular cross-platform switch dispatch mechanism (without any generated native code) Carakan is currently about two and a half times faster at the SunSpider benchmark than the ECMAScript engine in Presto 2.2 (Opera 10 Alpha). Since Opera is ported to many different hardware architectures, this cross-platform improvement is on its own very important ■ The native code generation in Carakan is not yet ready for full- scale testing, but the few individual benchmark tests that it is already compatible with runs between 5 and 50 times faster, so it is looking promising so far 13
  • 14. Carakan – Opera 11 2 Improvements: 1. Automatic object classification - A major improvement over this engine is in the representation of ECMAScript objects. Each object is assigned a class that collects various information about the object, such as its prototype and the order and names of some or all of its properties - Class assignment is naturally very dynamic, since ECMAScript is a very dynamic language, but it is organized such that objects with the same prototype and the same set of properties are assigned the same class 14
  • 15. Carakan – Opera 11 3 Improvements: 1. Automatic object classification - This representation allows compact storage of individual objects, since most of the complicated structures representing the object's properties are stored in the class, where they are shared with all other objects with the same class. In real-world programs with many objects of the same classes, this can save significant amounts of memory. - For two objects with the same class, if the lookup of a property "X" on the first object gave the result Y, we know that the same lookup on the second object will also give the result Y. We use this to cache the result of individual property lookups in ECMAScript programs, which greatly speeds up code that contains many property reads or writes 15
  • 16. Carakan – Opera 11 4 Improvements: 2. Native code generation - Although engine's bytecode instruction set permits the implementation of a significantly faster bytecode execution engine, there is still significant overhead involved in executing simple ECMAScript code, such as loops performing integer arithmetics, in a bytecode interpreter. - In addition to generating native code from regular ECMAScript code, we also generate native code that performs the matching of simple regular expressions. This improves performance a lot when searching for matches of simple regular expressions in long strings. For sufficiently long strings, this actually makes searching for a substring using a regular expression faster than the same search using String.prototype.indexOf. For shorter strings, the speed is limited by the overhead of compiling the regular expression 16
  • 17. Carakan – Opera 11 5 Improvements: 3. Register-based bytecode - The last couple of generations of Opera's ECMAScript engine have used a stack-based bytecode instruction set. This type of instruction set is based around a stack of values, where most instructions "pop" input operands from the value stack, process them, and "push" the result back onto the value stack. Some instructions simply push values onto the value stack, and others rearrange the values on the stack. This gives compact bytecode programs and is easy to generate bytecode for 17
  • 18. Case study – Chrome vs FireFox vs IE vs Opera 1 Now we will se some performance statistics using v8 and kraken benchmarks. V8 benchmark:http://v8.googlecode.com/svn/data/benchmarks/v5/run Score 2500 2000 1500 1000 2085 1354 500 959 629 0 IE 9 Opera 11.6 FireFox 9 Chrome 16 18
  • 19. Case study – Chrome vs FireFox vs IE vs Opera 2 Now we will se some performance statistics using v8 and kraken benchmarks. V8 benchmark:http://v8.googlecode.com/svn/data/benchmarks/v5/run Browser Speed Google Chrome 16 2085 ms Opera 11.6 959 ms FireFox 9 1354 ms IE 9 629 ms The biggest score indicates the browser’s engine with the best performance 19
  • 20. Case study – Chrome vs FireFox vs IE vs Opera 3 Now we will se some performance statistics using v8 and kraken benchmarks. Kraken benchmark:http://krakenbenchmark.mozilla.org/ Time in milliseconds 60000 50000 40000 30000 55878 20000 42685 10000 13399 15315.4 0 Chrome 16 FireFox 9 Opera 11.6 IE 9 20
  • 21. Case study – Chrome vs FireFox vs IE vs Opera 4 Now we will se some performance statistics using v8 and kraken benchmarks. Kraken benchmark:http://krakenbenchmark.mozilla.org/ Browser Speed Google Chrome 16 13399.3ms +/- 1.8% FireFox 9 15315.4ms +/- 0.6% Opera 11.6 42685.0ms +/- 1.2% IE 9 55878.0ms +/- 1.8% Now time is being calculated in miliseconds and obvious the lowest is the best engine As we can see, Google’s v8 is the best engine by far, and the statistics show this. 21