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  
  Escape Analysis  (Read 4197 times)
0 Members and 1 Guest are viewing this topic.
Offline Mark Thornton

Senior Member





« Posted 2005-03-15 19:59:50 »

http://forums.java.net/jive/thread.jspa?threadID=480&tstart=0

It seems there are plans to add this for JDK 6.0.
So Cas, place your bets on whether it will actually happen!

:-)
Offline K.I.L.E.R

Senior Member




Java games rock!


« Reply #1 - Posted 2005-03-16 04:33:41 »

I'm am definitely drooling.
Did my blog have an effect on this decision? Cheesy

Vorax:
Is there a name for a "redneck" programmer?

Jeff:
Unemployed. Wink
Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #2 - Posted 2005-03-16 09:03:58 »

Aha, that'd be nice. One less performance gotcha to worry about.

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Linuxhippy

Senior Member


Medals: 1


Java games rock!


« Reply #3 - Posted 2005-03-21 20:11:16 »

Would be really great to see some progress in this topic!
Offline phazer

Junior Member




Come get some


« Reply #4 - Posted 2005-03-22 06:45:42 »

There is some (very little) info about this in the HotSpot team chat transcript:

"Spiff: The memory overhead for small Java objects can be a killer for some applications. For example, a Triangle object which holds 3 Point3f's. Since HotSpot has an 8-byte per-object overhead plus 8-byte alignment, each of those Point3f's occupy 24 bytes, where they would occupy 12 bytes with C/C++. Are there any plans to perhaps inline (memory-wise) small objects, say if you can guarantee that you'll only refer to them through their containing parent object?

Ross Knippel: On the compiler side, we're planning on doing escape analysis, which may allow these objects to be scalarized and therefore never created. There are no current plans to inline one object into another. "

The full transcript is available at http://java.sun.com/developer/community/chat/JavaLive/2005/jl0315.html.

Btw, Spiff == princec ?  Grin

Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #5 - Posted 2005-03-22 08:12:24 »

Nah, I'm always princec.

Cas Smiley

Offline Spiff

Senior Newbie




Java games rock!


« Reply #6 - Posted 2005-03-22 13:34:17 »

Spiff == Spiff.

I've been bitten by small-object overheads. There are workarounds (such as creating a float array for all vertices and having multiple triangles index into that array) but it would still be nicer to be able to have small objects w/out the overhead.
Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #7 - Posted 2005-03-22 13:53:34 »

You appear to have gotten a little confused about what you actually want in that post... object overhead is insignificant in terms of memory efficiency in the situations where escape analysis is useful. EA is used to prevent taxing the garbage collector unnecessarily. What you want is Structs!

Cas Smiley

Offline Raghar

Junior Member




Ue ni taete 'ru hitomi ni kono mi wa dou utsuru


« Reply #8 - Posted 2005-03-22 18:38:56 »

Why so ugly word as struct? Formated array in nicer.

" where they would occupy 12 bytes with C/C++. "
Actually they don't. You should add a pointer to an array so it would be 16 to 20 bytes.

From my knowledge about graphic programming I know the preffered way is a batch processing, so you'd have float array/s anyway. I however forgot what's better for CPU/GFX pipeline. Three float arrays, or one (or multiple) layered arrays.

Yes, I have also discovered a small object overhead aka 1000 times nothing killed donkey. It hurted a little my binary model for compression, but I think the solution is actually more L2 cache efficient, so it's not as harsh problem.
Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #9 - Posted 2005-03-22 19:08:20 »

I wish I'd called them "Mapped Objects" now.

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Raghar

Junior Member




Ue ni taete 'ru hitomi ni kono mi wa dou utsuru


« Reply #10 - Posted 2005-03-22 20:08:42 »

Yes it would be better idea. Less problem with programmers that are used to an exact C meaning of the word struct.
Offline Deadcow

Senior Newbie




Back from beyond ... Moo!


« Reply #11 - Posted 2005-03-23 07:13:02 »

Hi there,

princec, there is maybe a way to implement this functionality without any addition to the java language :

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
package java.nio;

public abstract class ObjectBuffer extends Buffer {

  public ObjectBuffer( int capacity ) { ... }
  public ObjectBuffer( ByteBuffer buffer ) { ... }

  public ObjectBuffer duplicate();
  public ObjectBuffer slice();
  // ... name it

}


package org.lwjgl....;

@Pack(4)
public VertexBuffer extends ObjectBuffer {

  public VertexBuffer( int capacity ) { ... }
  public VertexBuffer( ByteBuffer buffer ) { ... }

  public @Mapped float x;
  public @Mapped float y;
  public @Mapped float z;
  public @Mapped float nx;
  // ...

  // error, only primitive types can be mapped.
 public @Mapped Object o;


}


the @Mapped fields' values depend on the current ObjectBuffer position.
Does it suits your needs ?
Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #12 - Posted 2005-03-23 08:09:22 »

I was coming to the conclusion that the Java language no longer needs to be modified thanks to annotations. With annotations the JVM could do some clever internal compilation to remove all the unnecessary bounds checking and read/write fields directly from a DirectByteBuffer.

Cas Smiley

Offline K.I.L.E.R

Senior Member




Java games rock!


« Reply #13 - Posted 2005-03-23 09:03:23 »

Can you expand on this a little?
I'm interested in what I think you mean.
The only problem is that I don't know if what you mean is the same thing as what I think you mean.

Can you use annotations to create arrays without bounds checking currently?

Quote
I was coming to the conclusion that the Java language no longer needs to be modified thanks to annotations. With annotations the JVM could do some clever internal compilation to remove all the unnecessary bounds checking and read/write fields directly from a DirectByteBuffer.

Cas Smiley


Vorax:
Is there a name for a "redneck" programmer?

Jeff:
Unemployed. Wink
Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #14 - Posted 2005-03-23 10:10:56 »

Most annotations do nothing. What they do do, however, is embed a little hint in the bytecode for the VM. So if you stated that an object extended, say, MappedObject, then you could mark the mapped fields with the @Offset(position) annotion, and the VM could use this information to write highly optimised machine code to do the memory access for you. Otherwise the VM would simply have to generate the bytecode behind the scenes to labouriously call get/set on the underlying buffers for all the field accesses - which would be the fallback anyway.

Cas Smiley

Offline K.I.L.E.R

Senior Member




Java games rock!


« Reply #15 - Posted 2005-03-23 10:30:29 »

How do you know they aren't doing this already? If not they probably planned this when adding annotations.


Quote
Most annotations do nothing. What they do do, however, is embed a little hint in the bytecode for the VM. So if you stated that an object extended, say, MappedObject, then you could mark the mapped fields with the @Offset(position) annotion, and the VM could use this information to write highly optimised machine code to do the memory access for you. Otherwise the VM would simply have to generate the bytecode behind the scenes to labouriously call get/set on the underlying buffers for all the field accesses - which would be the fallback anyway.

Cas Smiley


Vorax:
Is there a name for a "redneck" programmer?

Jeff:
Unemployed. Wink
Offline dleskov

Senior Member


Medals: 10



« Reply #16 - Posted 2005-03-26 07:07:31 »

For those interested in trying out escape analysis in Java today, we have just released Excelsior JET 3.7, which has escape analysis much improved and object explosion implemented.

Download

Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #17 - Posted 2005-03-26 14:33:54 »

<--- I recommend Jet, it really is as good as they claim. Pro version could be a little cheaper though eh?

Cas Smiley

Offline Azeem Jiva

Junior Member




Java VM Engineer, Sun Microsystems


« Reply #18 - Posted 2005-03-26 22:30:05 »

Quote
<--- I recommend Jet, it really is as good as they claim. Pro version could be a little cheaper though eh?

Cas Smiley



Can you give me some numbers?  Say against Java5, how much of an improvement do you see in your apps?  
Offline phazer

Junior Member




Come get some


« Reply #19 - Posted 2005-03-27 08:54:11 »

Quote
For those interested in trying out escape analysis in Java today, we have just released Excelsior JET 3.7, which has escape analysis much improved and object explosion implemented.

Download


Cool. You don't have any plans to offer a free license for open source projects?

Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #20 - Posted 2005-03-27 14:24:59 »

I've not compared it to Java "5". In fact the last version of Jet I used was 3.15 which is 2 years old and it consistently outperformed the 1.4 server VM for games programming - utterly beating it at load times and managing parity during execution time.

Cas Smiley

Offline dleskov

Senior Member


Medals: 10



« Reply #21 - Posted 2005-03-28 06:04:33 »

Quote
<--- I recommend Jet, it really is as good as they claim. Pro version could be a little cheaper though eh?

We are running an v3.7 introductory offer by April 15th. Pro license price is 1/3 off, and you can get Windows and Linux versions together at the price of one of them. Upgrade prices are also reduced. If this is cheap enough, go download the eval, but mind that you have less than 20 days left. Smiley

Offline dleskov

Senior Member


Medals: 10



« Reply #22 - Posted 2005-03-28 06:49:46 »

Quote
Can you give me some numbers?  Say against Java5, how much of an improvement do you see in your apps?  

We are running various benchmarks against the latest version of HotSpot client and server and JRockit right now and will publish them on our Web site soon. We will also publish all scripts, project files and instructions required to run the tests on your system.

If you do not trust vendor benchmarks, why not try it yourself against your own tests or, even better, a real app?

Offline dleskov

Senior Member


Medals: 10



« Reply #23 - Posted 2005-03-28 07:04:59 »

Quote
Cool. You don't have any plans to offer a free license for open source projects?

First of all, note that Excelsior is revenue-funded, and providing support costs money. So we have to be careful about giving away stuff if we want to preserve the quality of our support.

We have plans to offer a special license for non-commercial and non-institutional usage, regardless of whether the project is open source. Considering the first paragraph, it will be  cheap, but likely not free. But we would surely give it to you for free in exchange for something valuable to us. For instance, you may participate in our beta test program or promote our product on your Web site or elsewhere, etc.

We also have plans for subscriptions and pay-as-you-go licensing, so as to remove the upfront cost barrier on commercial usage patterns such as shareware.

Offline phazer

Junior Member




Come get some


« Reply #24 - Posted 2005-03-28 09:23:10 »

Quote

First of all, note that Excelsior is revenue-funded, and providing support costs money. So we have to be careful about giving away stuff if we want to preserve the quality of our support.


Yes, I fully understand that (I work on a commercial Java product myself). I'm in no position to argue what licensing schemes you should have, but a suggestion would be that you provide a free, case-by-case, no-support license for open source projects. The license could require the projects to explicitly state that the binary was produced with Jet, giving you free publicity for your product. I think both parties could benefit from such a license.

Offline dleskov

Senior Member


Medals: 10



« Reply #25 - Posted 2005-03-28 09:36:14 »

Quote
I'm in no position to argue what licensing schemes you should have, but a suggestion would be that you provide a free, case-by-case, no-support license for open source projects. The license could require the projects to explicitly state that the binary was produced with Jet, giving you free publicity for your product. I think both parties could benefit from such a license.

This is quite possible. As I said, we do not need money in all cases. Publicity is more important.

We think a bug in our product must be fixed regardless of whether the user who has encountered is a paying customer. So in fact we do provide support to all users, the differences are in priority, responce times, escalation level, etc.

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.

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

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

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

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

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

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

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

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

Riven (29 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21
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!