www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - OT: Minecraft death by GC

reply "ROOAR" <youwants yahoo.com> writes:
  So the latest Minecraft apparently runs really really poorly 
because of the GC.

And it is running on Java desktop. The supposedly "fast" GC of 
Java can't handle the game anymore--

https://www.reddit.com/r/programming/comments/2jsrif/optifine_dev_minecraft_18_has_so_many_performance/


Take that GC fanatics

  D needs more action you know.
Oct 21 2014
next sibling parent reply ketmar via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Tue, 21 Oct 2014 07:18:26 +0000
ROOAR via Digitalmars-d <digitalmars-d puremagic.com> wrote:

   So the latest Minecraft apparently runs really really poorly=20
 because of the GC.
=20
 And it is running on Java desktop. The supposedly "fast" GC of=20
 Java can't handle the game anymore--
=20
 https://www.reddit.com/r/programming/comments/2jsrif/optifine_dev_minecra=
ft_18_has_so_many_performance/
=20
=20
 Take that GC fanatics
=20
   D needs more action you know.
wow! you are the man! you are the savior! sorry, my Guru, can't write to you anymore: i need to remove GC from all my projects!
Oct 21 2014
parent reply "ROOAR" <youwants yahoo.com> writes:
 wow! you are the man! you are the savior! sorry, my Guru, can't 
 write
 to you anymore: i need to remove GC from all my projects!
I know! It is great being me! I had to do it, D forum was putting me to sleep with its discussion of Postblits and environmental errors. Phfff like those matter.
Oct 21 2014
parent ketmar via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Tue, 21 Oct 2014 07:44:09 +0000
ROOAR via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 I had to do it, D forum was putting me to sleep with its=20
 discussion of Postblits and environmental errors. Phfff like=20
 those matter.
yeah, this was... refreshing morning. ;-)
Oct 21 2014
prev sibling next sibling parent reply "Kapps" <opantm2+spam gmail.com> writes:
"Maybe the biggest and the ugliest problem is the memory 
allocation. Currently the game allocates (and throws away 
immediately) 50 MB/sec when standing still and up to 200 MB/sec 
when moving. That is just crazy."

Wonder how much better that would be if Java had proper value 
types. The idea of allocating on the heap for every single 
Vector3f makes me sad.
Oct 21 2014
next sibling parent "thedeemon" <dlang thedeemon.com> writes:
On Tuesday, 21 October 2014 at 07:37:06 UTC, Kapps wrote:
 "Currently the game allocates (and throws away immediately) 50 
 MB/sec when standing still and up to 200 MB/sec when moving. 
 That is just crazy."
In D this rate of allocation would make GC take 100% of CPU time. The fact that Java survives it with just some frame rate loss shows how great its GC is.
Oct 21 2014
prev sibling next sibling parent "deadalnix" <deadalnix gmail.com> writes:
On Tuesday, 21 October 2014 at 07:37:06 UTC, Kapps wrote:
 "Maybe the biggest and the ugliest problem is the memory 
 allocation. Currently the game allocates (and throws away 
 immediately) 50 MB/sec when standing still and up to 200 MB/sec 
 when moving. That is just crazy."

 Wonder how much better that would be if Java had proper value 
 types. The idea of allocating on the heap for every single 
 Vector3f makes me sad.
That is obviously the problem, and switching to a non GC model would still be horribly slow when you allocate like mad. What they need is way to not allocate that much. Also http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1272953-optifine-hd-a4-fps-boost-hd-textures-aa-af-and#c43757 People have found that with various tweaks, you can get a x2 framerate.
Oct 21 2014
prev sibling parent reply "Paulo Pinto" <pjmlp progtools.org> writes:
On Tuesday, 21 October 2014 at 07:37:06 UTC, Kapps wrote:
 "Maybe the biggest and the ugliest problem is the memory 
 allocation. Currently the game allocates (and throws away 
 immediately) 50 MB/sec when standing still and up to 200 MB/sec 
 when moving. That is just crazy."

 Wonder how much better that would be if Java had proper value 
 types. The idea of allocating on the heap for every single 
 Vector3f makes me sad.
Well, some JIT compilers do stack allocation via escape analysis, which you can check with something like JITWatch. For first class support, it is planned for Java 9, but it might only really come in Java 10. -- Paulo
Oct 21 2014
parent "Casper =?UTF-8?B?RsOmcmdlbWFuZCI=?= <shorttail hotmail.com> writes:
On Tuesday, 21 October 2014 at 21:33:43 UTC, Paulo Pinto wrote:
 Well, some JIT compilers do stack allocation via escape 
 analysis, which you can check with something like JITWatch.

 For first class support, it is planned for Java 9, but it might 
 only really come in Java 10.

 --
 Paulo
I'm looking forward to that. The currently proposed stuff for 9, like Jigsaw, go way over my head in terms of usefulness. In regard to the Minecraft code, it sounds like new features were prototyped and never optimized. Writing slow stuff fast is nice in Java (and D!), but without going full circle it's not so nice in the long run. I guess Microsoft has its work cut out for it.
Oct 23 2014
prev sibling next sibling parent "francesco.cattoglio" <francesco.cattoglio gmail.com> writes:
On Tuesday, 21 October 2014 at 07:18:28 UTC, ROOAR wrote:
  So the latest Minecraft apparently runs really really poorly 
 because of the GC.

 And it is running on Java desktop. The supposedly "fast" GC of 
 Java can't handle the game anymore--

 https://www.reddit.com/r/programming/comments/2jsrif/optifine_dev_minecraft_18_has_so_many_performance/


 Take that GC fanatics

  D needs more action you know.
More like: take that you smart business people who buy a bloated piece of **** for 2.5 BILLION $$$
Oct 21 2014
prev sibling next sibling parent reply "Mathias LANG" <geod24 gmail.com> writes:
On Tuesday, 21 October 2014 at 07:18:28 UTC, ROOAR wrote:
  So the latest Minecraft apparently runs really really poorly 
 because of the GC.

 And it is running on Java desktop. The supposedly "fast" GC of 
 Java can't handle the game anymore--

 https://www.reddit.com/r/programming/comments/2jsrif/optifine_dev_minecraft_18_has_so_many_performance/


 Take that GC fanatics

  D needs more action you know.
 How did that work in previous releases? The previous Minecraft 
 releases were much less memory hungry. The original Notch code 
 (pre 1.3) was allocating about 10-20 MB/sec which was much more 
 easy to control and optimize. The rendering itself needed only 
 1-2 MB/sec and was designed to minimize memory waste (reusing 
 buffers, etc).
 Why is 1.8 allocating so much memory? This is the best part - 
 over 90% of the memory allocation is not needed at all. Most of 
 the memory is probably allocated to make the life of the 
 developers easier.
 tldr; When 1.8 is lagging and stuttering the garbage collector 
 is working like crazy and is doing work which has nothing to do 
 with the game itself (rendering, running the internal server, 
 loading chunks, etc). Instead it is constantly cleaning the 
 mess behind the code which thinks that memory allocation is 
 "cheap".
I could quote the entire post, but the bottom line is: this issue has nothing to do with the GC. Crappy code is crappy code. So your OP is just pointless troll.
Oct 21 2014
parent reply "ROOAR" <youwants yahoo.com> writes:
 I could quote the entire post, but the bottom line is: this 
 issue has nothing to do with the GC. Crappy code is crappy 
 code. So your OP is just pointless troll.
This issue sure does seem to crop up in GC world, wonder why. Oh well. That company with $2.5 billion can't find competent Java engineers lolz! Memory isn't scaling at the rate compute is. I wonder how much worse this issue will be in 5 years. Oh well, let's just write more Java code:)
In D this rate of allocation would make GC take 100% of CPU 
time. The fact that Java survives it with just some frame rate 
loss >
shows how great its GC is.
So: Java GC is turd D GC is wretched turd
Oct 21 2014
next sibling parent reply "monarch_dodra" <monarchdodra gmail.com> writes:
On Tuesday, 21 October 2014 at 09:07:04 UTC, ROOAR wrote:
 I could quote the entire post, but the bottom line is: this 
 issue has nothing to do with the GC. Crappy code is crappy 
 code. So your OP is just pointless troll.
This issue sure does seem to crop up in GC world, wonder why. Oh well.
Hurp, I wonder why GC issues only appear with application that use a GC. Hurp-a-durp. Also, the issue of memory leak and core dumps seem to only appear when you use a systems language. How crazy is that?
Oct 21 2014
parent reply David Gileadi <gileadis NSPMgmail.com> writes:
On 10/21/14, 2:47 AM, monarch_dodra wrote:
 Hurp, I wonder why GC issues only appear with application that use a GC.
 Hurp-a-durp.

 Also, the issue of memory leak and core dumps seem to only appear when
 you use a systems language. How crazy is that?
Happily with a little work D allows you to have both! :)
Oct 21 2014
parent reply "Israel" <tl12000 live.com> writes:
On Tuesday, 21 October 2014 at 15:23:11 UTC, David Gileadi wrote:
 On 10/21/14, 2:47 AM, monarch_dodra wrote:
 Hurp, I wonder why GC issues only appear with application that 
 use a GC.
 Hurp-a-durp.

 Also, the issue of memory leak and core dumps seem to only 
 appear when
 you use a systems language. How crazy is that?
Happily with a little work D allows you to have both! :)
Im curious, will D be one of the first languages to have the ability to use a GC and not use one?
Oct 21 2014
parent reply "Francesco Cattoglio" <francesco.cattoglio gmail.com> writes:
On Tuesday, 21 October 2014 at 16:08:41 UTC, Israel wrote:
 On Tuesday, 21 October 2014 at 15:23:11 UTC, David Gileadi 
 wrote:
 On 10/21/14, 2:47 AM, monarch_dodra wrote:
 Hurp, I wonder why GC issues only appear with application 
 that use a GC.
 Hurp-a-durp.

 Also, the issue of memory leak and core dumps seem to only 
 appear when
 you use a systems language. How crazy is that?
Happily with a little work D allows you to have both! :)
Im curious, will D be one of the first languages to have the ability to use a GC and not use one?
More likely: to give you the ability to shoot yourself in the foot both with a GC and without it. ;)
Oct 21 2014
parent reply ketmar via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Tue, 21 Oct 2014 16:16:17 +0000
Francesco Cattoglio via Digitalmars-d <digitalmars-d puremagic.com>
wrote:

 More likely: to give you the ability to shoot yourself in the=20
 foot both with a GC and without it. ;)
wow! so i'll be able shoot away my foot and GC will collect it!
Oct 21 2014
parent "Israel" <tl12000 live.com> writes:
On Tuesday, 21 October 2014 at 16:25:06 UTC, ketmar via
Digitalmars-d wrote:
 On Tue, 21 Oct 2014 16:16:17 +0000
 Francesco Cattoglio via Digitalmars-d 
 <digitalmars-d puremagic.com>
 wrote:

 More likely: to give you the ability to shoot yourself in the 
 foot both with a GC and without it. ;)
wow! so i'll be able shoot away my foot and GC will collect it!
YESS!!
Oct 21 2014
prev sibling parent reply "Kagamin" <spam here.lot> writes:
On Tuesday, 21 October 2014 at 09:07:04 UTC, ROOAR wrote:
  This issue sure does seem to crop up in GC world, wonder why.
Because it's more commercially successful that way.
  That company with $2.5 billion can't find competent Java 
 engineers lolz!
Or they don't fix problems, which didn't appear.
Oct 24 2014
parent "Szymon Gatner" <noemail gmail.com> writes:
On Friday, 24 October 2014 at 07:42:16 UTC, Kagamin wrote:
 On Tuesday, 21 October 2014 at 09:07:04 UTC, ROOAR wrote:
 That company with $2.5 billion can't find competent Java 
 engineers lolz!
Or they don't fix problems, which didn't appear.
That. Minecraft was never expected to be that big.
Oct 24 2014
prev sibling next sibling parent reply "Paulo Pinto" <pjmlp progtools.org> writes:
On Tuesday, 21 October 2014 at 07:18:28 UTC, ROOAR wrote:
  So the latest Minecraft apparently runs really really poorly 
 because of the GC.

 And it is running on Java desktop. The supposedly "fast" GC of 
 Java can't handle the game anymore--

 https://www.reddit.com/r/programming/comments/2jsrif/optifine_dev_minecraft_18_has_so_many_performance/


 Take that GC fanatics

  D needs more action you know.
Part of my work is to teach people to use tools like VisualVM, Eclipse MAT and similar and to clean offshore code before it gets integrated into customer premises. Bad code is bad code, regardless of a presence of a GC. Unfortunately a GC that removes bad written code is yet to be invented. -- Paulo
Oct 21 2014
parent "ROOAR" <youwants yahoo.com> writes:
 Part of my work is to teach people to use tools like VisualVM,
What is this VisualVM you speak of! Off I go!! "Application Developer:... take thread dumps, browse heap dumps" It describes Java perfectly.
Also, the issue of memory leak and core dumps seem to only 
appear when you use a systems language. How crazy is that?
GC leaks too bro. Actually probably more common these days than leaking in C++. LOLZ!!
Oct 21 2014
prev sibling next sibling parent reply "Szymon Gatner" <noemail gmail.com> writes:
On Tuesday, 21 October 2014 at 07:18:28 UTC, ROOAR wrote:
  So the latest Minecraft apparently runs really really poorly 
 because of the GC.

 And it is running on Java desktop. The supposedly "fast" GC of 
 Java can't handle the game anymore--

 https://www.reddit.com/r/programming/comments/2jsrif/optifine_dev_minecraft_18_has_so_many_performance/


 Take that GC fanatics

  D needs more action you know.
Crazy idea: reach pleayerbase of Minecraft. Hit the same problem with D. Sell it to Microsoft for 2.5B$. Use the money to support D's nogc ;]
Oct 21 2014
parent reply "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= writes:
On Tuesday, 21 October 2014 at 09:14:00 UTC, Szymon Gatner wrote:
 Crazy idea: reach pleayerbase of Minecraft. Hit the same 
 problem with D. Sell it to Microsoft for 2.5B$. Use the money 
 to support D's  nogc ;]
Great plan! Make a DIP! or: 1. mobile chat for Africa, sell to Google for $4B. 2. world of geekcraft, sell to Microsoft for $8B. 3. Cobol to D converter, sell to banks for $16B. 3. facebook for stock investors, IPO for $32B.
Oct 21 2014
next sibling parent "Szymon Gatner" <noemail gmail.com> writes:
On Tuesday, 21 October 2014 at 09:37:32 UTC, Ola Fosheim Grøstad 
wrote:
 On Tuesday, 21 October 2014 at 09:14:00 UTC, Szymon Gatner 
 wrote:
 Crazy idea: reach pleayerbase of Minecraft. Hit the same 
 problem with D. Sell it to Microsoft for 2.5B$. Use the money 
 to support D's  nogc ;]
Great plan! Make a DIP! or: 1. mobile chat for Africa, sell to Google for $4B. 2. world of geekcraft, sell to Microsoft for $8B. 3. Cobol to D converter, sell to banks for $16B. 3. facebook for stock investors, IPO for $32B.
Not quite sure if you mean actual deals (tho 2 mins of googling confirm my suspicion that you are joking ;) but I certainly wasn't: http://www.theguardian.com/technology/2014/sep/15/microsoft-buys-minecraft-creator-mojang-for-25bn With FB I suspect you mean WatsApp for 22B?
Oct 21 2014
prev sibling parent reply Rikki Cattermole <alphaglosined gmail.com> writes:
On 21/10/2014 10:37 p.m., "Ola Fosheim Grøstad" 
<ola.fosheim.grostad+dlang gmail.com>" wrote:
 On Tuesday, 21 October 2014 at 09:14:00 UTC, Szymon Gatner wrote:
 Crazy idea: reach pleayerbase of Minecraft. Hit the same problem with
 D. Sell it to Microsoft for 2.5B$. Use the money to support D's  nogc ;]
Great plan! Make a DIP! or: 1. mobile chat for Africa, sell to Google for $4B. 2. world of geekcraft, sell to Microsoft for $8B. 3. Cobol to D converter, sell to banks for $16B.
I'll just put this right here. https://github.com/rikkimax/Dobol
 3. facebook for stock investors, IPO for $32B.
Oct 21 2014
next sibling parent reply "Szymon Gatner" <noemail gmail.com> writes:
On Tuesday, 21 October 2014 at 10:15:45 UTC, Rikki Cattermole 
wrote:
 On 21/10/2014 10:37 p.m., "Ola Fosheim Grøstad" 
 <ola.fosheim.grostad+dlang gmail.com>" wrote:
 On Tuesday, 21 October 2014 at 09:14:00 UTC, Szymon Gatner 
 wrote:
 Crazy idea: reach pleayerbase of Minecraft. Hit the same 
 problem with
 D. Sell it to Microsoft for 2.5B$. Use the money to support 
 D's  nogc ;]
Great plan! Make a DIP! or: 1. mobile chat for Africa, sell to Google for $4B. 2. world of geekcraft, sell to Microsoft for $8B. 3. Cobol to D converter, sell to banks for $16B.
I'll just put this right here. https://github.com/rikkimax/Dobol
You are not suggesting you sold it for $16B tho, right? ;)
Oct 21 2014
parent Rikki Cattermole <alphaglosined gmail.com> writes:
On 21/10/2014 11:24 p.m., Szymon Gatner wrote:
 On Tuesday, 21 October 2014 at 10:15:45 UTC, Rikki Cattermole wrote:
 On 21/10/2014 10:37 p.m., "Ola Fosheim Grøstad"
 <ola.fosheim.grostad+dlang gmail.com>" wrote:
 On Tuesday, 21 October 2014 at 09:14:00 UTC, Szymon Gatner wrote:
 Crazy idea: reach pleayerbase of Minecraft. Hit the same problem with
 D. Sell it to Microsoft for 2.5B$. Use the money to support D's
  nogc ;]
Great plan! Make a DIP! or: 1. mobile chat for Africa, sell to Google for $4B. 2. world of geekcraft, sell to Microsoft for $8B. 3. Cobol to D converter, sell to banks for $16B.
I'll just put this right here. https://github.com/rikkimax/Dobol
You are not suggesting you sold it for $16B tho, right? ;)
No unfortunately, and not complete. But I more or less did make it ;)
Oct 21 2014
prev sibling next sibling parent reply "ROOAR" <youwants yahoo.com> writes:
 3. Cobol to D converter, sell to banks for $16B.
I'll just put this right here. https://github.com/rikkimax/Dobol
Why? Wait why? Also Cobol looks horrid. Why is it all caps.
Oct 21 2014
next sibling parent "Wyatt" <wyatt.epp gmail.com> writes:
On Tuesday, 21 October 2014 at 10:25:42 UTC, ROOAR wrote:
 Also Cobol looks horrid. Why is it all caps.
You're kind of new to this "legacy" thing, aren't you? ;) -Wyatt
Oct 21 2014
prev sibling parent Rikki Cattermole <alphaglosined gmail.com> writes:
On 21/10/2014 11:25 p.m., ROOAR wrote:
 3. Cobol to D converter, sell to banks for $16B.
I'll just put this right here. https://github.com/rikkimax/Dobol
Why? Wait why? Also Cobol looks horrid. Why is it all caps.
Last semester I had an assignment to port some COBOL code to Python. So of course I did the smart thing. Wrote a compiler to convert it. But for proof of concept straight to D. My tutor of course didn't like it so never finished it. But the parser was great for the documentation generation!
Oct 21 2014
prev sibling parent "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= writes:
On Tuesday, 21 October 2014 at 10:15:45 UTC, Rikki Cattermole 
wrote:
 I'll just put this right here.
 https://github.com/rikkimax/Dobol
Haha! :-D Cool, or should I say Dool? «Dobol, enjoy the future of the past!» Banks are having trouble finding Cobol programmers. I'm considering learning both Cobol and old hierarchical databases. :^] Actually, that was a joke, but when I come to think about it it actually makes a lot of sense… Hm. On Tuesday, 21 October 2014 at 09:56:51 UTC, Szymon Gatner wrote:
 Not quite sure if you mean actual deals (tho 2 mins of googling 
 confirm my suspicion that you are joking ;) but I certainly 
 wasn't:
Yeah, but considering the insane "big is better" valuations we see these days, I thought the business people migh as well use this simple formula: offer = (last big valuation)*2 ==> 1B, 2B, 4B, 8B, 16B, 32B, 64B.
 With FB I suspect you mean WatsApp for 22B?
Actually I thought about the valuation of FB at 30B, but the WhatsApp purchase is insane! And here I thought SUNs purchase of MySQL for 1B was a bad investment???!??! In perspective, if FB had tried to sell 19B worth of stock, then the prices would have gone down real fast… It is Monopoly money… :-/ Anyhow, youngsters aren't loyal to technology, only old people are. And they go to the "new and cool places". So these things will shift over time. I guess that is why FB is trying to be cool by investing in stuff like 3D headgear and chats…
Oct 21 2014
prev sibling next sibling parent "Chris" <wendlec tcd.ie> writes:
On Tuesday, 21 October 2014 at 07:18:28 UTC, ROOAR wrote:
  So the latest Minecraft apparently runs really really poorly 
 because of the GC.

 And it is running on Java desktop. The supposedly "fast" GC of 
 Java can't handle the game anymore--

 https://www.reddit.com/r/programming/comments/2jsrif/optifine_dev_minecraft_18_has_so_many_performance/


 Take that GC fanatics

  D needs more action you know.
I don't think the question is whether or not GC is inherently good or bad. The question is what does your application need? If it can live happily with GC, then use GC. If, however, you have a real-time application, where you cannot afford it, avoid it (or at least avoid zillions of new allocations every second). I suppose part of the problem with the Java code you mentioned is that people use textbook "best practices" that look good on paper but can be very inefficient in reality. But this is not really the language's / GC's fault. If people write dull and unimaginative code to the point where the product becomes useless, there is something wrong with the company's culture. I've seen poorly written, inefficient C code too.
Oct 21 2014
prev sibling next sibling parent Marco Leise <Marco.Leise gmx.de> writes:
Am Tue, 21 Oct 2014 07:18:26 +0000
schrieb "ROOAR" <youwants yahoo.com>:

   So the latest Minecraft apparently runs really really poorly 
 because of the GC.
 
 And it is running on Java desktop. The supposedly "fast" GC of 
 Java can't handle the game anymore--
 
 https://www.reddit.com/r/programming/comments/2jsrif/optifine_dev_minecraft_18_has_so_many_performance/

 Take that GC fanatics 
Sorry to rain on the parade, but the original code by Notch seems to be very careful about real-time game requirements. It is not so much that Minecraft got "so big" that it is stalled by garbage collection. It is the way the new code was written (by freshman programmers?) more in terms of buzz words than with practical considerations in mind. This code would have become slower in any language.
   D needs more action you know.
Yes I know, you know, we all know. Fortunately improving the GC and nogc is one of the two development focuses right now. -- Marco
Oct 21 2014
prev sibling parent "Chris Nicholson-Sauls" <ibisbasenji gmail.com> writes:
Eh.  All I know is, this version that allegedly has framerates in 
the territory of 10ish, runs at 200+ for me on seven year old 
hardware, and I know others with the same experience.  Something 
else is a contributor.
Oct 23 2014