Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (578)
games submitted by our members
Games in WIP (499)
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  
  hotspot inlining  (Read 2675 times)
0 Members and 1 Guest are viewing this topic.
Offline snak

Senior Newbie




Eu não falo o português


« Posted 2002-11-19 13:53:42 »

Does anyone know the rules governing what code hotspot is able to inline?  I have several method calls in tight loop.  The code will start to get pretty nasty looking without them, so I'd rather not do the inlining myself if I can.

Has Sun published any information on what code you can expect will be inlined, or is there any way to determine this with a profiling tool?  I guess I can do it by hand and measure performance, but I'd rather not if there's a way involving less work  Grin
Offline leknor

Junior Member




ROCK!!!


« Reply #1 - Posted 2002-11-19 14:15:37 »

I think the cloests you'll find to a definative answer is from Jeff's book. appendex B.3.1 is about inlining in the -server version of HotSpot. I think the book was written about the time of Java 1.2 and I think I've read the -client HotSpot has since learned how to inline.
Offline pepe

Junior Member




Nothing unreal exists


« Reply #2 - Posted 2002-11-19 14:49:48 »

Both standard and server* jvm know how to inline, believe me.
Actually, my tests about inlining show that  if you make a loop that makes some calls, they are inlined, and following some few rules, you can make hotspot's inlining faster than inlining by hand. (yes..  you read it well Shocked )
i did not make tests for the number of functions inlined or the length of the called methods. this could be interesting, but at least, if you have to inline two to ten small methods (20-50 lines) it goes well.


* A regression in 1.4.0 server made the inlining slower than 1.3 client. Did not test under 1.4.1 to see if that was corrected. will do that soon.

Home page: http://frederic.barachant.com
------------------------------------------------------
GoSub: java2D gamechmark http://frederic.barachant.com/GoSub/GoSub.jnlp
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

JGO Kernel


Medals: 282
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #3 - Posted 2002-11-19 14:50:04 »

This extra flag controls the maximum size of inlinable methods (I presume the size is in "bytecodes" but I don't know for sure):

-XX:MaxInlineSize=64

Additionally this flag tells the compiler how many times to interpret a method before it compiles it. If I were writing the compiler I'd have it do its inlining recursively before performing a compilation:

-XX:CompileThreshold=500

The default for server is 10000 ISTR, and client is 1500.

Cas Smiley

Offline erikd

JGO Ninja


Medals: 15
Projects: 4
Exp: 14 years


Maximumisness


« Reply #4 - Posted 2002-11-22 09:02:43 »

I'd say that you must avoid manual inlining in any way. It makes your code unmaintainable and most probably not any faster.
It *can* even slow down your code a great deal which, as some of you may remember, I found out the hard way  Smiley

Anyway thats my 2 cents.

Erik

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.

xsi3rr4x (27 views)
2014-04-15 18:08:23

BurntPizza (24 views)
2014-04-15 03:46:01

UprightPath (38 views)
2014-04-14 17:39:50

UprightPath (21 views)
2014-04-14 17:35:47

Porlus (36 views)
2014-04-14 15:48:38

tom_mai78101 (61 views)
2014-04-10 04:04:31

BurntPizza (119 views)
2014-04-08 23:06:04

tom_mai78101 (219 views)
2014-04-05 13:34:39

trollwarrior1 (186 views)
2014-04-04 12:06:45

CJLetsGame (193 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!