Why don't certain living things seem to save energy?

When spring comes I keep the windows open and flies often enter the apartment. For hours on end they fly on circumvoluted orbits that they establish in the center of a room. I’m not referring to gnats (which I’m quick to drive away) but the small kind (which for me represent ordinary flies). There is one in my room now and it’s been flying there all by itself for about half an hour. Why?

Animals are know to save energy and use it sparingly. Evolution itself seems to be driven by this principle. For instance, last fall a team a scientists discovered that certain cave fish had evolved to have smaller brains and no circadian rhythm in order to save energy (source).

But moths may continuously swarm by the hundreds above a fire at night apparently for no reason.

Okay, there may be some cause unknown for most of us, but the waste of energy is still there.

It makes me laugh. It looks like a trivial or petty matter, this fly in the center of my room, describing incessant 3D zigzags right below the lamp, but I wonder at this behavior since there is no other fly with which it might be interacting and the sources of food are situated quite somewhere else.

If I were to risk an answer, I would say that flies and moths afford to make so much effort apparently uselessly because their bodies are designed to produce a lot of energy with very little fuel.

I carried out a quick investigation on the Internet for an expert answer but I failed to find something relevant.

Do you have any idea why the fly in the middle of my room seems to lack the need to save energy?

It’s looking for food or a mate. It hasn’t established an orbit around the center of the room, it’s following the walls and doesn’t have the ability to realize it’s going in circles.

Moths circling flames are most likely confused due to the unnatural phenomenon of a light at night which isn’t the far away moon. Research have shown that they probably use the moon as a reference point for straight flight, and when there’s a close in light at night they end up trapped in circles.

Well it doesn’t lack the need to save energy, if nothing happens to break its futile search pattern it’ll die.

Many are - but there are conspicuous exceptions. One good example would be hummingbirds contending for access to a good bunch of flowers (or a feeder) - or conducting their mating display.

The general point is that saving energy is only a means to an end: successful reproduction. When energy is available and expending lots of it does a better job of this, it will be selected for.

The organism that doesn’t expend energy for reproduction will quickly go extinct, and I believe that’s what these flies are doing, looking for a mate. So from evolution we can say it’s not a waste of energy, rather it’s the purpose of the energy.

The fly is conducting search patterns looking for a way out of the trap it is caught in. It needs food and water within a certain amount of time and there is none where it is. Flies are not too bright but they know that expending energy now to get out of the trap is better than just sitting still and dying.

This is a fundamental misapprehension that I’ve seen repeated here and elsewhere, to wit that evolution is underscored by some kind of an optimizing principle for efficiency in body plan or resource use. In fact there exists no such principle, and life is fundamentally a non-equilibrium thermodynamic (NET) system which moderates the flow of energy so as to reproduce itself and perform whatever activities contribute to that goal. Some animals do conserve energy and us it sparingly, but this is only typical in situations where resources are scarce or competition for those resources are fierce. Some classes of animal, such as the Aves, are often prodigious in their caloric consumption and energy use. Natural selection, as a process, has no use for parsimony per se; only for evolving and incrementally improving useful capabilities based upon the existing planform, hence why monkeys have prehensile tails as an additional manipulative limb while us poor great apes have given up two of our limbs to upright locomotion, leaving us with a paltry two hands even though four or more would be useful. Natural selection favors successful reproduction in whatever for, regardless of notional efficiency.

Stranger

Fly’s irrational pattern is to foremost hunt down smells it detects, gradually tracking it down. they also establish a territory by patrolling it. They find mates by chemical trails similar to how they track down food sources and finally and also do it to prevent being chased and eaten by predators.
Mature flies live for upwards of 25~ days at best. Flies also use less nutrients when near warm areas such as a light bulb. Flies have 4 wings, 2 reduced wings called halteres to balance during flight. Damaged halteres is why you may see them flopping about.
Flies can respond within 100 ms and have no blind spots hence why you can’t sneak up on a fly. Flies don’t run out of energy until they die. Every movement of a fly is actually a pattern responding to stimuli, it’s not really random.