Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Everything Else LittleBigPlanet 2
#1

MC optimization: functionality vs readability

Archive: 5 posts


Here's something I have wondered about a good bit. When you guys design a system, and you are doing the cleanup afterwards, do you lean towards streamlined functionality or better readability?

What I mean is this
Sometimes you may have a MC that makes perfect sense logically, but you could probably hone it down some to use as little thermo as possible. Doing that would obfuscate its logic some though. On the other hand, you could make what it does much more immediately obvious by adding a few items that don't affect the latency, but may add a small amount to the thermo.

As I start making more and more complex devices, I find myself facing this more often.

I guess an example is the counter I made. It's a standard LED number display with 7 parts. On the MC I laid out the 7 OR gates that activate the appropriate line in the LED display to form the numbers. On each of the OR gates there are 10 inputs representing the numbers 0 through 9; some are are left empty. I could make each OR with the exact number of inputs it needs, and save a tiny bit of space, but it makes it much less readable if I decide to change the numbers in some way. In this case the savings would be rather insignificant, but you get what I mean.

Anyway, it's just something I've been thinking about lately. When you find yourself in a situation where you have to sacrifice one for the other, which do you choose?
2011-02-12 03:24:00

Author:
tdarb
Posts: 689


I generally go for making the least buggy logic possible at the expense of thermo.

This is because I conserve thermo by utilizing emitters by loading and unloading chunks of my map as needed.
2011-02-12 03:46:00

Author:
Unknown User


This is tricky. I would tend towards readability as long as you aren't sacrificing performance. A year from now, when you are digging through your logic network you will want something you can follow easily. Comments help too. I find myself putting notes in chips I never plan on sharing, just so when I revisit them I know what they do. At the time you are creating it you always think you will remember what the heck it is doing but that is rarely the case, even a few weeks later. You can always optimize thermo later, if need be, but only if you can understand what that thingamajig is doing.

I also find myself spending a lot of time optimizing the routing of the wiring of my circuits, spreading out components and aligning them just right so the flow of wires is easy to follow... this helps a lot.
2011-02-12 04:02:00

Author:
Osprey71
Posts: 93


i do everything wirelessly using tag signals from a main controller for this reason & sticker my chips. For respawning purposes a following seat means there's no reason not to think wire free. the 60 tags & the controller take up a microscopic amount of therm for me.

i space everything perfectly as well, a single microchip space from each other to keep it all readable & grabbable. i divide my left & right side & button specific functions into there own perfectly marginalized chips. sometimes if i have an OR/AND etc with an odd # of ports & it can't be placed symmetrically i'll put a dummy battery or duplicate connection for the purpose of symmetry.

from the pictures I've seen of other people's complex logic looking like someone poured twizzlers into a computer and shook it around violently... & the total impossibility of helping people modify their's in cocreate without rebuilding it from scratch since even they can't remember what it does... i'm better off for it.

Optimize readability for function
2011-02-12 14:13:00

Author:
Unknown User


Here's something I have wondered about a good bit. When you guys design a system, and you are doing the cleanup afterwards, do you lean towards streamlined functionality or better readability?

As with programming, it's probably good practise to make it readable first, and only optimize if necessary. If you should need to optimize, identifying which part[s] to optimize to give the maximum benefit is paramount. q.v. this thread (https://lbpcentral.lbp-hub.com/index.php?t=48803-8-bit-Digital-Readout).

From this WP page (http://en.wikipedia.org/wiki/Program_optimization) on program optmization...


Optimization can reduce readability and add code that is used only to improve the performance. This may complicate programs or systems, making them harder to maintain and debug. As a result, optimization or performance tuning is often performed at the end of the development stage.

Donald Knuth made the following two statements on optimization:

"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil"

...which is often humorously summed up by the "Two Rules of Program Optimization"...


Rule #1: Don't do it.
Rule #2 (for experts only!): Don't do it yet.
2011-02-12 21:23:00

Author:
Aya042
Posts: 2870


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.