Swing extremely slow on Macintosh???

It seems my game is running extremely slow on Macintosh! It’s Swing based, so I guess I am in trouble. Also, the game runs through webstart. Is there a way to increase Swing performance on Macintosh? Needs Mac OS with Java 1.5.

As far as I know, sun.java2d.noddraw only works on Windows?

That’s the game:
http://www.aevumobscurum.com/original/webstart/AevumObscurum.jnlp

If you play the demo, appearantly, the scroll speed etc is EXTREMELY slow. It works fine on my 3 years old Windows machine. Any ideas?

You can still use the ogl pipeline. VM option:

-Dsun.java2d.opengl=True

I haven’t got a Mac to test your game on sorry. The screen shots look tops!

[quote]-Dsun.java2d.opengl=True
[/quote]
That’s disabled through web start in Java 1.5. Unless I am mistaken.

No it works in 1.5, you’re thinking of the d3d option (which is windows-only anyway).

My jnlp file here turns on the OGL pipeline. (Note that the game won’t work with java 6 since it uses the com.sun package which has changed & I haven’t updated yet).

http://www.freewebs.com/commanderkeith/STGOpenGL.jnlp

Keith

Thanks! I created some .jnlp with different settings for Macintosh. Can you try if there is any improvement? Which one is the best version. Just click on the [Demo] button and check how fast the map scrolling is:

http://www.aevumobscurum.com/original/webstart/AevumObscurum-MAC1.jnlp
http://www.aevumobscurum.com/original/webstart/AevumObscurum-MAC2.jnlp
http://www.aevumobscurum.com/original/webstart/AevumObscurum-MAC3.jnlp
http://www.aevumobscurum.com/original/webstart/AevumObscurum-MAC4.jnlp

Which is the best combination?

Too bad java 1.5 is needed : you’re cutting the game away from at least half the mac base.

I would have tested the options here, but unfortunately, I’m part of the other half of mac users (pre - OS X tiger).

I’ll try again later on my other mac (which has java 1.5)

Lilian :slight_smile:

Note that the noddraw option doesn’t apply to macs, its a windows thing. The open GL option is the only relevant one to macs I believe.

In my open GL webstart jnlp I do this:

[b] [/b]

I specify the OGL option in both places since I’m not sure where it should be :P. Maybe someone could clarify?

Thanks,
Keith

@CommanderKeith: I wasn’t sure about the sun.java2d.noddraw option. The 4 .jnlp files are all the combinations of the sun.java2d.noddraw and sun.java2d.opengl as you suggested earlier!

Any difference?

2,1,4,3

Is the order of what scrolled the fastest.

I am running a 1.8ghz single processor G5 with 2.5gb of RAM. I can test this on my machine at work also if you like – it’s a brand spanking new quad processor intel Mac, although the exact specs elude me right now (needless to say it is very fast). On my home computer it was pretty herky jerky but still looked totally playable. I can’t judge that well though because I’ve never seen the game in action and have no clue how to play.

I’ve had some interested GUI issues transferring between Mac and PC as well, some really random stuff. It just shows that Java is not that cross platform.

Yes, not exactly sure how well the game does on Macintosh? Anyhow, can you also test that one:

http://www.aevumobscurum.com/original/webstart/AevumObscurum-MAC7.jnlp

Is this faster than #2?

I just tested it on my work computer


Machine Name:	Mac Pro
  Machine Model:	MacPro1,1
  Processor Name:	Dual-Core Intel Xeon
  Processor Speed:	2.66 GHz
  Number Of Processors:	2
  Total Number Of Cores:	4
  L2 Cache (per processor):	4 MB
  Memory:	4 GB
  Bus Speed:	1.33 GHz

And it scrolled incredibly quickly, with no noticeable speed issue. I’ll try this new jnlp at home and see if it’s this particular file or the computer that changed things. In any case, the last jnlp works great on a this-gen Mac.

wow, all that’s different is the amount of memory required: It’s 512MB for that particular file. Seems increasing the memory requirements solves the problem!?

Yeah, that version runs considerably faster on my home computer as well. I’ve needed to manually increase heap size to get some particularly processor-intensive programs to run before – these results aren’t that surprising.

Increasing memory is fine, but then you’ve got to remember not everyone has enough to go that high. Maybe if you include the option of downloading different versions for different memory levels, you could accomodate everyone.

The OpenGL pipeline is not available on the Mac with Java 5. So sun.java2d.opengl won’t help.
The biggest factor is the image format… make sure you are blitting images that are compatible with the display, there are only one or two image formats that have good performance on the Mac. I think 32-bit with pre-multiplied alpha is the “native” format for the Mac.

Wait… there is no more OpenGL for Mac? Why not? I hadn’t heard this, I thought Vista was the only thing giving OpenGL the bone. Dang it.

No, swpalmer means theres no gl pipeline in the JRE for Mac is all. IIRC the whole OS uses opengl to run it’s gui on, so I guess there’d be no point of the JRE reimplementing it as well.

Ah, okay, that makes sense. I can still use LWJGL then. :slight_smile: