3 ms·
This post and its parent make a lot of bad assumptions. For one, performance is not the same thing as real-time nor is performance the same thing as fast. Rea
by oso2k 13y ago
This post and its parent make a lot of bad assumptions. For one, performance is not the same thing as real-time nor is performance the same thing as fast.
Real-time means that a given system has verifiable (and often guaranteed) run time qualities. Time being the keyword. Saying "System X's slowest operation completes in 500ms" is a definition of a real-time system.
Performance is a system's ability to complete a certain task in a certain amount of time. "System X can toggle an I/O pin in 10ms."
A good analogy is the comparison of a high-end sports car (Porsche 911) and a Big Rig. Unloaded, the sports car can travel 140MPH (fast!), while the Big Rig can travel 75MPH. Fully loaded, the Porsche can carry 800 lbs and travel at 90MPH, while the Big Rig can carry 12,000 lbs and travel at 75MPH. If you system's goal is to move 12,000 lbs of cargo 75 miles, the Big Rig would have higher performance and better real-time qualities (more cargo transferred per hour and a consistent time of 1 hours) while the Porsche would have poorer performance and real-time qualities.
Secondly, asm.js is not compiled to native code ahead-of-time (yet). No compiler (that I'm aware of) generates native for a JavaScript input. SpiderMonkey previously supported XDR[1], Rhino supports compiling to Java class files for most JS[2], and Google V8 supports compiling to "snapshots"[3] (a sort of pre-parsed, semi-compiled form, with the heap linked into the data structure).
Thirdly, Espruino is written by Gordon Williams and based on the things he learned while developing Tiny-JS[4].
[1] http://en.wikipedia.org/wiki/External_Data_Representation http://en.wikipedia.org/wiki/External_Data_Representation
[2]http://en.wikipedia.org/wiki/Rhino_%28JavaScript_engine%29 http://en.wikipedia.org/wiki/Rhino_%28JavaScript_engine%29
[3]https://developers.google.com/v8/embed#contexts https://developers.google.com/v8/embed#contexts
[4]This post and its parent make a lot of bad assumptions. For one, performance is not the same thing as real-time nor is performance the same thing as fast.
Real-time means that a given system has verifiable (and often guaranteed) run time qualities. Time being the keyword. Saying "System X's slowest operation completes in 500ms" is a definition of a real-time system.
Performance is a system's ability to complete a certain task in a certain amount of time. "System X can toggle an I/O pin in 10ms."
A good analogy is the comparison of a high-end sports car (Porsche 911) and a Big Rig. Unloaded, the sports car can travel 140MPH (fast!), while the Big Rig can travel 75MPH. Fully loaded, the Porsche can carry 800 lbs and travel at 90MPH, while the Big Rig can carry 12,000 lbs and travel at 75MPH. If you system's goal is to move 12,000 lbs of cargo 75 miles, the Big Rig would have higher performance and better real-time qualities (more cargo transferred per hour and a consistent time of 1 hours) while the Porsche would have poorer performance and real-time qualities.
Secondly, asm.js is not compiled to native code ahead-of-time (yet). No compiler (that I'm aware of) generates native code for a JavaScript input. SpiderMonkey previously supported XDR[1], Rhino supports compiling to Java class files for most JS[2], and Google V8 supports compiling to "snapshots"[3] (a sort of pre-parsed, semi-compiled form, with the heap linked into the data structure).
Thirdly, Espruino is written by Gordon Williams and based on the things he learned while developing Tiny-JS[4].
[1] http://en.wikipedia.org/wiki/External_Data_Representation http://en.wikipedia.org/wiki/External_Data_Representation
[2]http://en.wikipedia.org/wiki/Rhino_%28JavaScript_engine%29 http://en.wikipedia.org/wiki/Rhino_%28JavaScript_engine%29
[3]https://developers.google.com/v8/embed#contexts https://developers.google.com/v8/embed#contexts
[4]https://code.google.com/p/tiny-js/ https://code.google.com/p/tiny-js/
- exDM69 13y ago> This post and its parent make a lot of bad assumptions. For one, performance is not the same thing as real-time nor is performance the same thing as fast. Yes, this is exactly why I mentioned real time and questioned the suitability of garbage collection for this use. Overall performance is a secondary issue, many use cases can work with slightly lower perf but in microcontrollers you want predicatable performance.