thoughtpolice

Reviews Favorites News Main
thoughtpolice

Age/Gender: 19, Male
Location: concave boxes
Job: chivalrous knight

i am the planetary destroyer. go away.

Newgrounds Stats

Sign-Up Date:
3/24/03

Level: 10
Aura: Dark

Rank: Town Watch
Blams: 69
Saves: 56
Rank #: 52,440

Whistle Status: Normal

Exp. Points: 945 / 1,110
Exp. Rank #: 39,174
Voting Pow.: 5.19 votes

BBS Posts: 3,100 (1.25 per day)
Flash Reviews: 36
Music Reviews: 0
Trophies: 0
Stickers: 0

Entry #12

Newer Older

Jump to Entry: [ 13 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 ]


thoughtpolice

Java Phasers and a Virtual Machine

Posted by thoughtpolice Jul. 14, 2008 @ 4:19 PM EDT

For all the Java people out there, you might be surprised to know you're going to get Phasers in the future. Get ready for battle. Unfortunately, Proton Torpedo's didn't make the cut. Sorry.

On a side note, I've been working on a little virtual machine. So far, it is incomplete although there is only 1 part left to do before I probably make a 0.1 release, it works.

Documentation on the overall structure of the virtual machine and some benchmarks are here:
http://thoughtpolice.stringsandints.co m/misc/vm_notes.html

From the benchmarks, you can see it runs FizzBuzz 10,000,000 times in about 12 seconds when compiled with gcc -O3 -fomit-frame-pointer and when there's no output buffering to cause an I/O bottleneck. If compiled with output enabled, there are almost no speed improvements regardless of compiler flags since printf takes most of the time.

The resulting code of the VM when using gcc -O3 is quite desirable and efficient since it (largely) eliminates branch misprediction using direct jumps to register values, while instead there are just a lot of 'jne/je' instructions if compiled with say, -O0 or -O1.

I'm probably going to code up a C version of fizzbuzz without output as well to see how it compares to native C. I expect to be dominated.
Addendum: I wrote an C program equivalent to my example bytecode program - or as close as I could get it. Excellent results: With gcc -O3 -fomit-frame-pointer it can do 10,000,000 iterations in approximately a half a second. Major smackdown, right there.

I'll probably be blogging on my other blog about this in the future, in case you want to keep track of it.

Updated: 07/14/08 9:10 PM Log in to comment! | Share this!

The People Have Spoken

6 Comments

Jul. 25, 2008 | 5:09 PM Evil-Dog7 says:

First post do I win? I can't read that much I'm too lazy.


Sep. 10, 2008 | 8:25 PM coolerythanyou says:

Heres a cool fact about pokemon,Pidgeotto also known as the Bird Pokémon, is a bird-like Pokémon, is a larger and stronger form that Pidgey takes when it gains enough experience. A Pidgeotto is extremely territorial, generally claiming a large area with its nest built in the center. Full of vitality, it constantly patrols its territory, mercilessly attacking intruders. They fly about in circularpatterns while hunting, and can spot the movements of their prey on the ground no matter how high they fly.The Pidgeotto attacks with its wickedly sharp talons and carries its prey, including Exeggcute and Magikarp, back to its nest from as far as 60 miles away - or more.


Sep. 22, 2008 | 12:59 PM cast says:

I'm sorry.


Oct. 7, 2008 | 9:08 PM kisame says:

Big Brother is Watching you!


Mar. 20, 2009 | 6:01 AM Pasty-Flawss says:

Hi,

I have no idea what you just said...

I'll be going now...


Jul. 1, 2009 | 10:50 AM VinnyXY says:

+1 comment

Newer Older

Jump to Entry: [ 13 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 ]