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 [2]
  Print  
  z-sorting versus z-buffering  (Read 2051 times)
0 Members and 2 Guests are viewing this topic.
Online Riven
« League of Dukes »

JGO Kernel
*****

Posts: 5872
Medals: 255


Hand over your head.


« Reply #30 on: 2012-01-27 15:44:35 »

I've got a bigger better faster multi-threaded merger now.

It does something like this:
  • It concurrently sorts 4 chunks of the input
  • It samples the chunks at a fixed interval, to see how it's best to split each chunk into 8 smaller parts
  • It takes the average of the previous step and actually splits each chunk into 8 parts
    • chunks[n].parts[0] holds all smallest values,
    • chunks[n].parts[7] holds all largest values
  • It concurrently merges the all chunks[n].parts[k] into temporary array temps[k]
    • temps[0] holds all (ordered) smallest values
    • temps[7] holds all (ordered) largest values
  • It concatenates temps[n] into input

Time: 11.4s Cranky


31.4s -> 11.4s = 2.75x

Hi, appreciate more people! Σ ♥ = ¾

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

JGO Kernel
*****

Posts: 5872
Medals: 255


Hand over your head.


« Reply #31 on: 2012-02-02 05:29:04 »

--err.

Going to post new results 'soon' !

Hi, appreciate more people! Σ ♥ = ¾

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

JGO n00b
*

Posts: 31



« Reply #32 on: 2012-02-02 05:39:51 »

I bow before Thee, OH Great Sorting God !

*bows*

Very interesting thread, now I just have to do something that requires sorting :/

“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Games published by our own members! Go get 'em!
Online Roquen

JGO Strike Force
***

Posts: 828
Medals: 25



« Reply #33 on: 2012-02-02 10:11:50 »

Signed shifting will give you -1 & 0, then the multiplies can be converted into ANDs.
Online Riven
« League of Dukes »

JGO Kernel
*****

Posts: 5872
Medals: 255


Hand over your head.


« Reply #34 on: 2012-02-02 10:15:10 »

Signed shifting will give you -1 & 0, then the multiplies can be converted into ANDs.
I already changed it to be like that, but there was a serious bug, so I removed the code temporarily.

Hi, appreciate more people! Σ ♥ = ¾

Learn how to award medals... and work your way up the social rankings
Pages: 1 [2]
  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.089 seconds with 17 queries.