Very interesting question, and very hard to answer :) (/edit: wow, it became a bit longer than expected ..)
In fact, the final solution wasn't really planned before the war. For example, jews were pressured to emigrate, the madagascar plan was investigated, they were to be living in some other place but not to be completely exterminated. So waiting to do something that you hadn't really planned in the first place is not an option :) Please note, I am not trying to say it didn't happen or wasn't approved by regime leadership at all (!!!).
In the beginning, around 1939-41, when the 'Einsatzgruppen' followed the Wehrmacht into Polish/Balkan/Russian territory, they had orders to 'fight bolshewism' and partisans. For them, it was allowed to exterminate any security threat, which can, in nazi ideology, be a whole group of people, so they started executing Jews, Sinti, Roma, ...
They were seen as security threat that needed to be limited as much as possible. It was up to the commanders in the field how they dealt with such things.
For German historians, there are then two narratives for the final escalation of the holocaust. The first one is the 'depression theory', basically saying that the leaders of the regime knew they were gonna loose the war, but saw the possibility to achieve one of their social darwinistic goals (cleaning Europe of Jews, Sinti, Roma, ..). The other, and in my opinion better theory is the 'euphoria theory', saying that regime leaders deemed it unthinkable that the war could be lost, it was just a matter of time (that was 1940-1941) Therefore investing resources for limiting the 'security threat' that was a whole people (and many others) seemed no problem. And obviously, the shift from shooting every person to gassing them in gas chambers in a industrialized system is an attempt to limit resource consumption of the holocaust. However, the logistical resources (train waggons, food supplies, ..) indeed had an impact and contradicted efforts to maximize war efficiency.
It is very important to notice that the holocaust included a multitude of German agencies and leaders, who were alll in competition for more competences at all times. You can't really say "the nazis" expended so many resources, at it was rather a multitude of factors and different targets and aims that ended up with the illogical extermination of millions.
For example, there was an interest in killing all detainees (by SS, RSHA, ...) and there was an interest in keeping them as a workforce (by the Industry for example) - this contradiction results in extremely inhuman treatment (no food, no hygiene standards, abuse, torture, medical experiments, beating workers, killing the ones that were too weak) and extremely inefficient slave work (high death rates, no time to learn the job, no capability for hard work due to bad condition).
Of course, later-on, when it became clearer that the war isn't going to be won all that easy, efforts to increase work productivity among the prisoners grew (but were limited by corruption within the camp system and many other factors). At the same time, the pressure to ged rid of prisoners that can't work (kids, elderly, ..) grew with limited resources (not that prisoners/workslaves ever received proper food or anything..). Germany was not self-sufficient, the conquered territories needed to be exploited, the Hunger Plan caused 4.2 Million soviet citizens to starve as the Wehrmacht had to live off the russian soil^1. The POW and detainee workforce was required in order to free German workers to become soldiers (interesting fact: In the beginning of the war, ammo and arms production dropped signifcantly with each offensive, as additional soldiers had been drafted to become soldiers and were sent back to the factories later (case Poland, France,..)^2
In the end, Himmler also tried to keep jewish detainees as leverage for negotiations with the allies, and the millions of slave workers in german farms and factories were seen as becoming more and more of a threat as the allied offenses came closer, resulting in more violent crackdown.
To sum up, the extermination of the jews started with individual actions, then developed insitutionally and finalized in the extermiiation camps (Treblinka, Sobibor, Chelmo, Belzec, Birkenau, ..) and work camps (Auschwitz, Dachau, Mittelbau-Dora, ...) built between 1941/1942.
(Sorry, probably a bad translation of German source).
I know this isn't very clear, but there are many reasons why the 'final solution' happened as it happened in the Nazi polycracy. If you want to read a great novel about it, I recommend The Kindly Ones by Jonathan Littell.
If you are interested in how the regime reacted near its end, also regarding the imprisoned population, jews and POWs, have a look at Ian Kershaw - The End: Hitler's Germany 1944-45, (Allen Lane, 2011).
More about Nazi Germany as a polycracy and the Holocaust not being a thing that was thoroughly planned and executed from the beginning, read up (in German):
Hans Mommsen: Die Realisierung des Utopischen. Die „Endlösung der Judenfrage“ im Dritten Reich. 1983
(Hans Mommsen: Realizing the Utopic: The "Final Solution".)
Uwe Dietrich Adam: Judenpolitik im Dritten Reich. Düsseldorf 1972
(Uwe Dietrich Adam: Policy regarding Jews in the Third Reich)
Martin Broszat: Soziale Motivation und Führer-Bindung des Nationalsozialismus. In: Vierteljahrshefte für Zeitgeschichte (Martin Broszat: Social motivation and binding to the fuhrer in national socialism)
Timothy Snyder: Bloodlands: Europe between Hitler and Stalin. Basic Books, New York 2010, p. 411.
Adam Tooze: The Wages of Destruction: The Making and Breaking of the Nazi Economy, London: Allen Lane, 2006
(^) showing greatly how Germany could either start a war or stop producing weapons)
The Holocaust did not just involve killing all the Jews possible as fast as possible. There were concentration camps that were essentially "death camps" where prisoners were specifically sent to die, but most of the camps had large war production facilities, or were near such facilities. Jews and other prisoners would be used in these factories as forced slave labor and usually worked until they were useless. That is usually when they would be gotten rid of. Auchwitz literally had a sign over the gates that said "Work will set you free". MILLIONS went through this process.
So basically the Nazi's got a net gain on war time labor out if it.
This site has a list of several dozen companies from that era that employed this forced labor as well as some of the modern incarnations of those companies: http://www.jewishvirtuallibrary.org/jsource/Holocaust/germancos.html
It was only towards the end of the war when the Nazi's really started to kick the killing into high gear.