Monday, 5 December 2016

Adventopolis #5 - The fail must go on

Wanted to rest today. Almost coded threads as a last half hour resort.

Man, threads are insane. Right now, the test I am doing behaves different than yesterday. I run the multithreaded plasma effect, it gets 600fps, it used to be around 1500 yesterday. I am sure I am on release mode. Clean and recompile. At some runs it gets 1500 for 3-4 seconds and then drops back to 600. At other runs just stick to 600. Then I quit VS and go run it from exe and stays at 1500 as it should. Then back at VS, recompile, stays at 600 in and outside. What's going on? Then I decide to try with MinGW on codeblocks and realize C++11 threads are not supported. Shit.. there are some workarounds maybe but not something I can test fast in 5 minutes before writing this post. I'd love to see what happens with codeblocks code, if the same happens.

The codeblocks code on single threaded was a bit more optimized from VS2015 for this, made 950fps instead of 750. I am wondering how it performs with multithreading. Not bother to try now. That code would work on Linux, I think I read it's the MinGW on windows that doesn't support C++11 threads yet.

Anyway, I also took care of not using the same memory. I had precalcs for sines and colortable and made 8 copies of it for the 8 threads (although I don't get any more than 3x speed and that's the nature of the effect, too light and too fast, possibly ends on vram bandwidth, resolution is 1280*720*32bpp). I was almost going to try to see what happens if everything was looking at the same lookup tables. But this weird performance with VS puzzles me. Can't test anything. And anyway the code is a mess, I should scrap and design a way to pass jobs to a thread pool.

I am not sure I will be motivated to work more focus on some projects soon. I could equally well want to rest tomorrow and the day after. I'll see. At least I fiddled a bit with the thread code of yesterday. But I am scared of that code.

Also I spent time figuring out why the phone company can't come and install the phone/internet here. That's why I was a bit demotivated and then made a bath and played Doom and watched youtube.

p.s. Will I switch to some CPC or other work tomorrow? That needs change of focus, just take time finding the project, remembering the code, plan what to do next. Or maybe I should do what I feel like doing. Fiddling on this project is easier now, it's not even project, it's preparation of the framework for future demos/games.

p.p.s. I am going chaotic right now, no rigid plans, no focus on one thing. But maybe it's because I want to fill the time and write this post in a way that shows something is slowly moving. So maybe that's why I can't switch to more demanding stuff.

No comments:

Post a Comment