Nodejs is using Google V8 javascript engine which runs inside the Chrome web browser too.
V8 code optimisation can lead to astonishing good results compared with C/C++ program, at least on a x86/x64 processor.
But …
Here comes Octane 2, a benchmark to score the performance of a javascript engine running inside a browser designed by Google.
You can run the benchmark inside your browser by following this link and pressing the START button.
Here are the results with Chrome and Firefox on my desktop:
Computer | environment | Score | Javascript Engine |
---|---|---|---|
Core I7 desktop | Chrome (36.0.1985.143) | 26008 | V8 v3.26(*) |
Core I7 desktop | Firefox 31 | 15800 | SpiderMonkey 31 |
VM Ubuntu 14.04(*) | Chromium (36.0.1985.125) | 8178 | V8 3.26 |
VM Ubuntu 14.04(*) | Firefox 31 | 5041 | SpiderMonkey 31 |
(*) Ubuntu 14.04 running inside a VirtualBox machine on my Core I7 desktop.
However, I needed the same benchmark but running on nodejs , without a GUI. Fortunately, octane benches are pure javascript algorithms and can be easily ported to node. Daishi Kato has published benchmark-octane a NPM module on github that serves as a very good starting point.
With a few tweaks I created a forked version of benchmark-octane that suites my need.
This version produces the same output as the browser version making results more comparable.
This is the result of running benchmark-octane on various version of node:
Computer | environment | Score | time |
---|---|---|---|
Core I7 desktop | nodejs 0.10.24 | 15800 | 50s |
Raspberry | nodejs 0.10.24 | 138 | 2351 s |
VM Ubuntu 14.04 | nodejs 0.08.21 | 5600 | 74s |
VM Ubuntu 14.04 | nodejs 0.10.10 | 6550 | 62s |
VM Ubuntu 14.04 | nodejs 0.10.24 | 6472 | 62s |
VM Ubuntu 14.04 | nodejs 0.10.31 | (crashed in Mandreel) | |
VM Ubuntu 14.04 | nodejs 0.11.13 | 8050 | 50s |
1 2 |
|
To display the V8 version, you can simple execute the following command:
$ node -e "console.log(process.versions['node'],process.versions['v8'])"
date | nodejs | V8 version |
---|---|---|
2014.08.19 | 0.10.31 | 3.14.5.9 |
2013.05.24 | 0.10.8 | 3.14.5.9 |
13.03.11 | 0.10.0 | 3.14.5 |
2013.03.01 | 0.9.11 | downgraded to v3.14.5 |
2013.02.19 | 0.9.10 | 3.15.11.15 |
2013.01.24 | 0.9.8 | 3.15.11.10 |
2013.01.18 | 0.9.7 | 3.15.11.7 |
2013.01.11 | 0.9.6 | 3.15.11.5 |
2012.10.24 | 0.9.3 | 3.13.7.4 |
2012.10.25 | 0.8.13 | 3.11.10.25 |
2012.09.11 | 0.8.9 | 3.11.10.22 |
2012.08.22 | 0.8.8 | 3.11.10.19 |
2012.07.25 | 0.8.4 | 3.11.10.17 |
2012.07.19 | 0.8.3 | 3.11.10.15 |
2012.06.29 | 0.8.1 | 3.11.10.12 |
2012.06.25 | 0.8.0 | 3.11.10.10 |
2012.05.28 | 0.7.9 | 3.11.1 |
2012.01.23 | 0.7.1 | 3.8.8 |
2012.01.07 | 0.7 | 3.8.6 |
2012.04.30 | 0.6.16 | 3.6.6.25 |
2012.03.02 | 0.6.12 | 3.6.6.24 |
Finding the V8 engine of the current unstable release (V0.11) requires that you investigate the specific changelog file. For instance, looking at http://nodejs.org/dist/v0.11.13/docs/changelog.html
date | nodejs | V8 version |
---|---|---|
2014.05.01 | 0.11.13 | 3.24.35.22 |
2014.01.09 | 0.11.11 | 3.22.24.19 |
2013.12.31 | 0.11.10 | 3.22.24.10 |
2013.08.21 | 0.11.7 | 3.20.17 |
2013.08.21 | 0.11.6 | 3.20.14.1 |
2013.08.06 | 0.11.5 | 3.20.11 |
2013.07.12 | 0.11.4 | 3.20.2 |
2013.06.26 | 0.11.3 | 3.19.13 |
2013.05.13 | 0.11.2 | 3.19.0 |
2013.04.19 | 0.11.1 | 3.18.0 |
2013.04.19 | 0.11.0 | 3.17.13 |
if you want to find the V8 engine of the version of chrome you are currently running
If don't have a instance of Chrome running with the version you want to investigate:
navigate to http://src.chromium.org/viewvc/chrome/releases/[VERSION]/DEPS
( replace [VERSION] with the actual string you found at step 1).
In our example, this will be
http://src.chromium.org/viewvc/chrome/releases/36.0.1985.143/DEPS.
This file, maintained by the Chrome development team contains the description of all the dependencies and components used by Chrome, their location and their version number.
Inside this file, search for the line containing Var("v8")
.
It will look like:
1
|
|
Here is V8 version for the various Chrome I am using :
Chromium Version | V8 version |
---|---|
36.0.1985.143 Windows | v3.26@22818 |
36.0.1985.125 Ubuntu 14.04 (283153) | v3.26@21981 |
36.0.1985.57 IPhone | v3.26@21367 |
This is explained in greater details in this post
]]>After installing a appropriated plugin, I was able to insert youtube video frame using a Liquid sequence
{% youtube VIDEO_ID %}
Internaly the youtube tag triggers a little Liquid script that turns the video ID into the <iframe> html element as required by the Youtube API.
<iframe width="560" height="315"
src="http://www.youtube.com/embed/q_NvDTZIaS4"
frameborder="0" allowfullscreen ></iframe>
and produces :
One of my first post included a lot of embedded youtube video and it was very convenient.
However, with many videos includes the page takes a very long time to load, and the browser even freezes while the <iframe> s were beeing installed. (not suprisingly many article, such as this one recommand to use iframe sparingly for this very reason)
Searching a little bit deeper, I stumbled across an article from yabtb explaining how overcome this problem, using a technique called lazy loading.
In essence, lazy loading consist of replacing the <iframe> with a static image (using the <img> tag) and a little bit of javascript to replace the <img> tag with the proper <iframe> tag at runtime when the reader clicks on the image.
I then decided to improve the youtube Liquid plugin to use this technique and publish the new plugin <[code on github : https://github.com/erossignon/jekyll-youtube-lazyloading
you can see the result of here :
Old printers can be refurbished into wireless printers using a Raspeberry PI. This makes it a very cheap solution.
Stuart Johnson has created a GPS Tracker, combining a Raspberry PI with a GlobalSat BR-305 GPS Receiver which has a RS232 connection and a program written in Mono C#.
Cooking Hack provides a tutorial to build a Radiation Sensor
A more advance project incorporates a GPS Tracker and Zigbee wireless less system.
MONIRUL PATHAN explains how he has built a home thermostat using 3 simple steps.
How to turn your Raspberry Pi into an XBMC Media Center
This article explains how to turn a Raspberry PI into a File Server
LinuxToday article explains how to Build a file server with the Raspberry Pi in 20 steps.
As seen in Geek.com, an Homebrew enthusiast modifies Raspberry Pi to control beer fermentation In TechRepublic: Raspberry Pi and Beer: A match made in heaven
retro Back in 1988, I was the happy owner of the faster personal computer at the time : an Acorn Archimedes , running RiscOS. In fact the ARM 11 processor, which is the core of the Raspberry PI has a long history. The Acorn Archimedes was the first computer equiped with a ARM based CPU. The instructions to install this 25 year old mythic Operating system on the RPI can be found here : RISCOC for Raspberry Computer.
yes ! a coffee machine
Raspberry pi to 3D print with webinterface in node.js
Connecting 2 temperature sensors, light sensor and a barometric pressure sensor on a Raspberry to build a weather station. on RasPi.tv
Why not use the "Solar Battery Cells" propepsed by cottonpickers to make this weather station autonomous ?
Launch of Raspberry Pi Into Near Space by weather balloon
PIE1 - Raspberry Pi Sends Live Images from Near Space
A Southampton university team and a 6 year old Lego specialist has built a HPC computer composed with a cluster of 64 Raspberry PI
Building a High Performance Computer ourself with a aim to inspire the next generation of scientist and engineers.
Supercomputer get built using Raspberry Pi and Lego
see also:
]]>