Loading...
Please wait, while we are loading the content...
Similar Documents
An efficient approach for accessing C data structures from JavaScript
| Content Provider | ACM Digital Library |
|---|---|
| Author | Wöß, Andreas Würthinger, Thomas Mössenböck, Hanspeter Grimmer, Matthias |
| Abstract | We present a novel approach for allowing JavaScript applications to access C data structures without performance overhead or additional boiler plate code. Dynamic languages such as JavaScript do not have a fixed memory layout for run-time data nor do they allow low-level memory accesses, which makes interoperability with languages such as C hard. Our approach allows JavaScript applications to transparently use C pointers as receivers of object accesses or array accesses, thus the programmer can access C data structures as if they were JavaScript objects. We describe how we modified an existing JavaScript interpreter so that it generates different access operations at run time depending on whether the receiver is a JavaScript object or a C pointer. We evaluated our prototype using benchmarks that measure array access performance. The evaluation of our JavaScript interpreter shows that using C arrays from within JavaScript is on average 27% faster than using regular JavaScript arrays and 19% faster than using Typed Arrays. |
| Starting Page | 1 |
| Ending Page | 4 |
| Page Count | 4 |
| File Format | |
| ISBN | 9781450329149 |
| DOI | 10.1145/2633301.2633302 |
| Language | English |
| Publisher | Association for Computing Machinery (ACM) |
| Publisher Date | 2014-07-28 |
| Publisher Place | New York |
| Access Restriction | Subscribed |
| Subject Keyword | Language interoperability Typed arrays C Language implementation Virtual machine Javascript Optimization |
| Content Type | Text |
| Resource Type | Article |