Open ricardojlrufino opened 4 years ago
Enviroment: Ubuntu 18.04, Intel i7-4500, 16GB ram
Program running... Time: Blink finished in 0 ms Time: Blink finished in 699 ms Time: Blink finished in 613 ms Time: Blink finished in 646 ms Time: Blink finished in 620 ms Time: Blink finished in 611 ms Time: Blink finished in 604 ms Time: Blink finished in 604 ms Time: Blink finished in 631 ms Time: Blink finished in 622 ms Time: Blink finished in 604 ms
node run.js
Time: Blink finished in 1 ms Time: Blink finished in 162 ms Time: Blink finished in 113 ms Time: Blink finished in 114 ms Time: Blink finished in 118 ms Time: Blink finished in 112 ms Time: Blink finished in 111 ms Time: Blink finished in 132 ms Time: Blink finished in 110 ms Time: Blink finished in 114 ms Time: Blink finished in 116 ms Time: Blink finished in 112 ms Time: Blink finished in 112 ms
/opt/graalvm-ce-java8-20.1.0/bin/node run.js
Program running... Time: Blink finished in 1 ms Time: Blink finished in 2353 ms Time: Blink finished in 2190 ms Time: Blink finished in 783 ms Time: Blink finished in 767 ms Time: Blink finished in 802 ms Time: Blink finished in 848 ms Time: Blink finished in 803 ms Time: Blink finished in 759 ms Time: Blink finished in 825 ms Time: Blink finished in 755 ms Time: Blink finished in 804 ms Time: Blink finished in 788 ms Time: Blink finished in 778 ms
bundle.js:2522 Fetch finished loading: GET "http://localhost:3000/blink.hex". bundle.js:2560 Program running... bundle.js:2605 Time: Blink finished in 0 ms bundle.js:2605 Time: Blink finished in 244 ms bundle.js:2605 Time: Blink finished in 183 ms bundle.js:2605 Time: Blink finished in 224 ms bundle.js:2605 Time: Blink finished in 170 ms bundle.js:2605 Time: Blink finished in 168 ms bundle.js:2605 Time: Blink finished in 166 ms bundle.js:2605 Time: Blink finished in 172 ms bundle.js:2605 Time: Blink finished in 167 ms bundle.js:2605 Time: Blink finished in 192 ms bundle.js:2605 Time: Blink finished in 164 ms bundle.js:2605 Time: Blink finished in 170 ms bundle.js:2605 Time: Blink finished in 167 ms bundle.js:2605 Time: Blink finished in 166 ms bundle.js:2605 Time: Blink finished in 177 ms bundle.js:2605 Time: Blink finished in 166 ms bundle.js:2605 Time: Blink finished in 165 ms bundle.js:2605 Time: Blink finished in 169 ms bundle.js:2605 Time: Blink finished in 164 ms bundle.js:2605 Time: Blink finished in 165 ms bundle.js:2605 Time: Blink finished in 179 ms bundle.js:2605 Time: Blink finished in 175 ms bundle.js:2605 Time: Blink finished in 164 ms bundle.js:2605 Time: Blink finished in 178 ms
package javascript.j2v8;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import com.eclipsesource.v8.NodeJS;
import com.eclipsesource.v8.V8;
public class J2V8 {
public static void main(String[] args) throws IOException {
Path path = Paths.get("/media/ricardo/Dados/TEMP/testes-java/avr8js_demo_vanilla/run-v8.js");
NodeJS node = NodeJS.createNodeJS();
node.exec(path.toFile());
while (node.isRunning()) {
node.handleMessage();
}
}
}
PS: J2V8 need remove async / await .. only..
Hi doing some experiments running a emulator (AVR8js) in javascript interpreters, I found some substantial differences in performance, mainly in reporting the performance of the browser (chrome), running natively in nodejs the difference is even greater...
I'll share the results here, more information is here: https://github.com/wokwi/avr8js/issues/49#issuecomment-640276220
simple benckmark https://github.com/ricardojlrufino/avr8js_demo_node/tree/vanilla