Optimizing Code with Generative AI Case Study
Follow one slow Python program, a race-results script that creeps from a blink to half a second as the entry list grows, through measuring, briefing an AI assistant, catching its slips and measuring again with timeit and cProfile.
- Intermediate level
- 2 modules
- 3 lessons
- 16 quiz questions
Syllabus
01Measure Before You AskMeet the slow results script of a volunteer running club, write down what it must keep doing, then time it and profile it so the assistant gets facts instead of a hunch.1 lesson
02Optimize with an AssistantWrite a brief the assistant can act on, read its drafts against what you know about Python's data structures, catch the slips, then measure the result and decide when to stop.2 lessons