Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
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 1906 times)
0 Members and 1 Guest are viewing this topic.
Offline crystalsquid

Junior Devvie

... Boing ...

« Posted 2004-07-16 16: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

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


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 Devvie

Giving Java a second chance after ludumdare fiasco

« Reply #2 - Posted 2004-07-16 23: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


« Reply #3 - Posted 2004-07-16 23: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  

DesertCoockie (20 views)
2018-05-13 18:23:11

nelsongames (68 views)
2018-04-24 18:15:36

nelsongames (65 views)
2018-04-24 18:14:32

ivj94 (748 views)
2018-03-24 14:47:39

ivj94 (79 views)
2018-03-24 14:46:31

ivj94 (579 views)
2018-03-24 14:43:53

Solater (94 views)
2018-03-17 05:04:08

nelsongames (168 views)
2018-03-05 17:56:34

Gornova (362 views)
2018-03-02 22:15:33

buddyBro (1022 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!