Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (117)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Performance Tuning / Re: Char array over String? on: 2003-09-22 18:45:43
thanks for the help.  Good thoughts
2  Game Development / Performance Tuning / Char array over String? on: 2003-09-22 16:39:31
I've read on the java performance tuning section at java.sun.com that there's an increase in performance when char array's are used.  Does anyone feel that you should substitute all your strings for char array's whenever possible?  If so, how would you use them because they won't expand.  I'm thinking maybe arrayCopy would be helpful there.  Just wanted to see what everyone's opinion was.  thanks
3  Game Development / Performance Tuning / Re: Java's Unsafe class on: 2003-08-23 13:46:46
Good thinking.  Thanks for the help
4  Game Development / Performance Tuning / Re: Java's Unsafe class on: 2003-08-22 11:57:26
When I allocate memory with the Unsafe class what exactly is it doing?  I'm really just experimenting with the class.  And the other thing is that when i call unsafe.addressSize() it always returns 4 for some odd reason.  Anyone know how this class works? Huh
5  Game Development / Networking & Multiplayer / Re: java.nio cyclic buffer? on: 2003-08-20 22:23:48
i say just make it public,recompile and stick the class back into your rt.jar.    Wink
6  Game Development / Performance Tuning / Re: Java's Unsafe class on: 2003-08-14 11:39:16
yeah this is true.  It was just something i was toying around with.   Grin
7  Game Development / Performance Tuning / Re: Java's Unsafe class on: 2003-08-14 11:12:54
Thanks for your help.  The only reason I was curious about that Unsafe class was my friend wanted to make a stringBuffer class using JNI and it turned out being alot slower than even your normal stringbuffer.  I'm guessing the JNI calls are expensive.  so we went hunting in the nio classes and found no native methods and that lead to the Unsafe class.  Only problem is that security exception that i'm getting.  Guess it's unusable at this point.   :-/
8  Game Development / Performance Tuning / Java's Unsafe class on: 2003-08-14 00:02:51
Anyone have experience using sun.misc.Unsafe ?  I tried using it today and it's giving an error when i run it.  

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
import sun.misc.*;

public class UnsafeTester {
  private static final Unsafe unsafe = Unsafe.getUnsafe();
  public static void main(String[] args) {
    long ptr = unsafe.allocateMemory(512);
    try{
      unsafe.putChar(ptr,'a');
      unsafe.putChar(ptr,'b');
      System.out.println("Unsafe: " + unsafe.toString());
    }
    finally{
      unsafe.freeMemory(ptr);
    }
  }
}

java.lang.ExceptionInInitializerError
Caused by: java.lang.SecurityException: Unsafe
      at sun.misc.Unsafe.getUnsafe(Unsafe.java:68)
      at garbage.UnsafeTester.<clinit>(UnsafeTester.java:8)
Exception in thread "main"

I'm not sure exactly how I should go about tackling this one so any help would be great.   Wink
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

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

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

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

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

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

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

BurntPizza (33 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (75 views)
2014-09-10 13:57:51

TehJavaDev (105 views)
2014-09-10 06:39:09
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!