Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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 4314 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 12: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 Devvie


« Reply #1 - Posted 2002-11-19 13: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 Devvie

Nothing unreal exists

« Reply #2 - Posted 2002-11-19 13: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:
GoSub: java2D gamechmark
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

« JGO Spiffy Duke »

Medals: 1033
Projects: 3
Exp: 20 years

Eh? Who? What? ... Me?

« Reply #3 - Posted 2002-11-19 13: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):


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:


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

Cas Smiley

Offline erikd

JGO Ninja

Medals: 16
Projects: 4
Exp: 14 years


« Reply #4 - Posted 2002-11-22 08: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.


Pages: [1]
  ignore  |  Print  

EgonOlsen (79 views)
2018-06-10 19:43:48

EgonOlsen (59 views)
2018-06-10 19:43:44

EgonOlsen (78 views)
2018-06-10 19:43:20

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

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

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

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

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

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

Solater (177 views)
2018-03-17 05:04:08
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!