plasma-umass / doppio

Breaks the browser language barrier (includes a plugin-free JVM).
http://plasma-umass.github.io/doppio-demo
MIT License
2.16k stars 175 forks source link

Faster operand stack #424

Closed hrj closed 8 years ago

hrj commented 8 years ago

I tested with two benchmarks. Compute just computes some fibonacci numbers over and over, and the second one compiles a .java file using javax.tools

Compute

Browser Before After Improvement
Firefox 43 2075ms 1105ms 46%
Chromium 47 1049ms 774ms 26%

Compile

Browser Before After Improvement
Firefox 43 40215ms 30798ms 23%
Chromium 47 26811ms 25197ms 6%
jvilk commented 8 years ago

:clap: Awesome! The code looks great, too.

You can actually figure out how much stack space Java methods require. The Code attribute has the properties maxStack and maxLocals that indicate the needed stack/locals size.

Would you be willing to hook up maxStack and repeat your experiments?

If not, I can merge this as-is.

hrj commented 8 years ago

Thanks! I have used maxStack and pushed the commit. I don't see any noticeable difference in benchmarks though.

Why did you mention maxLocals? I am not very familiar with this stuff hence not sure if I can use it in this PR.

jvilk commented 8 years ago

Typical jvilk over-explaining. My brain is a bit fried from writing up student assignments. It's not relevant.

It's likely that the maxStack change only changes memory consumption a bit, since most JVM methods have a very short operand stack.

Thanks again for this! I'll merge it in.