Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  [fulfilled] Forum search  (Read 1962 times)
0 Members and 2 Guests are viewing this topic.
Offline CommanderKeith

JGO Wizard
****

Posts: 1455
Medals: 9



« on: 2010-04-01 06:19:37 »

Hi,

Forum search doesn't seem to work very well, and google doesn't turn up any pages on java-gaming.org for some reason - I heard that's because google is locked out of the forum somehow. Maybe someone could flick the switch and let google index/search java-gaming.org?

For example I can't find the Bag.java code that I remember someone made a few years ago which is like an ArrayList but it's unordered and quicker for deletions...

If anyone has it that'd be handy Smiley
Thanks,
Keith

Offline ryanm
« League of Dukes »

JGO Strike Force
*****

Posts: 788
Medals: 4


Used to be bleb


« Reply #1 on: 2010-04-01 06:31:27 »

Thar she blows!. I agree that the search could be better, probably easiest just to let google in.
Offline Riven
« League of Dukes »

JGO Kernel
*****

Posts: 5866
Medals: 255


Hand over your head.


« Reply #2 on: 2010-04-01 06:36:06 »

For example I can't find the Bag.java code that I remember someone made a few years ago which is like an ArrayList but it's unordered and quicker for deletions...

http://riven8192.blogspot.com/2009/08/bag-unordered-list-fast-remove.html

Hi, appreciate more people! Σ ♥ = ¾

Learn how to award medals... and work your way up the social rankings
Games published by our own members! Go get 'em!
Offline CommanderKeith

JGO Wizard
****

Posts: 1455
Medals: 9



« Reply #3 on: 2010-04-01 06:51:21 »

Thanks a lot Bleb and Riven for the links, very handy!  Cool

Bleb, for some reason the source code link/attachment on reply 51 here (http://www.java-gaming.org/topics/java-collections-good-for-gaming/14938/msg/119747/view.html#msg119747) seems to be broken - 404 error. I know it's not your link, the forum seems to have lost it....


Offline ryanm
« League of Dukes »

JGO Strike Force
*****

Posts: 788
Medals: 4


Used to be bleb


« Reply #4 on: 2010-04-01 07:30:16 »

Old attachments get deleted maybe? I don't have the code anymore at any rate, I'd just use Riven's.

edit: Continuing my campaign of pilferage from Riven, find attached his Bag code, but altered to include the stuff (javadoc, type safety warnings) that my ultra-prissy Eclipse setup warns me about.
Offline Riven
« League of Dukes »

JGO Kernel
*****

Posts: 5866
Medals: 255


Hand over your head.


« Reply #5 on: 2010-04-01 09:16:27 »

It's probably much faster to do:

   T[] arr = (T[])new Object[size];

Hi, appreciate more people! Σ ♥ = ¾

Learn how to award medals... and work your way up the social rankings
Offline ryanm
« League of Dukes »

JGO Strike Force
*****

Posts: 788
Medals: 4


Used to be bleb


« Reply #6 on: 2010-04-01 10:05:16 »

Done
Offline Hansdampf

Sr. Member
**

Posts: 412
Medals: 2


too offending?


« Reply #7 on: 2010-04-01 16:18:17 »

For me and a stupid microbenchmark the bag is slightly slower (about 1%) with -server option  than ArrayList.
Still 3.5 times faster with -client though.

edit: I was just iterating and adding integers, so no deletion was taken into account.
edit2: forget this post, it also depends on the size, with more elements (500000) the bag wins again.

lots of sillystupid games: http://www.emaggame.com
Offline Hansdampf

Sr. Member
**

Posts: 412
Medals: 2


too offending?


« Reply #8 on: 2010-04-01 16:33:05 »

For me and a stupid microbenchmark the bag is slightly slower (about 1%) with -server option  than ArrayList.
Still 3.5 times faster with -client though.

edit: I was just iterating and adding integers, so no deletion was taken into account.
edit2: forget this post, it also depends on the size, with more elements (500000) the bag wins again.
final edit: guess what, iterating in reverse order (for(i=size-1;i>=0;i--) is SLOWER with -server on an array than the normal way. Yay! my mircobenching sucks.

lots of sillystupid games: http://www.emaggame.com
Offline Nate

JGO Neuromancer
****

Posts: 1062
Medals: 30


mooooo


« Reply #9 on: 2010-04-01 20:12:02 »

edit: Continuing my campaign of pilferage from Riven, find attached his Bag code, but altered to include the stuff (javadoc, type safety warnings) that my ultra-prissy Eclipse setup warns me about.
I don't get why people don't just turn of the stupid warnings? Just putting "Unchecked generic operation" and "Usage of a raw type" to "ignore" will keep you from littering your code with tons of useless pointy brackets, eg on the RHS of initialization. FEAR the ClassCastException...

Games published by our own members! Go get 'em!
Offline ryanm
« League of Dukes »

JGO Strike Force
*****

Posts: 788
Medals: 4


Used to be bleb


« Reply #10 on: 2010-04-02 05:01:34 »

I write a fair amount of code that other programmers will see, and don't want to be the cause of besmirching someone else's pristine Problems tab. Hence my Eclipse setup is so very uptight.
Eclipse takes care of the extra-typing drudgery anyway.
Offline Nate

JGO Neuromancer
****

Posts: 1062
Medals: 30


mooooo


« Reply #11 on: 2010-04-02 19:04:45 »

Well, it makes my eyes bleed! :p

Offline Riven
« League of Dukes »

JGO Kernel
*****

Posts: 5866
Medals: 255


Hand over your head.


« Reply #12 on: 2010-12-16 20:39:19 »

FIXED performance issue in forum search

Hi, appreciate more people! Σ ♥ = ¾

Learn how to award medals... and work your way up the social rankings
Offline CommanderKeith

JGO Wizard
****

Posts: 1455
Medals: 9



« Reply #13 on: 2010-12-16 22:29:25 »

Wow, I like this under-promise over-deliver thing that's going on.

So now google indexes JGO, and the internal forum search is faster too.

very cool  Cool

thanks

Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.116 seconds with 20 queries.