izissise / PFA

Tek3 End of Year's Project
GNU General Public License v3.0
0 stars 0 forks source link

Filling performance #5

Closed Tastyep closed 9 years ago

Tastyep commented 9 years ago

Think about using std::fill instead of a range-based for loop, it has a big impact on performances:

Ran a test with a vector of 100000000 int: loop: real 0m1.273s std::fill: real 0m0.593s

Edit: Also use the .assign method from vector when copying one to the other

real 0m0.382s real 0m0.827s

Christopher-Steel commented 9 years ago

In which cases ? Which loops should be replaced ?

Tastyep commented 9 years ago

Everytime you are filling up a continuous memory container. I changed it but you were fill up your bf or fg vertices with a range based loop

Christopher-Steel commented 9 years ago

I see what you're referring to, it's the background tiles that get set to stone by default when underground, okay.