Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Crazy 1.1 VM !! - How I solved my problem :)  (Read 1143 times)
0 Members and 1 Guest are viewing this topic.
Offline crystalsquid

Junior Member




... Boing ...


« Posted 2004-07-16 18:45:54 »

Ok, nuff said about using 1.1, but I had a _serious_ issue with the speed, and I finally solved it. For anyone else dealing with this, this may be useful to know (& it backs up some old posts I was reading from Jeff & other oldtimers):

My 3D software renderer was going well - wonderfully fast in 1.4, and then I tried it in 1.1. Eeek - It ran about 10 times slower!

So I busted out the VC debugger, and ran Explorer through it, paused the debugger and guess what I found...

The code was looking reading a either 1, 2, or 3 bytes via a byte pointer, then branching off on a DWORD pointer. For those that don't know - this causes a 'PPro stall' which is very nasty. I had my suspicions, and lo & behold the bytes it was referencing was my bytecode. The JIT had decided not to bother compiling my renderer!

After trying (unsuccesfully) to change a few things, I came across a post saying 'inlining could actually lose you performance'. Well I wasn't inlining, but my function was quite large at 900+ bytecodes - thanks javap  Wink

So I took a small section of the loop, and put it into a little function (de-inlining, even though the code wasn't inlined in the first place!)

Lo & behold - its running nice and fast again (200k+ textured tris a sec) - the JIT is doing its job again!

Moral of the story: Er, Im not sure, but big functions (i.e. self inlining) can definately screw up the MS 1.1 JIT.

Kudos to Sun, the 1.4 took it in its stride, so this probably doesn't apply to most of you Smiley
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #1 - Posted 2004-07-16 19:32:29 »

Quote

Moral of the story: Er, Im not sure, but big functions (i.e. self inlining) can definately screw up the MS 1.1 JIT.


Howabout: if any of us who used to use 1.1 intensively could still remember our tricks and tactics we could probalby make a tidy sum writing a book "Fast and efficient: how to make java 1.1 fly".

But, sadly, we've all worked so hard to eradicate those concepts from our minds, to stop ourselves from sub-consciously polluting our current code, that we probably can't remember any of them Wink.

Or howabout: "MS doesn't just make crappy out-dated platforms; they also drag modern platforms down to their level (crappy and out-dated) even in the modern world" Grin. Sad, but true...

malloc will be first against the wall when the revolution comes...
Offline nonnus29

Senior Member




Giving Java a second chance after ludumdare fiasco


« Reply #2 - Posted 2004-07-17 01:09:41 »

Thats some good detective work.  Unlike some people around here (ahem) I think getting code to run on that pile-o-crap vm can be alot of fun (ie challenge); unfortunately, I wasn't doing software rendering back in the 'old days' and I'd like to get my software renderer running fast on 1.1 someday....
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #3 - Posted 2004-07-17 01:26:58 »

A long time ago I had the same problem, but on the Sun 1.4 JRE. The code ran fast on the MSVM but dog slow on the Sun VM. I 'de-inlined' a really large function because it turned out to be interpreted instead of jitted. Afterwards it was fast again but still a bit slower than on the MSVM.
My problem with the MSVM is mainly that it's very much outdated, and that it seemed to have helped to prevent widespread use of up to date VMs. Other than that it's actually a quite fast, 'lean and mean' VM in my experience.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (15 views)
2014-07-30 21:08:39

Riven (21 views)
2014-07-29 18:09:19

Riven (14 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (32 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (42 views)
2014-07-24 01:59:36

Riven (42 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!