Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 2 [3] 4 5 6
  ignore  |  Print  
  Generalized Rant Thread  (Read 24011 times)
0 Members and 1 Guest are viewing this topic.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 801
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #60 - Posted 2012-05-17 05:19:05 »

Both your 'optimizations' should be avoided. In most cases HotSpot does the loop unrolling and rewrites the for loops.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline delt0r

JGO Knight


Medals: 27
Exp: 18 years


Computers can do that?


« Reply #61 - Posted 2012-05-17 07:52:58 »

Indeed Riven is right (again). Once upon a time loop unrolling in java (and C) was something you did and it would be faster. That was a long time ago. Compilers in C/C++ unroll for you and so does JIT. Even better JIT can unroll using parameters that you don't know at compile time. Things that can be shown not to change are also typically moved out of the loop. JIT can and does often eliminate bounds checks too when it can prove that out of bounds never happens. Even micro benchmarks can show all this. 

On top of all that even in the old days you would never unroll all 256 elements of a loop. Perhaps you would unroll 16 or so and loop 16x. But since the compiler/JIT can tune these to the particular loop, its always "better".

I have no special talents. I am only passionately curious.--Albert Einstein
Offline princec

JGO Kernel


Medals: 386
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #62 - Posted 2012-05-17 08:50:34 »

Thing is Java was designed specifically in mind of "make your code look neat and tidy and easy to understand, and we'll worry about making it fast enough". By and large they have achieved this goal admirably. Almost no-one ever has any serious performance problems in Java that are fixable with this sort of micro-optimisation. Except on Android, where sadly stuff like caching .length in a loop comparison is still a valid optimisation.

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 801
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #63 - Posted 2012-05-17 09:10:30 »

Thing is Java was designed specifically in mind of "make your code look neat and tidy and easy to understand, and we'll worry about making it fast enough"
There, FTFY.

The Sun JRE was meant to be a reference implementation. Only when there didn't seem to be a fast, freely available alternative, Sun started to put major resources towards performance.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline pitbuller
« Reply #64 - Posted 2012-05-17 09:21:49 »

Thing is Java was designed specifically in mind of "make your code look neat and tidy and easy to understand, and we'll worry about making it fast enough". By and large they have achieved this goal admirably. Almost no-one ever has any serious performance problems in Java that are fixable with this sort of micro-optimisation. Except on Android, where sadly stuff like caching .length in a loop comparison is still a valid optimisation.

Cas Smiley

In some pervert way coding against dalvik is fun becouse you have to do every small thing for yourself. Its like c with bad compiler using java syntax.
Offline princec

JGO Kernel


Medals: 386
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #65 - Posted 2012-05-17 09:39:23 »

Sun have done extremely well with their compiler Smiley Actually IBM did as well but for some reason never really did attempt to compete.

Cas Smiley

Offline delt0r

JGO Knight


Medals: 27
Exp: 18 years


Computers can do that?


« Reply #66 - Posted 2012-05-17 10:11:49 »

A good chunk of the fast parts of the sun implementation is from IBM as I understand. Or at least comes out of IBMs work on JIT.

I have no special talents. I am only passionately curious.--Albert Einstein
Offline sproingie

JGO Kernel


Medals: 202



« Reply #67 - Posted 2012-05-17 14:58:49 »

A good chunk of the fast parts of the sun implementation is from IBM as I understand. Or at least comes out of IBMs work on JIT.

As I understand it, it came from the Self team, which left Sun to write Strongtalk, then got re-hired to write Hotspot.
Online Roquen
« Reply #68 - Posted 2012-09-28 20:05:32 »

Masturbation Programming (MP): A common programming technique that involves coming up with a brilliant solution to a problem and then rapidly banging out the code.  On completion (assuming it is achieved) then end result is usually an embarrassing mess.

Agile Programming: A software engineering methodology that involve iterative application of the MP technique.  Agile developers make impressive claims about their style.

Programming Pairs:  MP as a team sport.  One partner watching the other generating code, injecting any helpful hints as needed and then later:  they trade roles.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 801
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #69 - Posted 2012-09-28 20:22:36 »

Masturbastion Posting (MP): making seemingly provocative claims nobody else really cares about. Typically involving necroing threads for added effect.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

JGO Kernel


Medals: 386
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #70 - Posted 2012-09-28 20:41:50 »

 Pointing Who's been drinking then? 

Cas Smiley

Online Roquen
« Reply #71 - Posted 2012-09-28 20:55:43 »

Probably both of us.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 801
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #72 - Posted 2012-09-28 21:12:46 »

Snarky is my middle name, from this day on Emo

I apologize in advance and wish Roquen strength, for which a medal seems a poor fit, symbolically, but nonetheless invaluable.

* Riven sips from his drink.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Online Roquen
« Reply #73 - Posted 2012-09-28 21:20:34 »

Why on earth?  I feel no shame over either my masturbation programming nor posting (SEE: operator overloading thread #1001 for reference).   Errr...where'd that bottle go?
Offline ctomni231

JGO Wizard


Medals: 99
Projects: 1
Exp: 7 years


Not a glitch. Just have a lil' pixelexia...


« Reply #74 - Posted 2012-09-28 21:32:11 »

... Why are we getting into a discussion about how generalized techniques (such as optimizations and design patterns) are bad anyway? Isn't this thread really the absolute waste of time everyone so valiantly speaks of?

Come on, it is the "stereotypes" of computer science. Everyone gets caught up in them once in their career and just laughs and learns from it afterward. The only time any programming practice is "bad" is when it actually turns into a religious belief.

Optimization 99% of a time is the biggest waste of time you can do on a program. The amount of work to get 1-2 more FPS or even 10 - 15 more bytes of memory is never worth the time. The only time that optimization of code should take place is as a "last resort". In today's age, there is no way we are going to run out of memory, or not have enough speed to perform a simple task.

Personally, design patterns are just a byproduct of trying to make computer science a mindless job. The fact is, we like computer science, but we don't want to code it. If there was a way to translate our thoughts on the computer without typing them down, we'd all flock to it like a bunch of buzzards. I think entity systems, API, and tree node systems all have their place. In no means should we go insane and try to apply them to our code just for the sake of it. Just like you don't use all your wooden blocks to build a castle, some pieces of design should be left out so you can get something built.

... But, yet, here I am wasting my valuable time again. The more time I spend in computer science, the more I believe it is more like Computer Architecture.

Online Roquen
« Reply #75 - Posted 2012-09-28 21:33:47 »

A: work avoidance technique #23.
Offline sproingie

JGO Kernel


Medals: 202



« Reply #76 - Posted 2012-09-28 21:37:16 »

So many words to state that one is wasting their time...  Roll Eyes

Online Roquen
« Reply #77 - Posted 2012-09-28 21:56:31 »

And ctomni231 seemed to have missed my serious points.

Quote
... is "bad" is when it actually turns into a religious belief.
Which is exactly the point on both mentioned, optimization & design pattern.  Patterns are just snippets that are useful or not and shouldn't replace data-structure, algo & design knowledge.  On optimization...real optimization is non-linear and higher level and "premature optimization" is just a single example of wasting one's time and (in my experience) a very unimportant one.
Offline DrHalfway
« Reply #78 - Posted 2012-09-30 02:09:47 »

I would like to note that time is a resource and is not infinite. If I have to "optimize" for a week and only get a measly 0.1ms speed in overall average execution time, i'd say that time can be better spent elsewhere.

Offline philfrei
« Reply #79 - Posted 2012-09-30 05:35:12 »

Tipping point.

"Greetings my friends! We are all interested in the future, for that is where you and I are going to spend the rest of our lives!" -- The Amazing Criswell
Online Roquen
« Reply #80 - Posted 2012-09-30 07:20:06 »

Let me do a optimization summary:

1) Engineering time is the most valuable resource.
2) Optimization is really about attempting to meet a set of goals with some metric for success.  Not really those set of things that ideally your language and compiler should ideally be able to do auto-magically do for you.  Those are ideally "compiler optimizations".  When one is attempting to beat their compiler and/or hold its hand, then best case situations one can only expect very small localized linear time increases and should be avoided unless exactly known to be necessary.
3) Performing any task has an associated opportunity cost of twice the amount of time spent performing it.
4) On considering speed increases, then the most important are algorithmic and data-structure oriented at the high level.  And of these the most important are both non-linear and one that if a "bad" choice is made, then changing to a better option requires significant engineering time.  Simple example: attempt to go from an unstructured world to some set of spatial partitioning.
5) "premature optimization" is IMHO an oxymoron.  This is because "no reasonable goal" is being moved toward.  It is simply one example of wasting time.  All of which are equally bad.
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #81 - Posted 2012-11-07 18:27:30 »

Wow post cool guys hi.

See my work:
OTC Software
Offline theagentd
« Reply #82 - Posted 2012-11-07 19:09:44 »

Wow post cool guys hi.
"Hi guys, cool post! Wow!" meant you suppose I.  Shocked

Myomyomyo.
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #83 - Posted 2012-11-07 20:04:49 »

Doing of the thing that you talk to says I don't.

See my work:
OTC Software
Offline masteryoom

JGO Coder


Medals: 5
Projects: 2


If you look closely, you might see it turning...


« Reply #84 - Posted 2012-11-10 00:48:36 »

Snarky is my middle name, from this day on Emo
Why is that?

Smiley
Online Roquen
« Reply #85 - Posted 2012-12-13 12:43:01 »

Is it just me or does everybody have a tattoo to, you know, express their individuality?
Offline ra4king

JGO Kernel


Medals: 347
Projects: 3
Exp: 5 years


I'm the King!


« Reply #86 - Posted 2012-12-13 17:42:43 »

My individuality is divided.

Offline cheatsguy

Junior Member


Medals: 3


Gamer turned Pixel Artist turned Programmer


« Reply #87 - Posted 2012-12-13 18:33:07 »

Is it just me or does everybody have a tattoo to, you know, express their individuality?
I express mine by not having a tattoo  Grin

Busy between school, work, life, games, programming and general screwing around.
If you'd like some pixel art for your game, send me a PM, i'll see what I can do.
Current project: http://elementalwarblog.wordpress.com/
Offline philfrei
« Reply #88 - Posted 2012-12-13 21:26:00 »

I also liked things like the BMW ad, on broadcast TV and an audience of millions: "You are one in a million. And you want your car to be, too."

Or something like that. There are continual variations on the theme and they always make me laugh.

"Greetings my friends! We are all interested in the future, for that is where you and I are going to spend the rest of our lives!" -- The Amazing Criswell
Offline sproingie

JGO Kernel


Medals: 202



« Reply #89 - Posted 2012-12-13 22:12:06 »

You're one in a million.  That means there's seven thousand people exactly like you.
Pages: 1 2 [3] 4 5 6
  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.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (19 views)
2014-09-24 16:12:06

Grunnt (44 views)
2014-09-23 14:38:19

radar3301 (27 views)
2014-09-21 23:33:17

BurntPizza (63 views)
2014-09-21 02:42:18

BurntPizza (32 views)
2014-09-21 01:30:30

moogie (40 views)
2014-09-21 00:26:15

UprightPath (50 views)
2014-09-20 20:14:06

BurntPizza (54 views)
2014-09-19 03:14:18
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!