Show Posts
|
|
Pages: [1] 2 3 ... 16
|
|
2
|
Discussions / General Discussions / Re: Math.abs() discussion
|
on: 2006-02-20 17:52:36
|
I get these results on a 3.06GHz P4 1 2 3 4 5 6 7 8
| 0: 15.937469 ns (combined result: -703529116) 1: 4.216863 ns (combined result: -703529116) 0: 16.258211 ns (combined result: -782838401) 1: 3.796482 ns (combined result: -782838401) 0: 15.778359 ns (combined result: -1823151896) 1: 3.805004 ns (combined result: -1823151896) 0: 15.950707 ns (combined result: 1636766866) 1: 4.353477 ns (combined result: 1636766866) |
As I noted on the other thread, some P4 processors have a very slow shift operation.
|
|
|
|
|
4
|
Discussions / General Discussions / Re: If you ever wanted a reason to use a modern langauge...
|
on: 2006-02-12 19:18:50
|
However, I was hoping to get reasons why Java wasn't being picked up (why it wasn't viable) since having used it for games development for a few years and for other applications for a lot longer I still can't see and reasons other than a stigma associated with the language.
Graphics performance has been rather slower to improve than computational performance. Especially if you consider the basic Java API (AWT, Java2D, Swing) as opposed to extensions allowing access to OpenGL. Otherwise there has been a lot of unjustified performance stigma.
|
|
|
|
|
5
|
Discussions / General Discussions / Re: If you ever wanted a reason to use a modern langauge...
|
on: 2006-02-12 17:37:16
|
Even after 10 years of speed increases we're not there yet. At any given point during this long period of time have those who bought into the hype and bet on Java becoming as fast as C++ been disappointed. This is part of Java's huge credibility deficit.
When I was first looking at using Java (> 5 years ago) I tested some of my own code and even then the speed difference between Java and C++ was modest on that code. Since then a greater variety of code now approaches C++ performance, and fewer coding tricks are required. Adding stuff like escape analysis may not speed up code which has been optimised by the programmer, but rather allow ordinary straight forward code to run as fast as that written by the performance specialist.
|
|
|
|
|
6
|
Discussions / Miscellaneous Topics / Re: Fast and effecient way of scaling JPEG images?
|
on: 2006-01-07 17:58:00
|
|
Try using the imageio package (javax.imageio). This allows you to read an image and reduce its size in a single step. Depending on the implementation this may not require as much memory as would be required to read in the entire original image. The downside is that the quality of rescaling is likely yo be reduced. Alternatively it also allows you to read in parts of an image, so you could divide the larger image into many pieces and rescale each separately (you will need some overlap) and finally recombine the reduced pieces.
|
|
|
|
|
7
|
Discussions / Miscellaneous Topics / Re: Instanceof issues
|
on: 2005-12-31 17:43:56
|
do...while is only good if you want to run the code inside the loop one time before checking the condition. can't think of any useful examples though ... o_O;;
Usually where you have special case code for the zero case, so that you know the loop will run at least once but don't want to redundantly repeat the test on that first iteration.
|
|
|
|
|
10
|
Java Game APIs & Engines / J2ME / Host for a small midlet
|
on: 2005-12-23 23:57:22
|
|
I've written my first midlet, now I just need somewhere to put it. It isn't actually a game --- I needed to start with something more trivial. Any suggestions as to where I could put it without going to the trouble of setting up a server myself?
|
|
|
|
|
13
|
Discussions / General Discussions / Re: Java Structs, in Progress?
|
on: 2005-11-18 14:40:54
|
They just assume that it will be a struct keyword like in C.
Well that was the original proposal, and there are now rather a lot of comments to read. Working out what the current consensus proposal would be from that JRE is no trivial task.
|
|
|
|
|
14
|
Game Development / Performance Tuning / Re: What are the Default Heap Sizes?
|
on: 2005-11-15 13:43:35
|
That's a low starting value.
Higher values would further increase the whining about how much space Java uses. It would be nice to be able to give the gc a hint at run time to the effect that you were about to allocate ~40MB of data. In effect to override the -Xms value. I have code that allocates several hundred megabytes of data and the run time is very dependent on the minimum heap size. I understand that there are difficulties changing the maximum heap size at runtime, but surely changing the minimum size is much easier.
|
|
|
|
|
17
|
Discussions / Miscellaneous Topics / Re: Floating point accuracy in Java not as accurate as C/C++?
|
on: 2005-11-14 10:13:03
|
|
strictfp does not change the accuracy requirements at all, instead not using it allows the use of an extended exponent range. So that instead of overflowing at about 1e308, much larger values can be represented. This is only permitted for the intermediate values of an expression. On Intel hardware it allows intermediate values to be kept on the FP stack which uses an 80 bit representation. With strictfp each intermediate value has to be saved to memory and then reloaded to force overflow to occur at the expected point. Note that although the FP stack has 80 bits for each entry calculations do not necessarily use the full 64 bit mantissa --- there is a mode setting which controls the accuracy required (float, double, extended).
Fused multiply and add is a separate issue usually relating to Power cpus, and this is still not permitted because it uses additional accuracy for the intermediate result.
|
|
|
|
|
21
|
Discussions / Miscellaneous Topics / Re: Unwelcome reminder
|
on: 2005-11-06 12:45:49
|
I'm 34. I've never used punch cards or paper tape... though I hear that the paper tape is better 'cause when you drop it on the floor you don't have to worry about putitng it in the right order when you pick it up  The better card punch machines could be set to automatically put a sequence number in specified columns. Then if you dropped a deck, you just fed the cards into the automatic sorting machine. Paper tape was slower and more fragile than cards. The first computer I used (1973) was an IBM 1130: http://www-03.ibm.com/ibm/history/exhibits/1130/1130_intro.html
|
|
|
|
|
24
|
Discussions / Miscellaneous Topics / Re: Unwelcome reminder
|
on: 2005-11-04 11:23:11
|
Jeeez.. old people, do you remember punch cards?  Kev Yes. I even remember a computer that was programmed using a plug panel. It was used to produce the program list for Channel 7 (I think) in Perth. At the time I was an exchange visit, staying with the family of the man responsible for programming it. Long out of date at the time it was kept in use on the basis of "if it ain't broke don't fix it".
|
|
|
|
|
26
|
Discussions / Miscellaneous Topics / Re: Floating point accuracy in Java not as accurate as C/C++?
|
on: 2005-11-04 10:21:27
|
'Argh' is not directed at anyone else, usually, when you read it on the forums. It's the equivalent of slapping your forehead in real life when you realize you've made a mistake. Or, as Homer would say, "Doh!".
Exactly right. The peculiar characteristic that NaN isn't equal to itself was something I ought to have remembered. At the time I was concentrating on the fact that the String conversion should round trip the values exactly (including the NaN case) and forgot that the equality test is tricky.
|
|
|
|
|
27
|
Discussions / General Discussions / Re: Creating a new byte-code compatible java vm
|
on: 2005-11-03 12:25:18
|
It may be more important with apps that use physics packages more intensively.
Very likely. However I don't think that just turning of the checks is the correct approach. It would be far preferable to improve the JIT's ability to tell when the checks weren't necessary. For example good Pascal compilers were able to eliminate more checks when the integer subrange types were used appropriately. Could we add attributes to declarations in Java that made similar assertions. Then so long as the assertion was true the JIT could make more aggressive optimizations. If an assertion was found false then either an exception could be thrown, or the optimizations unwound and the application left to continue and fail in the normal manner when the bad value was used. Also would it be reasonable for a JIT to take notice of assert statements even when they were 'disabled' --- but of course only when the assert condition is helpful to the optimiser.
|
|
|
|
|
28
|
Discussions / General Discussions / Re: Creating a new byte-code compatible java vm
|
on: 2005-11-02 17:19:24
|
removing those nasty array bounds checks.
I think this gets more attention than it deserves. In a number of important cases the HotSpot server can remove these checks safely (or at least hoist them out of loops). Even when they remain they aren't as expensive as many people seem to think (and a lot less expensive than overrunning buffers as Microsoft can no doubt attest).
|
|
|
|
|
30
|
Discussions / Miscellaneous Topics / Re: Java enum functionality
|
on: 2005-11-02 12:26:20
|
|
Using naked bit operations to represent set operations is a bad hack too, albeit one of long standing.
I concede that the recursive generic declaration takes some understanding, but most people will just gloss over it and accept that it does the right thing. however without generics we have a semi-staticly type checked language which seems intellectually unsatisfactory. A sort of half way house between the fully dynamic languages and a complete static type checking. While some type casts are always likely to be necessary, without generics I find I have just too many of them for my peace of mind.
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|