” *(some-str)”
Wouldn’t “+(some-str)” be better for 1..n occurrences?
(apologies if this triple-posts … connection trouble)
105363 items (97572 unread) in 19 feeds
Friends
(1021 unread)
Build
(68091 unread)
Heads
(716 unread)
News
(27537 unread)
fun
(207 unread)
” *(some-str)”
Wouldn’t “+(some-str)” be better for 1..n occurrences?
(apologies if this triple-posts … connection trouble)
Interesting. David Ryan’s Argot project uses a JITer, and his explanation of using a JITer is not simply the reasons you give here, although they are bonus points for the Argot MCG (Micro Code Generator) which outputs C code.
The main idea behind Argot was resource consumption on embedded systems and to allow bootstrapping systems from nothing, like the kind the 6lowpan (IPv6 over Low power Wireless Personal Area Networks) working group were concerned with. David was a member of that committee, although somebody else’s ideas ultimately won out.
Something for you to blog about in the future, I guess!
Will, that’s an interesting question but I doubt that Hotspot could generate code that is as good as mine. Not because I think I’m better at this than the Hotspot authors, but because I am compiling directly from a description of the .proto file into machine code. In the Hotspot case, the flow is more like:
.proto file -> Java -> JVM byte-code -> machine code
The fact that you have to go through Java and JVM byte-code first means that you are limited by what can be expressed in Java. For example, Java doesn’t even have unsigned types!
In fact I think the JIT part is a bit of a distraction, because upb isn’t actually using any run-time information that isn’t available as part of the .proto file to begin with. So even the C++ protobuf compiler (which works ahead-of-time) has just as much information as upb’s JIT does. I’m JITting for convenience, not because I’m using any runtime information (well, at least not yet
.
If JITting helps so much, how does the java implementation of protobufs compares when run under Hotspot? I’m guessing much slower, but I wonder if that has to be the case.