rzel / physaxe

Automatically exported from code.google.com/p/physaxe
0 stars 0 forks source link

Patch for /trunk/phx/col/SortedList.hx #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Altered syncShape so that rather than searching from the start of the list to 
find its place it now searches from its current location. For high-movement 
problems a large proportion of the shapes can potentially be repositioned by 
this function and hence it is important that it is algorithmically efficient. I 
can think of few general cases where this patch would degrade performance.

The effect of this patch using demo 5 (falling pentagons) was a decrease in 
total execution time per iteration (the "all" timer) on my machine to 65%-75% 
of pre-patch values (ie - 25-35% faster). This is obviously a significant 
performance gain.

Original issue reported on code.google.com by ja351...@googlemail.com on 2 Apr 2011 at 1:10

GoogleCodeExporter commented 9 years ago
Hmm - looks like I was a bit sloppy on the ends. Wasn't a problem in my 
situation as I had four static walls surrounding the domain. It is, however, a 
problem in my new situation!

See attached for a better version. I've not tested performance, but I doubt 
it'll have a significant impact over the previous patch.

Original comment by ja351...@googlemail.com on 6 Jul 2011 at 4:43

Attachments: