A wizard requires 10 minutes of prep time per spell level to memorize a spell.
How long would it take for a 20th level wizard to prep his entire spell allotment?
10×(5×1+5×2+5×3+5×4+5×5+4×6+3×7+3×8+2×9) = 1620 minutes, or about 27 hours. Neither Mordenkainen's Lucubration nor Rary's Mnemonic Enhancer are of any help in this matter unless obtained via the application of the Enchant an Item and Permanency spells (a wise investment of possible Constitution loss if allowed), in which case the latter spell can reduce the spell prep time to a single segment for all spells of 5th level and less, which results in a preparation time of 14 hours and 37 and a half minutes.