Saturday, December 19, 2015

Bringing It Together

Today was a small step forward for the EEG work; since I was busy moving back to Ohio for Winter Break, I decided a good idea would be to set the two applications I was working on to a simple set of loading levels. The current selection in the software is just a single HTML game with a single Unity file, so a build that would allow both applications (and more) at once would be necessary.

As for studying progress, more interesting and complex things abound!

Step 1: Where do REAL temporary objects come from? Implicit conversions and return values from functions, and that can be fixed!

Step 2: By returning constructor arguments instead of returning a temporary value, we can optimize a program and use a relatively standard optimization.

Step 3: Overloading functions (Add(int, MadeUp) instead of implicit conversion) can prevent the temporary objects that are created during implicit type conversions.

Step 4: Using += instead of = (and using the += inside a + operator) can help reduce implicit type conversions as well!

Step 5: Use alternative libraries. This is a small section, but helps illuminate the pros and cons of libraries such as <iostream> (type safe, portable) and <stdio> (small and fast executables)

Step 6: Virtual functions cost plenty! Virtual base tables and pointers to those tables keep in mind how important it is to determine where to produce those tables. A heuristic helps put them in place only where needed, but that can be subverted by inlining. (So don't inline)

Step 7: Virtualizing constructors and non-member functions can be tricky, but possible.

Step 8: Limiting the amount of objects of a class can be done by extending the Singleton to include a max set of references and an exception to throw in case it goes over that amount. It all depends on how "exceptional" those references are though...

Step 9: It's difficult, nay impossible to determine whether an object is on the heap or not, but actually quite simple to determine whether it's alright to delete itself. Do the latter.

Next? More techniques and miscellany!

No comments:

Post a Comment