Jump to content

  • Log In with Google      Sign In   
  • Create Account

Zaoshi Kaba

Member Since 04 Nov 2012
Offline Last Active Today, 03:55 AM

Posts I've Made

In Topic: c++ Performance boost needed

17 September 2014 - 02:12 PM

  1. Yes, operator[] is a little slower, especially if you have exceptions/etc turned on; it checks whether range is valid, etc. However your loop isn't big enough to make a any noticeable difference.
  2. std::clock() has horrible accuracy. Even if there is performance difference you won't notice until it's huge or it'll round wrong way giving invalid data, ex. execution time can increase by 1% by rounding will change from 16ms to 32ms. Pointers aren't "faster" or "slower", however when misused they definitely can be slower because of cache misses.
  3. I have suspicions that your handConflictsBoard() function passes values instead of references, thus copying a lot of data when it's not necessary which is likely source of your slowdown.

​If you want to make your code faster first you need to figure which part is the slowest and then see how you can improve it. Optimizing random code parts isn't likely to give significant difference.

In Topic: Preprocessor query

14 September 2014 - 04:45 AM

Won't this turn __COUNTER__(a) into a string instead of calling macro and turning result into a string?


There's some command line parameter to output preprocessed file, that way you can see result you're getting instead of playing guessing game.

In Topic: Which algorithm is more efficient for visibility culling? BSP or OCTree?

12 September 2014 - 10:24 AM

I looked online for different methods/algorithms and used this article as reference on proper use of SSE. However in my case I've used AVX and made certain assumptions.

In Topic: Which algorithm is more efficient for visibility culling? BSP or OCTree?

12 September 2014 - 02:56 AM

brute force, just iterate over the set of renderables and cull them against the view frustum. Even better, pack the bounding boxes with handles back to the owner into an array and iterate that much more cache efficient, minimal branching (in fact, you can delay branching till the end in most cases).


To backup Washu I can say I've done thesis on view frustum culling and bruteforce method culls 340,000 AABBs in 1 millisecond. If this isn't sufficient you might have different problems.

In Topic: For-loop-insanity

02 September 2014 - 10:51 AM

Since we are trying to come up with new, obscure, and complicated ways for counting up, how about this

Somehow I can see Java programmer actually doing this.