# Making Programs Faster > Eleventh graders learn how programmers make slow code faster — not by guessing, but by measuring to find the bottleneck, optimizing that part, and measuring… **Computer Science** | **Grade 11** *A free lesson plan from K12 Academics. Source page: https://lessonplans.k12academics.com/k12-lesson-g11-cs-efficiency.html* Eleventh graders learn how programmers make slow code faster — not by guessing, but by measuring to find the bottleneck, optimizing that part, and measuring again. Efficiency matters as data and users grow. They order the process, then reason about what makes code slow. **Copy link** works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment. ## Everything you need before the bell rings ### Learning Objectives Students will be able to… - Explain **efficiency**. - Find the **bottleneck**. - Measure, then **optimize**. - Think about scale. How do you make a slow program faster — without just guessing? ## Order the Optimization Steps Project this and have students put the steps for speeding up code in order. ## 55 minutes, five moves Tap any phase to open the teacher moves and student actions. ### Hook — Why So Slow? An app lags with lots of data — where do you even start? #### 👩‍🏫 Teacher Moves - Pose the question. - Share ideas. - Set the goal. #### 🎒 Student Actions - Think. - Share. - Get ready. ### Use — Program Efficiency Students learn. #### 👩‍🏫 Teacher Moves - Send students to Order the Optimization Steps. - Order the steps. - Note measure before optimizing. #### 🎒 Student Actions - Order. - Say. - Note it. ### Modify — Trace It Students practice. #### 👩‍🏫 Teacher Moves - Say why we measure first. - Define a bottleneck. - Name a way code gets slow. #### 🎒 Student Actions - Say. - Define. - Name. ### Create — Reason It Students apply. #### 👩‍🏫 Teacher Moves - Pick a slow task. - Guess its bottleneck. - Suggest a faster approach. #### 🎒 Student Actions - Pick. - Guess. - Suggest. ### Reflect — Reflect Students close. #### 👩‍🏫 Teacher Moves - Say the first step. - Define a bottleneck. - Complete the exit ticket. #### 🎒 Student Actions - Say it. - Say it. - Complete the exit ticket. ## Built to the standards you report on Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students. Evaluate algorithms for efficiency and correctness. Evaluate and refine solutions for performance. Use and adapt algorithms for a problem. Reason about efficiency and scale. ## One lesson, every learner ### Multilingual Learners - Optimization-step cards. - Frame: "first measure, then ___." - Use a slow-vs-fast example. ### Support & Access - Use 3 core steps. - Use a visual. - One concrete example. ### Stretch & Extend - Compare two algorithms’ speed. - Intro Big-O notation. - Profile a real program. ### What to gather - 📽️Screen / board - ⚡Optimization cards - 💻Order the Optimization Steps - 📊Timing sheet - 📓Notebooks - 🎫Exit-ticket slips ### Key terms - **efficiency**: how well a program uses time/space - **bottleneck**: the slowest part - **optimize**: make faster or leaner - **measure**: time how long it takes - **profile**: find where time is spent - **scale**: handle more data/users - **algorithm**: a step-by-step method - **performance**: how fast it runs ## Exit Ticket Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students. ### Reflect: making programs faster. Have students pick a slow task and suggest a faster approach. A printable timing sheet is in the CS library. ## Check your understanding **1. What does “efficiency” mean?** - handle more data/users - the slowest part - how fast it runs - how well a program uses time/space *(correct)* “efficiency” means: how well a program uses time/space **2. Which word means: “the slowest part”?** - profile - efficiency - bottleneck *(correct)* - measure “bottleneck” means: the slowest part **3. What does “optimize” mean?** - the slowest part - how well a program uses time/space - make faster or leaner *(correct)* - how fast it runs “optimize” means: make faster or leaner **4. Which word means: “time how long it takes”?** - performance - optimize - measure *(correct)* - bottleneck “measure” means: time how long it takes **5. What does “profile” mean?** - time how long it takes - find where time is spent *(correct)* - handle more data/users - a step-by-step method “profile” means: find where time is spent **6. Which word means: “handle more data/users”?** - scale *(correct)* - bottleneck - optimize - algorithm “scale” means: handle more data/users ## Printable worksheet --- Full lesson page: https://lessonplans.k12academics.com/k12-lesson-g11-cs-efficiency.html All lessons: https://lessonplans.k12academics.com/