[{"data":1,"prerenderedAt":7845},["ShallowReactive",2],{"tutorials-python-how-to":3,"category-items-python-how-to":600,"content-/python-how-to/optimize-performance":601},[4,22,31,40,49,58,67,76,86,94,103,112,121,130,139,148,158,167,176,185,194,203,212,222,231,240,249,258,267,276,285,297,306,315,324,333,342,351,362,371,380,389,398,407,418,427,436,445,454,463,472,483,492,501,510,519,528,539,548,557,566,575,584,593],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"slug":11,"order":12,"isParent":13,"icon":14,"_type":15,"_id":16,"_source":17,"_file":18,"_stem":19,"_extension":20,"children":21,"expanded":13},"/python-how-to/string-manipulation","python-how-to",false,"","String Manipulation","Learn essential string manipulation techniques in Python","string-manipulation",1,true,"pi pi-folder","markdown","content:python-how-to:1.string-manipulation.md","content","python-how-to/1.string-manipulation.md","python-how-to/1.string-manipulation","md",[22,31,40,49,58,67],{"_path":23,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":24,"description":25,"slug":26,"parentId":5,"order":27,"_type":15,"_id":28,"_source":17,"_file":29,"_stem":30,"_extension":20},"/python-how-to/split-join-strings","Split and Join Strings","Learn how to split strings into lists and join lists back into strings in Python","split-join-strings",2,"content:python-how-to:2.split-join-strings.md","python-how-to/2.split-join-strings.md","python-how-to/2.split-join-strings",{"_path":32,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":33,"description":34,"slug":35,"parentId":5,"order":36,"_type":15,"_id":37,"_source":17,"_file":38,"_stem":39,"_extension":20},"/python-how-to/remove-whitespace","Remove Whitespace","Learn how to clean up and remove unwanted whitespace from strings in Python","remove-whitespace",3,"content:python-how-to:3.remove-whitespace.md","python-how-to/3.remove-whitespace.md","python-how-to/3.remove-whitespace",{"_path":41,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":42,"description":43,"slug":44,"parentId":5,"order":45,"_type":15,"_id":46,"_source":17,"_file":47,"_stem":48,"_extension":20},"/python-how-to/find-replace-text","Find and Replace Text","Learn how to search for and replace text within strings in Python","find-replace-text",4,"content:python-how-to:4.find-replace-text.md","python-how-to/4.find-replace-text.md","python-how-to/4.find-replace-text",{"_path":50,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":51,"description":52,"slug":53,"parentId":5,"order":54,"_type":15,"_id":55,"_source":17,"_file":56,"_stem":57,"_extension":20},"/python-how-to/check-string-content","Check String Content","Learn how to validate and check the content of strings in Python","check-string-content",5,"content:python-how-to:5.check-string-content.md","python-how-to/5.check-string-content.md","python-how-to/5.check-string-content",{"_path":59,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":60,"description":61,"slug":62,"parentId":5,"order":63,"_type":15,"_id":64,"_source":17,"_file":65,"_stem":66,"_extension":20},"/python-how-to/format-strings","Format Strings","Learn how to format strings in Python using f-strings and format() method","format-strings",6,"content:python-how-to:6.format-strings.md","python-how-to/6.format-strings.md","python-how-to/6.format-strings",{"_path":68,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":69,"description":70,"slug":71,"parentId":5,"order":72,"_type":15,"_id":73,"_source":17,"_file":74,"_stem":75,"_extension":20},"/python-how-to/unicode-special-chars","Handle Unicode and Special Characters","Learn how to work with Unicode and special characters in Python strings","unicode-special-chars",7,"content:python-how-to:7.unicode-special-chars.md","python-how-to/7.unicode-special-chars.md","python-how-to/7.unicode-special-chars",{"_path":77,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":78,"description":79,"slug":80,"order":81,"isParent":13,"icon":14,"_type":15,"_id":82,"_source":17,"_file":83,"_stem":84,"_extension":20,"children":85,"expanded":13},"/python-how-to/list-operations","List Operations","Learn essential operations for working with lists in Python","list-operations",8,"content:python-how-to:8.list-operations.md","python-how-to/8.list-operations.md","python-how-to/8.list-operations",[86,94,103,112,121,130,139],{"_path":87,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":88,"description":89,"slug":90,"parentId":77,"order":81,"_type":15,"_id":91,"_source":17,"_file":92,"_stem":93,"_extension":20},"/python-how-to/sort-lists","Sort Lists","Learn how to sort lists in Python using different methods and custom sorting","sort-lists","content:python-how-to:9.sort-lists.md","python-how-to/9.sort-lists.md","python-how-to/9.sort-lists",{"_path":95,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":96,"description":97,"slug":98,"parentId":77,"order":99,"_type":15,"_id":100,"_source":17,"_file":101,"_stem":102,"_extension":20},"/python-how-to/remove-duplicates","Remove Duplicates","Learn how to remove duplicate elements from lists in Python","remove-duplicates",10,"content:python-how-to:10.remove-duplicates.md","python-how-to/10.remove-duplicates.md","python-how-to/10.remove-duplicates",{"_path":104,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":105,"description":106,"slug":107,"parentId":77,"order":108,"_type":15,"_id":109,"_source":17,"_file":110,"_stem":111,"_extension":20},"/python-how-to/filter-lists","Filter Lists","Learn how to filter lists in Python using different methods","filter-lists",11,"content:python-how-to:11.filter-lists.md","python-how-to/11.filter-lists.md","python-how-to/11.filter-lists",{"_path":113,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":114,"description":115,"slug":116,"parentId":77,"order":117,"_type":15,"_id":118,"_source":17,"_file":119,"_stem":120,"_extension":20},"/python-how-to/combine-lists","Combine Lists","Learn different methods to combine lists in Python","combine-lists",12,"content:python-how-to:12.combine-lists.md","python-how-to/12.combine-lists.md","python-how-to/12.combine-lists",{"_path":122,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":123,"description":124,"slug":125,"parentId":77,"order":126,"_type":15,"_id":127,"_source":17,"_file":128,"_stem":129,"_extension":20},"/python-how-to/list-comprehensions","Use List Comprehensions","Learn how to create and transform lists efficiently using Python's list comprehension syntax","list-comprehensions",13,"content:python-how-to:13.list-comprehensions.md","python-how-to/13.list-comprehensions.md","python-how-to/13.list-comprehensions",{"_path":131,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":132,"description":133,"slug":134,"parentId":77,"order":135,"_type":15,"_id":136,"_source":17,"_file":137,"_stem":138,"_extension":20},"/python-how-to/nested-lists","Work with Nested Lists","Learn how to work with nested lists (2D arrays) in Python","nested-lists",14,"content:python-how-to:14.nested-lists.md","python-how-to/14.nested-lists.md","python-how-to/14.nested-lists",{"_path":140,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":141,"description":142,"slug":143,"parentId":77,"order":144,"_type":15,"_id":145,"_source":17,"_file":146,"_stem":147,"_extension":20},"/python-how-to/enumerate-zip","Use enumerate() and zip()","Learn how to use enumerate() and zip() for efficient iteration in Python","enumerate-zip",15,"content:python-how-to:15.enumerate-zip.md","python-how-to/15.enumerate-zip.md","python-how-to/15.enumerate-zip",{"_path":149,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":150,"description":151,"slug":152,"order":153,"isParent":13,"icon":14,"_type":15,"_id":154,"_source":17,"_file":155,"_stem":156,"_extension":20,"children":157,"expanded":13},"/python-how-to/dictionary-operations","Dictionary Operations","Learn essential operations for working with dictionaries in Python","dictionary-operations",16,"content:python-how-to:16.dictionary-operations.md","python-how-to/16.dictionary-operations.md","python-how-to/16.dictionary-operations",[158,167,176,185,194,203],{"_path":159,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":160,"description":161,"slug":162,"parentId":149,"order":163,"_type":15,"_id":164,"_source":17,"_file":165,"_stem":166,"_extension":20},"/python-how-to/merge-dictionaries","Merge Dictionaries","Learn different methods to merge dictionaries in Python","merge-dictionaries",17,"content:python-how-to:17.merge-dictionaries.md","python-how-to/17.merge-dictionaries.md","python-how-to/17.merge-dictionaries",{"_path":168,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":169,"description":170,"slug":171,"parentId":149,"order":172,"_type":15,"_id":173,"_source":17,"_file":174,"_stem":175,"_extension":20},"/python-how-to/sort-dictionaries","Sort Dictionaries","Learn how to sort dictionaries by keys or values in Python","sort-dictionaries",18,"content:python-how-to:18.sort-dictionaries.md","python-how-to/18.sort-dictionaries.md","python-how-to/18.sort-dictionaries",{"_path":177,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":178,"description":179,"slug":180,"parentId":149,"order":181,"_type":15,"_id":182,"_source":17,"_file":183,"_stem":184,"_extension":20},"/python-how-to/filter-dictionaries","Filter Dictionaries","Learn how to filter dictionaries based on keys or values in Python","filter-dictionaries",19,"content:python-how-to:19.filter-dictionaries.md","python-how-to/19.filter-dictionaries.md","python-how-to/19.filter-dictionaries",{"_path":186,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":187,"description":188,"slug":189,"parentId":149,"order":190,"_type":15,"_id":191,"_source":17,"_file":192,"_stem":193,"_extension":20},"/python-how-to/handle-missing-keys","Handle Missing Keys","Learn safe ways to access dictionary keys and handle missing values","handle-missing-keys",20,"content:python-how-to:20.handle-missing-keys.md","python-how-to/20.handle-missing-keys.md","python-how-to/20.handle-missing-keys",{"_path":195,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":196,"description":197,"slug":198,"parentId":149,"order":199,"_type":15,"_id":200,"_source":17,"_file":201,"_stem":202,"_extension":20},"/python-how-to/dictionary-comprehensions","Use Dictionary Comprehensions","Learn how to create dictionaries efficiently using comprehensions","dictionary-comprehensions",21,"content:python-how-to:21.dictionary-comprehensions.md","python-how-to/21.dictionary-comprehensions.md","python-how-to/21.dictionary-comprehensions",{"_path":204,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":205,"description":206,"slug":207,"parentId":149,"order":208,"_type":15,"_id":209,"_source":17,"_file":210,"_stem":211,"_extension":20},"/python-how-to/convert-lists-dictionaries","Convert Between Lists and Dictionaries","Learn how to transform data between lists and dictionaries in Python","convert-lists-dictionaries",22,"content:python-how-to:22.convert-lists-dictionaries.md","python-how-to/22.convert-lists-dictionaries.md","python-how-to/22.convert-lists-dictionaries",{"_path":213,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":214,"description":215,"slug":216,"order":217,"isParent":13,"icon":14,"_type":15,"_id":218,"_source":17,"_file":219,"_stem":220,"_extension":20,"children":221,"expanded":13},"/python-how-to/file-operations","File Operations","Learn essential file operations in Python for reading, writing, and managing files","file-operations",23,"content:python-how-to:23.file-operations.md","python-how-to/23.file-operations.md","python-how-to/23.file-operations",[222,231,240,249,258,267,276],{"_path":223,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":224,"description":225,"slug":226,"parentId":213,"order":227,"_type":15,"_id":228,"_source":17,"_file":229,"_stem":230,"_extension":20},"/python-how-to/read-text-files","Read Text Files","Learn how to read text files in Python using different methods","read-text-files",24,"content:python-how-to:24.read-text-files.md","python-how-to/24.read-text-files.md","python-how-to/24.read-text-files",{"_path":232,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":233,"description":234,"slug":235,"parentId":213,"order":236,"_type":15,"_id":237,"_source":17,"_file":238,"_stem":239,"_extension":20},"/python-how-to/write-to-files","Write to Files","Learn how to write and create files in Python using different methods","write-to-files",25,"content:python-how-to:25.write-to-files.md","python-how-to/25.write-to-files.md","python-how-to/25.write-to-files",{"_path":241,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":242,"description":243,"slug":244,"parentId":213,"order":245,"_type":15,"_id":246,"_source":17,"_file":247,"_stem":248,"_extension":20},"/python-how-to/work-csv-files","Work with CSV Files","Learn how to read and write CSV files in Python using the csv module","work-csv-files",26,"content:python-how-to:26.work-csv-files.md","python-how-to/26.work-csv-files.md","python-how-to/26.work-csv-files",{"_path":250,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":251,"description":252,"slug":253,"parentId":213,"order":254,"_type":15,"_id":255,"_source":17,"_file":256,"_stem":257,"_extension":20},"/python-how-to/handle-file-paths","Handle File Paths","Learn how to work with file and directory paths in Python using pathlib and os modules","handle-file-paths",27,"content:python-how-to:27.handle-file-paths.md","python-how-to/27.handle-file-paths.md","python-how-to/27.handle-file-paths",{"_path":259,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":260,"description":261,"slug":262,"parentId":213,"order":263,"_type":15,"_id":264,"_source":17,"_file":265,"_stem":266,"_extension":20},"/python-how-to/work-json-files","Work with JSON Files","Learn how to read and write JSON files in Python using the json module","work-json-files",28,"content:python-how-to:28.work-json-files.md","python-how-to/28.work-json-files.md","python-how-to/28.work-json-files",{"_path":268,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":269,"description":270,"slug":271,"parentId":213,"order":272,"_type":15,"_id":273,"_source":17,"_file":274,"_stem":275,"_extension":20},"/python-how-to/handle-binary-files","Handle Binary Files","Learn how to work with binary files in Python for images, data, and other non-text content","handle-binary-files",29,"content:python-how-to:29.handle-binary-files.md","python-how-to/29.handle-binary-files.md","python-how-to/29.handle-binary-files",{"_path":277,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":278,"description":279,"slug":280,"parentId":213,"order":281,"_type":15,"_id":282,"_source":17,"_file":283,"_stem":284,"_extension":20},"/python-how-to/use-context-managers","Use Context Managers","Learn how to use context managers for safe resource handling in Python","use-context-managers",30,"content:python-how-to:30.use-context-managers.md","python-how-to/30.use-context-managers.md","python-how-to/30.use-context-managers",{"_path":286,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":287,"description":288,"slug":289,"parentId":290,"order":291,"isParent":13,"icon":292,"_type":15,"_id":293,"_source":17,"_file":294,"_stem":295,"_extension":20,"children":296,"expanded":13},"/python-how-to/date-and-time","Date and Time","Master Python's date and time handling with datetime, time zones, formatting, and calculations","date-and-time","/python-how-to",31,"pi pi-calendar","content:python-how-to:31.date-and-time.md","python-how-to/31.date-and-time.md","python-how-to/31.date-and-time",[297,306,315,324,333,342],{"_path":298,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":299,"description":300,"slug":301,"parentId":286,"order":302,"_type":15,"_id":303,"_source":17,"_file":304,"_stem":305,"_extension":20},"/python-how-to/get-current-datetime","Get Current Date/Time","Learn how to get current date, time, and timestamps using Python's datetime module","get-current-datetime",32,"content:python-how-to:32.get-current-datetime.md","python-how-to/32.get-current-datetime.md","python-how-to/32.get-current-datetime",{"_path":307,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":308,"description":309,"slug":310,"parentId":286,"order":311,"_type":15,"_id":312,"_source":17,"_file":313,"_stem":314,"_extension":20},"/python-how-to/format-dates","Format Dates","Master date formatting with strftime, custom formats, and locale-aware formatting for user-friendly displays","format-dates",33,"content:python-how-to:33.format-dates.md","python-how-to/33.format-dates.md","python-how-to/33.format-dates",{"_path":316,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":317,"description":318,"slug":319,"parentId":286,"order":320,"_type":15,"_id":321,"_source":17,"_file":322,"_stem":323,"_extension":20},"/python-how-to/calculate-date-differences","Calculate Date Differences","Learn to calculate time differences, durations, and intervals using Python's timedelta for scheduling and analytics","calculate-date-differences",34,"content:python-how-to:34.calculate-date-differences.md","python-how-to/34.calculate-date-differences.md","python-how-to/34.calculate-date-differences",{"_path":325,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":326,"description":327,"slug":328,"parentId":286,"order":329,"_type":15,"_id":330,"_source":17,"_file":331,"_stem":332,"_extension":20},"/python-how-to/parse-date-strings","Parse Date Strings","Convert text dates into Python datetime objects using strptime, handle multiple formats, and validate date input","parse-date-strings",35,"content:python-how-to:35.parse-date-strings.md","python-how-to/35.parse-date-strings.md","python-how-to/35.parse-date-strings",{"_path":334,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":335,"description":336,"slug":337,"parentId":286,"order":338,"_type":15,"_id":339,"_source":17,"_file":340,"_stem":341,"_extension":20},"/python-how-to/handle-timezones","Handle Timezones","Master timezone handling with zoneinfo, UTC conversions, and timezone-aware datetime objects for global applications","handle-timezones",36,"content:python-how-to:36.handle-timezones.md","python-how-to/36.handle-timezones.md","python-how-to/36.handle-timezones",{"_path":343,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":344,"description":345,"slug":346,"parentId":286,"order":347,"_type":15,"_id":348,"_source":17,"_file":349,"_stem":350,"_extension":20},"/python-how-to/work-with-timestamps","Work with Timestamps","Master Unix timestamps in Python - convert between datetime objects and timestamps for APIs, databases, and system integration","work-with-timestamps",37,"content:python-how-to:37.work-with-timestamps.md","python-how-to/37.work-with-timestamps.md","python-how-to/37.work-with-timestamps",{"_path":352,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":353,"description":354,"slug":355,"parentId":290,"order":356,"isParent":13,"icon":357,"_type":15,"_id":358,"_source":17,"_file":359,"_stem":360,"_extension":20,"children":361,"expanded":13},"/python-how-to/error-handling","Error Handling","Learn Python's error handling with try/except, custom exceptions, debugging, logging, and retry logic for robust applications","error-handling",38,"pi pi-exclamation-triangle","content:python-how-to:38.error-handling.md","python-how-to/38.error-handling.md","python-how-to/38.error-handling",[362,371,380,389,398],{"_path":363,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":364,"description":365,"slug":366,"parentId":352,"order":367,"_type":15,"_id":368,"_source":17,"_file":369,"_stem":370,"_extension":20},"/python-how-to/handle-exceptions","Handle Exceptions","Master try/except blocks, multiple exception handling, and finally clauses for robust error handling in Python","handle-exceptions",39,"content:python-how-to:39.handle-exceptions.md","python-how-to/39.handle-exceptions.md","python-how-to/39.handle-exceptions",{"_path":372,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":373,"description":374,"slug":375,"parentId":352,"order":376,"_type":15,"_id":377,"_source":17,"_file":378,"_stem":379,"_extension":20},"/python-how-to/create-custom-exceptions","Create Custom Exceptions","Learn to create custom exception classes in Python for specific error handling and better code organization","create-custom-exceptions",40,"content:python-how-to:40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions",{"_path":381,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":382,"description":383,"slug":384,"parentId":352,"order":385,"_type":15,"_id":386,"_source":17,"_file":387,"_stem":388,"_extension":20},"/python-how-to/debug-code","Debug Code","Learn Python debugging techniques using print statements, the debugger, and tools to find and fix code issues","debug-code",41,"content:python-how-to:41.debug-code.md","python-how-to/41.debug-code.md","python-how-to/41.debug-code",{"_path":390,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":391,"description":392,"slug":393,"parentId":352,"order":394,"_type":15,"_id":395,"_source":17,"_file":396,"_stem":397,"_extension":20},"/python-how-to/use-logging","Use Logging","Learn Python's logging module for tracking application behavior, errors, and debugging information","use-logging",42,"content:python-how-to:42.use-logging.md","python-how-to/42.use-logging.md","python-how-to/42.use-logging",{"_path":399,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":400,"description":401,"slug":402,"parentId":352,"order":403,"_type":15,"_id":404,"_source":17,"_file":405,"_stem":406,"_extension":20},"/python-how-to/implement-retry-logic","Implement Retry Logic","Learn to implement retry mechanisms in Python for handling temporary failures and building resilient applications","implement-retry-logic",43,"content:python-how-to:43.implement-retry-logic.md","python-how-to/43.implement-retry-logic.md","python-how-to/43.implement-retry-logic",{"_path":408,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":409,"description":410,"slug":411,"parentId":290,"order":412,"isParent":13,"icon":413,"_type":15,"_id":414,"_source":17,"_file":415,"_stem":416,"_extension":20,"children":417,"expanded":13},"/python-how-to/functions-and-modules","Functions and Modules","Learn Python functions, modules, and code organization for building reusable, maintainable applications","functions-and-modules",44,"pi pi-box","content:python-how-to:44.functions-and-modules.md","python-how-to/44.functions-and-modules.md","python-how-to/44.functions-and-modules",[418,427,436,445,454,463],{"_path":419,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":420,"description":421,"slug":422,"parentId":408,"order":423,"_type":15,"_id":424,"_source":17,"_file":425,"_stem":426,"_extension":20},"/python-how-to/write-functions","Write Functions","Learn to create Python functions with parameters, return values, and documentation for reusable code","write-functions",45,"content:python-how-to:45.write-functions.md","python-how-to/45.write-functions.md","python-how-to/45.write-functions",{"_path":428,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":429,"description":430,"slug":431,"parentId":408,"order":432,"_type":15,"_id":433,"_source":17,"_file":434,"_stem":435,"_extension":20},"/python-how-to/use-args-kwargs","Use *args and **kwargs","Learn to use *args and **kwargs for flexible function arguments in Python","use-args-kwargs",46,"content:python-how-to:46.use-args-kwargs.md","python-how-to/46.use-args-kwargs.md","python-how-to/46.use-args-kwargs",{"_path":437,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":438,"description":439,"slug":440,"parentId":408,"order":441,"_type":15,"_id":442,"_source":17,"_file":443,"_stem":444,"_extension":20},"/python-how-to/create-decorators","Create Decorators","Learn to create and use Python decorators to enhance function behavior and add functionality","create-decorators",47,"content:python-how-to:47.create-decorators.md","python-how-to/47.create-decorators.md","python-how-to/47.create-decorators",{"_path":446,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":447,"description":448,"slug":449,"parentId":408,"order":450,"_type":15,"_id":451,"_source":17,"_file":452,"_stem":453,"_extension":20},"/python-how-to/use-generators","Use Generators","Learn to create memory-efficient generators with yield for processing large datasets and sequences","use-generators",48,"content:python-how-to:48.use-generators.md","python-how-to/48.use-generators.md","python-how-to/48.use-generators",{"_path":455,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":456,"description":457,"slug":458,"parentId":408,"order":459,"_type":15,"_id":460,"_source":17,"_file":461,"_stem":462,"_extension":20},"/python-how-to/work-modules-packages","Work with Modules and Packages","Learn to organize Python code with modules and packages, and use imports effectively","work-modules-packages",49,"content:python-how-to:49.work-modules-packages.md","python-how-to/49.work-modules-packages.md","python-how-to/49.work-modules-packages",{"_path":464,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":465,"description":466,"slug":467,"parentId":408,"order":468,"_type":15,"_id":469,"_source":17,"_file":470,"_stem":471,"_extension":20},"/python-how-to/create-virtual-environments","Create Virtual Environments","Learn to create and manage Python virtual environments for project dependency isolation","create-virtual-environments",50,"content:python-how-to:50.create-virtual-environments.md","python-how-to/50.create-virtual-environments.md","python-how-to/50.create-virtual-environments",{"_path":473,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":474,"description":475,"slug":476,"parentId":290,"order":477,"isParent":13,"icon":478,"_type":15,"_id":479,"_source":17,"_file":480,"_stem":481,"_extension":20,"children":482,"expanded":13},"/python-how-to/data-processing","Data Processing","Learn Python data processing techniques including regex, APIs, databases, and large file handling","data-processing",51,"pi pi-database","content:python-how-to:51.data-processing.md","python-how-to/51.data-processing.md","python-how-to/51.data-processing",[483,492,501,510,519],{"_path":484,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":485,"description":486,"slug":487,"parentId":473,"order":488,"_type":15,"_id":489,"_source":17,"_file":490,"_stem":491,"_extension":20},"/python-how-to/work-regular-expressions","Work with Regular Expressions","Learn to use Python's re module for pattern matching, text extraction, and data validation","work-regular-expressions",52,"content:python-how-to:52.work-regular-expressions.md","python-how-to/52.work-regular-expressions.md","python-how-to/52.work-regular-expressions",{"_path":493,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":494,"description":495,"slug":496,"parentId":473,"order":497,"_type":15,"_id":498,"_source":17,"_file":499,"_stem":500,"_extension":20},"/python-how-to/parse-xml-html","Parse XML and HTML","Learn to extract data from XML and HTML documents using Python's built-in parsing tools","parse-xml-html",53,"content:python-how-to:53.parse-xml-html.md","python-how-to/53.parse-xml-html.md","python-how-to/53.parse-xml-html",{"_path":502,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":503,"description":504,"slug":505,"parentId":473,"order":506,"_type":15,"_id":507,"_source":17,"_file":508,"_stem":509,"_extension":20},"/python-how-to/handle-api-requests","Handle API Requests","Learn to fetch and process data from web APIs using Python's urllib and external requests library","handle-api-requests",54,"content:python-how-to:54.handle-api-requests.md","python-how-to/54.handle-api-requests.md","python-how-to/54.handle-api-requests",{"_path":511,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":512,"description":513,"slug":514,"parentId":473,"order":515,"_type":15,"_id":516,"_source":17,"_file":517,"_stem":518,"_extension":20},"/python-how-to/work-databases","Work with Databases","Learn to connect to and query SQL databases using Python's sqlite3 and database techniques","work-databases",55,"content:python-how-to:55.work-databases.md","python-how-to/55.work-databases.md","python-how-to/55.work-databases",{"_path":520,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":521,"description":522,"slug":523,"parentId":473,"order":524,"_type":15,"_id":525,"_source":17,"_file":526,"_stem":527,"_extension":20},"/python-how-to/process-large-files","Process Large Files","Learn memory-efficient techniques for handling large files and datasets in Python","process-large-files",56,"content:python-how-to:56.process-large-files.md","python-how-to/56.process-large-files.md","python-how-to/56.process-large-files",{"_path":529,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":530,"description":531,"slug":532,"parentId":290,"order":533,"isParent":13,"icon":534,"_type":15,"_id":535,"_source":17,"_file":536,"_stem":537,"_extension":20,"children":538,"expanded":13},"/python-how-to/best-practices","Best Practices","Learn Python best practices for writing clean, maintainable, and efficient code","best-practices",57,"pi pi-star","content:python-how-to:57.best-practices.md","python-how-to/57.best-practices.md","python-how-to/57.best-practices",[539,548,557,566,575,584],{"_path":540,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":541,"description":542,"slug":543,"parentId":529,"order":544,"_type":15,"_id":545,"_source":17,"_file":546,"_stem":547,"_extension":20},"/python-how-to/structure-code","Structure Your Code","Learn to organize Python code with proper module structure, functions, and classes","structure-code",58,"content:python-how-to:58.structure-code.md","python-how-to/58.structure-code.md","python-how-to/58.structure-code",{"_path":549,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":550,"description":551,"slug":552,"parentId":529,"order":553,"_type":15,"_id":554,"_source":17,"_file":555,"_stem":556,"_extension":20},"/python-how-to/write-clean-code","Write Clean Code","Learn to write readable, maintainable Python code with proper naming, comments, and clear logic","write-clean-code",59,"content:python-how-to:59.write-clean-code.md","python-how-to/59.write-clean-code.md","python-how-to/59.write-clean-code",{"_path":558,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":559,"description":560,"slug":561,"parentId":529,"order":562,"_type":15,"_id":563,"_source":17,"_file":564,"_stem":565,"_extension":20},"/python-how-to/optimize-performance","Optimize Performance","Learn to identify and fix performance bottlenecks in Python code for faster execution","optimize-performance",60,"content:python-how-to:60.optimize-performance.md","python-how-to/60.optimize-performance.md","python-how-to/60.optimize-performance",{"_path":567,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":568,"description":569,"slug":570,"parentId":529,"order":571,"_type":15,"_id":572,"_source":17,"_file":573,"_stem":574,"_extension":20},"/python-how-to/write-unit-tests","Write Unit Tests","Learn to create reliable unit tests to verify your Python code works correctly and catch bugs early","write-unit-tests",61,"content:python-how-to:61.write-unit-tests.md","python-how-to/61.write-unit-tests.md","python-how-to/61.write-unit-tests",{"_path":576,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":577,"description":578,"slug":579,"parentId":529,"order":580,"_type":15,"_id":581,"_source":17,"_file":582,"_stem":583,"_extension":20},"/python-how-to/document-code","Document Your Code","Learn to write clear documentation and helpful comments for your Python code","document-code",62,"content:python-how-to:62.document-code.md","python-how-to/62.document-code.md","python-how-to/62.document-code",{"_path":585,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":586,"description":587,"slug":588,"parentId":529,"order":589,"_type":15,"_id":590,"_source":17,"_file":591,"_stem":592,"_extension":20},"/python-how-to/use-type-hints","Use Type Hints","Learn to add type annotations to Python code for better clarity, tooling support, and error detection","use-type-hints",63,"content:python-how-to:63.use-type-hints.md","python-how-to/63.use-type-hints.md","python-how-to/63.use-type-hints",{"_path":290,"_dir":8,"_draft":7,"_partial":7,"_locale":8,"title":594,"description":595,"slug":6,"order":596,"icon":14,"_type":15,"_id":597,"_source":17,"_file":598,"_stem":599,"_extension":20,"expanded":13},"Python How-To Guide","Practical Python tutorials for common programming tasks. Learn step-by-step solutions for string manipulation, file operations, data processing, and more with real-world examples.",0,"content:python-how-to:index.md","python-how-to/index.md","python-how-to/index",[557],{"_path":558,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":559,"description":560,"slug":561,"parentId":529,"order":562,"body":602,"_type":15,"_id":563,"_source":17,"_file":564,"_stem":565,"_extension":20},{"type":603,"children":604,"toc":7832},"root",[605,613,619,1352,1359,1364,1468,1475,3023,3029,4269,4275,4434,4440,4446,5998,6004,7642,7648,7801,7807,7812,7826],{"type":606,"tag":607,"props":608,"children":609},"element","h1",{"id":561},[610],{"type":611,"value":612},"text","⚡ Optimize Performance",{"type":606,"tag":614,"props":615,"children":616},"p",{},[617],{"type":611,"value":618},"Performance optimization makes your code run faster and use less memory. Good optimization starts with measuring performance, identifying bottlenecks, and applying the right techniques to improve speed and efficiency.",{"type":606,"tag":620,"props":621,"children":622},"code-try",{},[623],{"type":606,"tag":624,"props":625,"children":629},"pre",{"className":626,"code":627,"language":628,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","import time\n\n# Example of performance optimization\n\n# Slow approach - creating new lists repeatedly\ndef slow_sum_squares(numbers):\n    \"\"\"Slow way to calculate sum of squares.\"\"\"\n    result = []\n    for num in numbers:\n        result.append(num * num)\n    \n    total = 0\n    for square in result:\n        total += square\n    \n    return total\n\n# Fast approach - using generator and built-in functions\ndef fast_sum_squares(numbers):\n    \"\"\"Fast way to calculate sum of squares.\"\"\"\n    return sum(num * num for num in numbers)\n\n# Test performance difference\nnumbers = list(range(100000))\n\n# Time the slow version\nstart_time = time.time()\nslow_result = slow_sum_squares(numbers)\nslow_time = time.time() - start_time\n\n# Time the fast version\nstart_time = time.time()\nfast_result = fast_sum_squares(numbers)\nfast_time = time.time() - start_time\n\nprint(f\"Slow version: {slow_time:.4f} seconds\")\nprint(f\"Fast version: {fast_time:.4f} seconds\")\nprint(f\"Speedup: {slow_time / fast_time:.1f}x faster\")\nprint(f\"Results match: {slow_result == fast_result}\")\n","python",[630],{"type":606,"tag":631,"props":632,"children":633},"code",{"__ignoreMap":8},[634,651,659,668,675,683,702,711,729,753,771,779,797,818,836,843,856,863,871,887,895,938,945,953,994,1001,1009,1026,1043,1070,1077,1085,1100,1117,1141,1148,1200,1245,1301],{"type":606,"tag":635,"props":636,"children":638},"span",{"class":637,"line":12},"line",[639,645],{"type":606,"tag":635,"props":640,"children":642},{"style":641},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[643],{"type":611,"value":644},"import",{"type":606,"tag":635,"props":646,"children":648},{"style":647},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[649],{"type":611,"value":650}," time\n",{"type":606,"tag":635,"props":652,"children":653},{"class":637,"line":27},[654],{"type":606,"tag":635,"props":655,"children":656},{"emptyLinePlaceholder":13},[657],{"type":611,"value":658},"\n",{"type":606,"tag":635,"props":660,"children":661},{"class":637,"line":36},[662],{"type":606,"tag":635,"props":663,"children":665},{"style":664},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[666],{"type":611,"value":667},"# Example of performance optimization\n",{"type":606,"tag":635,"props":669,"children":670},{"class":637,"line":45},[671],{"type":606,"tag":635,"props":672,"children":673},{"emptyLinePlaceholder":13},[674],{"type":611,"value":658},{"type":606,"tag":635,"props":676,"children":677},{"class":637,"line":54},[678],{"type":606,"tag":635,"props":679,"children":680},{"style":664},[681],{"type":611,"value":682},"# Slow approach - creating new lists repeatedly\n",{"type":606,"tag":635,"props":684,"children":685},{"class":637,"line":63},[686,691,697],{"type":606,"tag":635,"props":687,"children":688},{"style":641},[689],{"type":611,"value":690},"def",{"type":606,"tag":635,"props":692,"children":694},{"style":693},"--shiki-default:#6F42C1;--shiki-app-dark-mode:#B392F0",[695],{"type":611,"value":696}," slow_sum_squares",{"type":606,"tag":635,"props":698,"children":699},{"style":647},[700],{"type":611,"value":701},"(numbers):\n",{"type":606,"tag":635,"props":703,"children":704},{"class":637,"line":72},[705],{"type":606,"tag":635,"props":706,"children":708},{"style":707},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[709],{"type":611,"value":710},"    \"\"\"Slow way to calculate sum of squares.\"\"\"\n",{"type":606,"tag":635,"props":712,"children":713},{"class":637,"line":81},[714,719,724],{"type":606,"tag":635,"props":715,"children":716},{"style":647},[717],{"type":611,"value":718},"    result ",{"type":606,"tag":635,"props":720,"children":721},{"style":641},[722],{"type":611,"value":723},"=",{"type":606,"tag":635,"props":725,"children":726},{"style":647},[727],{"type":611,"value":728}," []\n",{"type":606,"tag":635,"props":730,"children":732},{"class":637,"line":731},9,[733,738,743,748],{"type":606,"tag":635,"props":734,"children":735},{"style":641},[736],{"type":611,"value":737},"    for",{"type":606,"tag":635,"props":739,"children":740},{"style":647},[741],{"type":611,"value":742}," num ",{"type":606,"tag":635,"props":744,"children":745},{"style":641},[746],{"type":611,"value":747},"in",{"type":606,"tag":635,"props":749,"children":750},{"style":647},[751],{"type":611,"value":752}," numbers:\n",{"type":606,"tag":635,"props":754,"children":755},{"class":637,"line":99},[756,761,766],{"type":606,"tag":635,"props":757,"children":758},{"style":647},[759],{"type":611,"value":760},"        result.append(num ",{"type":606,"tag":635,"props":762,"children":763},{"style":641},[764],{"type":611,"value":765},"*",{"type":606,"tag":635,"props":767,"children":768},{"style":647},[769],{"type":611,"value":770}," num)\n",{"type":606,"tag":635,"props":772,"children":773},{"class":637,"line":108},[774],{"type":606,"tag":635,"props":775,"children":776},{"style":647},[777],{"type":611,"value":778},"    \n",{"type":606,"tag":635,"props":780,"children":781},{"class":637,"line":117},[782,787,791],{"type":606,"tag":635,"props":783,"children":784},{"style":647},[785],{"type":611,"value":786},"    total ",{"type":606,"tag":635,"props":788,"children":789},{"style":641},[790],{"type":611,"value":723},{"type":606,"tag":635,"props":792,"children":794},{"style":793},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[795],{"type":611,"value":796}," 0\n",{"type":606,"tag":635,"props":798,"children":799},{"class":637,"line":126},[800,804,809,813],{"type":606,"tag":635,"props":801,"children":802},{"style":641},[803],{"type":611,"value":737},{"type":606,"tag":635,"props":805,"children":806},{"style":647},[807],{"type":611,"value":808}," square ",{"type":606,"tag":635,"props":810,"children":811},{"style":641},[812],{"type":611,"value":747},{"type":606,"tag":635,"props":814,"children":815},{"style":647},[816],{"type":611,"value":817}," result:\n",{"type":606,"tag":635,"props":819,"children":820},{"class":637,"line":135},[821,826,831],{"type":606,"tag":635,"props":822,"children":823},{"style":647},[824],{"type":611,"value":825},"        total ",{"type":606,"tag":635,"props":827,"children":828},{"style":641},[829],{"type":611,"value":830},"+=",{"type":606,"tag":635,"props":832,"children":833},{"style":647},[834],{"type":611,"value":835}," square\n",{"type":606,"tag":635,"props":837,"children":838},{"class":637,"line":144},[839],{"type":606,"tag":635,"props":840,"children":841},{"style":647},[842],{"type":611,"value":778},{"type":606,"tag":635,"props":844,"children":845},{"class":637,"line":153},[846,851],{"type":606,"tag":635,"props":847,"children":848},{"style":641},[849],{"type":611,"value":850},"    return",{"type":606,"tag":635,"props":852,"children":853},{"style":647},[854],{"type":611,"value":855}," total\n",{"type":606,"tag":635,"props":857,"children":858},{"class":637,"line":163},[859],{"type":606,"tag":635,"props":860,"children":861},{"emptyLinePlaceholder":13},[862],{"type":611,"value":658},{"type":606,"tag":635,"props":864,"children":865},{"class":637,"line":172},[866],{"type":606,"tag":635,"props":867,"children":868},{"style":664},[869],{"type":611,"value":870},"# Fast approach - using generator and built-in functions\n",{"type":606,"tag":635,"props":872,"children":873},{"class":637,"line":181},[874,878,883],{"type":606,"tag":635,"props":875,"children":876},{"style":641},[877],{"type":611,"value":690},{"type":606,"tag":635,"props":879,"children":880},{"style":693},[881],{"type":611,"value":882}," fast_sum_squares",{"type":606,"tag":635,"props":884,"children":885},{"style":647},[886],{"type":611,"value":701},{"type":606,"tag":635,"props":888,"children":889},{"class":637,"line":190},[890],{"type":606,"tag":635,"props":891,"children":892},{"style":707},[893],{"type":611,"value":894},"    \"\"\"Fast way to calculate sum of squares.\"\"\"\n",{"type":606,"tag":635,"props":896,"children":897},{"class":637,"line":199},[898,902,907,912,916,920,925,929,933],{"type":606,"tag":635,"props":899,"children":900},{"style":641},[901],{"type":611,"value":850},{"type":606,"tag":635,"props":903,"children":904},{"style":793},[905],{"type":611,"value":906}," sum",{"type":606,"tag":635,"props":908,"children":909},{"style":647},[910],{"type":611,"value":911},"(num ",{"type":606,"tag":635,"props":913,"children":914},{"style":641},[915],{"type":611,"value":765},{"type":606,"tag":635,"props":917,"children":918},{"style":647},[919],{"type":611,"value":742},{"type":606,"tag":635,"props":921,"children":922},{"style":641},[923],{"type":611,"value":924},"for",{"type":606,"tag":635,"props":926,"children":927},{"style":647},[928],{"type":611,"value":742},{"type":606,"tag":635,"props":930,"children":931},{"style":641},[932],{"type":611,"value":747},{"type":606,"tag":635,"props":934,"children":935},{"style":647},[936],{"type":611,"value":937}," numbers)\n",{"type":606,"tag":635,"props":939,"children":940},{"class":637,"line":208},[941],{"type":606,"tag":635,"props":942,"children":943},{"emptyLinePlaceholder":13},[944],{"type":611,"value":658},{"type":606,"tag":635,"props":946,"children":947},{"class":637,"line":217},[948],{"type":606,"tag":635,"props":949,"children":950},{"style":664},[951],{"type":611,"value":952},"# Test performance difference\n",{"type":606,"tag":635,"props":954,"children":955},{"class":637,"line":227},[956,961,965,970,975,980,984,989],{"type":606,"tag":635,"props":957,"children":958},{"style":647},[959],{"type":611,"value":960},"numbers ",{"type":606,"tag":635,"props":962,"children":963},{"style":641},[964],{"type":611,"value":723},{"type":606,"tag":635,"props":966,"children":967},{"style":793},[968],{"type":611,"value":969}," list",{"type":606,"tag":635,"props":971,"children":972},{"style":647},[973],{"type":611,"value":974},"(",{"type":606,"tag":635,"props":976,"children":977},{"style":793},[978],{"type":611,"value":979},"range",{"type":606,"tag":635,"props":981,"children":982},{"style":647},[983],{"type":611,"value":974},{"type":606,"tag":635,"props":985,"children":986},{"style":793},[987],{"type":611,"value":988},"100000",{"type":606,"tag":635,"props":990,"children":991},{"style":647},[992],{"type":611,"value":993},"))\n",{"type":606,"tag":635,"props":995,"children":996},{"class":637,"line":236},[997],{"type":606,"tag":635,"props":998,"children":999},{"emptyLinePlaceholder":13},[1000],{"type":611,"value":658},{"type":606,"tag":635,"props":1002,"children":1003},{"class":637,"line":245},[1004],{"type":606,"tag":635,"props":1005,"children":1006},{"style":664},[1007],{"type":611,"value":1008},"# Time the slow version\n",{"type":606,"tag":635,"props":1010,"children":1011},{"class":637,"line":254},[1012,1017,1021],{"type":606,"tag":635,"props":1013,"children":1014},{"style":647},[1015],{"type":611,"value":1016},"start_time ",{"type":606,"tag":635,"props":1018,"children":1019},{"style":641},[1020],{"type":611,"value":723},{"type":606,"tag":635,"props":1022,"children":1023},{"style":647},[1024],{"type":611,"value":1025}," time.time()\n",{"type":606,"tag":635,"props":1027,"children":1028},{"class":637,"line":263},[1029,1034,1038],{"type":606,"tag":635,"props":1030,"children":1031},{"style":647},[1032],{"type":611,"value":1033},"slow_result ",{"type":606,"tag":635,"props":1035,"children":1036},{"style":641},[1037],{"type":611,"value":723},{"type":606,"tag":635,"props":1039,"children":1040},{"style":647},[1041],{"type":611,"value":1042}," slow_sum_squares(numbers)\n",{"type":606,"tag":635,"props":1044,"children":1045},{"class":637,"line":272},[1046,1051,1055,1060,1065],{"type":606,"tag":635,"props":1047,"children":1048},{"style":647},[1049],{"type":611,"value":1050},"slow_time ",{"type":606,"tag":635,"props":1052,"children":1053},{"style":641},[1054],{"type":611,"value":723},{"type":606,"tag":635,"props":1056,"children":1057},{"style":647},[1058],{"type":611,"value":1059}," time.time() ",{"type":606,"tag":635,"props":1061,"children":1062},{"style":641},[1063],{"type":611,"value":1064},"-",{"type":606,"tag":635,"props":1066,"children":1067},{"style":647},[1068],{"type":611,"value":1069}," start_time\n",{"type":606,"tag":635,"props":1071,"children":1072},{"class":637,"line":281},[1073],{"type":606,"tag":635,"props":1074,"children":1075},{"emptyLinePlaceholder":13},[1076],{"type":611,"value":658},{"type":606,"tag":635,"props":1078,"children":1079},{"class":637,"line":291},[1080],{"type":606,"tag":635,"props":1081,"children":1082},{"style":664},[1083],{"type":611,"value":1084},"# Time the fast version\n",{"type":606,"tag":635,"props":1086,"children":1087},{"class":637,"line":302},[1088,1092,1096],{"type":606,"tag":635,"props":1089,"children":1090},{"style":647},[1091],{"type":611,"value":1016},{"type":606,"tag":635,"props":1093,"children":1094},{"style":641},[1095],{"type":611,"value":723},{"type":606,"tag":635,"props":1097,"children":1098},{"style":647},[1099],{"type":611,"value":1025},{"type":606,"tag":635,"props":1101,"children":1102},{"class":637,"line":311},[1103,1108,1112],{"type":606,"tag":635,"props":1104,"children":1105},{"style":647},[1106],{"type":611,"value":1107},"fast_result ",{"type":606,"tag":635,"props":1109,"children":1110},{"style":641},[1111],{"type":611,"value":723},{"type":606,"tag":635,"props":1113,"children":1114},{"style":647},[1115],{"type":611,"value":1116}," fast_sum_squares(numbers)\n",{"type":606,"tag":635,"props":1118,"children":1119},{"class":637,"line":320},[1120,1125,1129,1133,1137],{"type":606,"tag":635,"props":1121,"children":1122},{"style":647},[1123],{"type":611,"value":1124},"fast_time ",{"type":606,"tag":635,"props":1126,"children":1127},{"style":641},[1128],{"type":611,"value":723},{"type":606,"tag":635,"props":1130,"children":1131},{"style":647},[1132],{"type":611,"value":1059},{"type":606,"tag":635,"props":1134,"children":1135},{"style":641},[1136],{"type":611,"value":1064},{"type":606,"tag":635,"props":1138,"children":1139},{"style":647},[1140],{"type":611,"value":1069},{"type":606,"tag":635,"props":1142,"children":1143},{"class":637,"line":329},[1144],{"type":606,"tag":635,"props":1145,"children":1146},{"emptyLinePlaceholder":13},[1147],{"type":611,"value":658},{"type":606,"tag":635,"props":1149,"children":1150},{"class":637,"line":338},[1151,1156,1160,1165,1170,1175,1180,1185,1190,1195],{"type":606,"tag":635,"props":1152,"children":1153},{"style":793},[1154],{"type":611,"value":1155},"print",{"type":606,"tag":635,"props":1157,"children":1158},{"style":647},[1159],{"type":611,"value":974},{"type":606,"tag":635,"props":1161,"children":1162},{"style":641},[1163],{"type":611,"value":1164},"f",{"type":606,"tag":635,"props":1166,"children":1167},{"style":707},[1168],{"type":611,"value":1169},"\"Slow version: ",{"type":606,"tag":635,"props":1171,"children":1172},{"style":793},[1173],{"type":611,"value":1174},"{",{"type":606,"tag":635,"props":1176,"children":1177},{"style":647},[1178],{"type":611,"value":1179},"slow_time",{"type":606,"tag":635,"props":1181,"children":1182},{"style":641},[1183],{"type":611,"value":1184},":.4f",{"type":606,"tag":635,"props":1186,"children":1187},{"style":793},[1188],{"type":611,"value":1189},"}",{"type":606,"tag":635,"props":1191,"children":1192},{"style":707},[1193],{"type":611,"value":1194}," seconds\"",{"type":606,"tag":635,"props":1196,"children":1197},{"style":647},[1198],{"type":611,"value":1199},")\n",{"type":606,"tag":635,"props":1201,"children":1202},{"class":637,"line":347},[1203,1207,1211,1215,1220,1224,1229,1233,1237,1241],{"type":606,"tag":635,"props":1204,"children":1205},{"style":793},[1206],{"type":611,"value":1155},{"type":606,"tag":635,"props":1208,"children":1209},{"style":647},[1210],{"type":611,"value":974},{"type":606,"tag":635,"props":1212,"children":1213},{"style":641},[1214],{"type":611,"value":1164},{"type":606,"tag":635,"props":1216,"children":1217},{"style":707},[1218],{"type":611,"value":1219},"\"Fast version: ",{"type":606,"tag":635,"props":1221,"children":1222},{"style":793},[1223],{"type":611,"value":1174},{"type":606,"tag":635,"props":1225,"children":1226},{"style":647},[1227],{"type":611,"value":1228},"fast_time",{"type":606,"tag":635,"props":1230,"children":1231},{"style":641},[1232],{"type":611,"value":1184},{"type":606,"tag":635,"props":1234,"children":1235},{"style":793},[1236],{"type":611,"value":1189},{"type":606,"tag":635,"props":1238,"children":1239},{"style":707},[1240],{"type":611,"value":1194},{"type":606,"tag":635,"props":1242,"children":1243},{"style":647},[1244],{"type":611,"value":1199},{"type":606,"tag":635,"props":1246,"children":1247},{"class":637,"line":356},[1248,1252,1256,1260,1265,1269,1273,1278,1283,1288,1292,1297],{"type":606,"tag":635,"props":1249,"children":1250},{"style":793},[1251],{"type":611,"value":1155},{"type":606,"tag":635,"props":1253,"children":1254},{"style":647},[1255],{"type":611,"value":974},{"type":606,"tag":635,"props":1257,"children":1258},{"style":641},[1259],{"type":611,"value":1164},{"type":606,"tag":635,"props":1261,"children":1262},{"style":707},[1263],{"type":611,"value":1264},"\"Speedup: ",{"type":606,"tag":635,"props":1266,"children":1267},{"style":793},[1268],{"type":611,"value":1174},{"type":606,"tag":635,"props":1270,"children":1271},{"style":647},[1272],{"type":611,"value":1050},{"type":606,"tag":635,"props":1274,"children":1275},{"style":641},[1276],{"type":611,"value":1277},"/",{"type":606,"tag":635,"props":1279,"children":1280},{"style":647},[1281],{"type":611,"value":1282}," fast_time",{"type":606,"tag":635,"props":1284,"children":1285},{"style":641},[1286],{"type":611,"value":1287},":.1f",{"type":606,"tag":635,"props":1289,"children":1290},{"style":793},[1291],{"type":611,"value":1189},{"type":606,"tag":635,"props":1293,"children":1294},{"style":707},[1295],{"type":611,"value":1296},"x faster\"",{"type":606,"tag":635,"props":1298,"children":1299},{"style":647},[1300],{"type":611,"value":1199},{"type":606,"tag":635,"props":1302,"children":1303},{"class":637,"line":367},[1304,1308,1312,1316,1321,1325,1329,1334,1339,1343,1348],{"type":606,"tag":635,"props":1305,"children":1306},{"style":793},[1307],{"type":611,"value":1155},{"type":606,"tag":635,"props":1309,"children":1310},{"style":647},[1311],{"type":611,"value":974},{"type":606,"tag":635,"props":1313,"children":1314},{"style":641},[1315],{"type":611,"value":1164},{"type":606,"tag":635,"props":1317,"children":1318},{"style":707},[1319],{"type":611,"value":1320},"\"Results match: ",{"type":606,"tag":635,"props":1322,"children":1323},{"style":793},[1324],{"type":611,"value":1174},{"type":606,"tag":635,"props":1326,"children":1327},{"style":647},[1328],{"type":611,"value":1033},{"type":606,"tag":635,"props":1330,"children":1331},{"style":641},[1332],{"type":611,"value":1333},"==",{"type":606,"tag":635,"props":1335,"children":1336},{"style":647},[1337],{"type":611,"value":1338}," fast_result",{"type":606,"tag":635,"props":1340,"children":1341},{"style":793},[1342],{"type":611,"value":1189},{"type":606,"tag":635,"props":1344,"children":1345},{"style":707},[1346],{"type":611,"value":1347},"\"",{"type":606,"tag":635,"props":1349,"children":1350},{"style":647},[1351],{"type":611,"value":1199},{"type":606,"tag":1353,"props":1354,"children":1356},"h2",{"id":1355},"understanding-performance",[1357],{"type":611,"value":1358},"🎯 Understanding Performance",{"type":606,"tag":614,"props":1360,"children":1361},{},[1362],{"type":611,"value":1363},"Performance optimization focuses on making code run faster and use less memory.",{"type":606,"tag":1365,"props":1366,"children":1370},"info-box",{"emoji":1367,"title":1368,"type":1369},"⚡","Performance Basics","info",[1371,1380,1405,1413,1436,1444],{"type":606,"tag":614,"props":1372,"children":1373},{},[1374],{"type":606,"tag":1375,"props":1376,"children":1377},"strong",{},[1378],{"type":611,"value":1379},"Key Metrics:",{"type":606,"tag":1381,"props":1382,"children":1383},"ul",{},[1384,1390,1395,1400],{"type":606,"tag":1385,"props":1386,"children":1387},"li",{},[1388],{"type":611,"value":1389},"Execution time (how fast code runs)",{"type":606,"tag":1385,"props":1391,"children":1392},{},[1393],{"type":611,"value":1394},"Memory usage (how much RAM is used)",{"type":606,"tag":1385,"props":1396,"children":1397},{},[1398],{"type":611,"value":1399},"CPU usage (how much processing power)",{"type":606,"tag":1385,"props":1401,"children":1402},{},[1403],{"type":611,"value":1404},"Scalability (performance with larger data)",{"type":606,"tag":614,"props":1406,"children":1407},{},[1408],{"type":606,"tag":1375,"props":1409,"children":1410},{},[1411],{"type":611,"value":1412},"Common Bottlenecks:",{"type":606,"tag":1381,"props":1414,"children":1415},{},[1416,1421,1426,1431],{"type":606,"tag":1385,"props":1417,"children":1418},{},[1419],{"type":611,"value":1420},"Slow algorithms (O(n²) vs O(n))",{"type":606,"tag":1385,"props":1422,"children":1423},{},[1424],{"type":611,"value":1425},"Unnecessary loops and operations",{"type":606,"tag":1385,"props":1427,"children":1428},{},[1429],{"type":611,"value":1430},"Memory allocations and copying",{"type":606,"tag":1385,"props":1432,"children":1433},{},[1434],{"type":611,"value":1435},"File I/O and network operations",{"type":606,"tag":614,"props":1437,"children":1438},{},[1439],{"type":606,"tag":1375,"props":1440,"children":1441},{},[1442],{"type":611,"value":1443},"Optimization Strategy:",{"type":606,"tag":1445,"props":1446,"children":1447},"ol",{},[1448,1453,1458,1463],{"type":606,"tag":1385,"props":1449,"children":1450},{},[1451],{"type":611,"value":1452},"Measure first (profile your code)",{"type":606,"tag":1385,"props":1454,"children":1455},{},[1456],{"type":611,"value":1457},"Find the real bottlenecks",{"type":606,"tag":1385,"props":1459,"children":1460},{},[1461],{"type":611,"value":1462},"Optimize the slowest parts",{"type":606,"tag":1385,"props":1464,"children":1465},{},[1466],{"type":611,"value":1467},"Verify improvements with testing",{"type":606,"tag":1469,"props":1470,"children":1472},"h3",{"id":1471},"efficient-data-structures",[1473],{"type":611,"value":1474},"Efficient Data Structures",{"type":606,"tag":620,"props":1476,"children":1477},{},[1478],{"type":606,"tag":624,"props":1479,"children":1481},{"className":626,"code":1480,"language":628,"meta":8,"style":8},"import time\n\n# Compare different data structures for lookups\n\ndef test_lookup_performance():\n    \"\"\"Compare list vs set vs dict for lookups.\"\"\"\n    \n    # Create test data\n    items = list(range(10000))\n    items_set = set(items)\n    items_dict = {item: True for item in items}\n    \n    # Test item to search for\n    search_item = 9999\n    \n    # Time list lookup (slow - O(n))\n    start_time = time.time()\n    for _ in range(1000):\n        found = search_item in items\n    list_time = time.time() - start_time\n    \n    # Time set lookup (fast - O(1))\n    start_time = time.time()\n    for _ in range(1000):\n        found = search_item in items_set\n    set_time = time.time() - start_time\n    \n    # Time dict lookup (fast - O(1))\n    start_time = time.time()\n    for _ in range(1000):\n        found = search_item in items_dict\n    dict_time = time.time() - start_time\n    \n    print(\"Lookup Performance:\")\n    print(f\"List: {list_time:.4f} seconds\")\n    print(f\"Set:  {set_time:.4f} seconds ({list_time/set_time:.0f}x faster)\")\n    print(f\"Dict: {dict_time:.4f} seconds ({list_time/dict_time:.0f}x faster)\")\n\ndef efficient_data_processing():\n    \"\"\"Show efficient ways to process data.\"\"\"\n    \n    # Sample data\n    sales_data = [\n        {'product': 'laptop', 'category': 'electronics', 'price': 999},\n        {'product': 'mouse', 'category': 'electronics', 'price': 25},\n        {'product': 'book', 'category': 'education', 'price': 15},\n        {'product': 'keyboard', 'category': 'electronics', 'price': 75},\n        {'product': 'course', 'category': 'education', 'price': 200}\n    ]\n    \n    # Efficient grouping using dict\n    categories = {}\n    for item in sales_data:\n        category = item['category']\n        if category not in categories:\n            categories[category] = []\n        categories[category].append(item)\n    \n    # Calculate totals efficiently\n    category_totals = {}\n    for category, items in categories.items():\n        total = sum(item['price'] for item in items)\n        category_totals[category] = total\n    \n    print(\"\\nCategory Sales:\")\n    for category, total in category_totals.items():\n        print(f\"{category}: ${total}\")\n    \n    return categories\n\ntest_lookup_performance()\nefficient_data_processing()\n",[1482],{"type":606,"tag":631,"props":1483,"children":1484},{"__ignoreMap":8},[1485,1496,1503,1511,1518,1535,1543,1550,1558,1595,1617,1658,1665,1673,1690,1697,1705,1721,1756,1782,1806,1813,1821,1836,1867,1891,1915,1922,1930,1945,1976,2000,2024,2031,2052,2097,2173,2246,2253,2269,2277,2284,2292,2309,2374,2431,2489,2546,2604,2612,2619,2627,2644,2664,2690,2718,2734,2742,2749,2757,2773,2794,2840,2856,2864,2894,2916,2976,2984,2997,3005,3014],{"type":606,"tag":635,"props":1486,"children":1487},{"class":637,"line":12},[1488,1492],{"type":606,"tag":635,"props":1489,"children":1490},{"style":641},[1491],{"type":611,"value":644},{"type":606,"tag":635,"props":1493,"children":1494},{"style":647},[1495],{"type":611,"value":650},{"type":606,"tag":635,"props":1497,"children":1498},{"class":637,"line":27},[1499],{"type":606,"tag":635,"props":1500,"children":1501},{"emptyLinePlaceholder":13},[1502],{"type":611,"value":658},{"type":606,"tag":635,"props":1504,"children":1505},{"class":637,"line":36},[1506],{"type":606,"tag":635,"props":1507,"children":1508},{"style":664},[1509],{"type":611,"value":1510},"# Compare different data structures for lookups\n",{"type":606,"tag":635,"props":1512,"children":1513},{"class":637,"line":45},[1514],{"type":606,"tag":635,"props":1515,"children":1516},{"emptyLinePlaceholder":13},[1517],{"type":611,"value":658},{"type":606,"tag":635,"props":1519,"children":1520},{"class":637,"line":54},[1521,1525,1530],{"type":606,"tag":635,"props":1522,"children":1523},{"style":641},[1524],{"type":611,"value":690},{"type":606,"tag":635,"props":1526,"children":1527},{"style":693},[1528],{"type":611,"value":1529}," test_lookup_performance",{"type":606,"tag":635,"props":1531,"children":1532},{"style":647},[1533],{"type":611,"value":1534},"():\n",{"type":606,"tag":635,"props":1536,"children":1537},{"class":637,"line":63},[1538],{"type":606,"tag":635,"props":1539,"children":1540},{"style":707},[1541],{"type":611,"value":1542},"    \"\"\"Compare list vs set vs dict for lookups.\"\"\"\n",{"type":606,"tag":635,"props":1544,"children":1545},{"class":637,"line":72},[1546],{"type":606,"tag":635,"props":1547,"children":1548},{"style":647},[1549],{"type":611,"value":778},{"type":606,"tag":635,"props":1551,"children":1552},{"class":637,"line":81},[1553],{"type":606,"tag":635,"props":1554,"children":1555},{"style":664},[1556],{"type":611,"value":1557},"    # Create test data\n",{"type":606,"tag":635,"props":1559,"children":1560},{"class":637,"line":731},[1561,1566,1570,1574,1578,1582,1586,1591],{"type":606,"tag":635,"props":1562,"children":1563},{"style":647},[1564],{"type":611,"value":1565},"    items ",{"type":606,"tag":635,"props":1567,"children":1568},{"style":641},[1569],{"type":611,"value":723},{"type":606,"tag":635,"props":1571,"children":1572},{"style":793},[1573],{"type":611,"value":969},{"type":606,"tag":635,"props":1575,"children":1576},{"style":647},[1577],{"type":611,"value":974},{"type":606,"tag":635,"props":1579,"children":1580},{"style":793},[1581],{"type":611,"value":979},{"type":606,"tag":635,"props":1583,"children":1584},{"style":647},[1585],{"type":611,"value":974},{"type":606,"tag":635,"props":1587,"children":1588},{"style":793},[1589],{"type":611,"value":1590},"10000",{"type":606,"tag":635,"props":1592,"children":1593},{"style":647},[1594],{"type":611,"value":993},{"type":606,"tag":635,"props":1596,"children":1597},{"class":637,"line":99},[1598,1603,1607,1612],{"type":606,"tag":635,"props":1599,"children":1600},{"style":647},[1601],{"type":611,"value":1602},"    items_set ",{"type":606,"tag":635,"props":1604,"children":1605},{"style":641},[1606],{"type":611,"value":723},{"type":606,"tag":635,"props":1608,"children":1609},{"style":793},[1610],{"type":611,"value":1611}," set",{"type":606,"tag":635,"props":1613,"children":1614},{"style":647},[1615],{"type":611,"value":1616},"(items)\n",{"type":606,"tag":635,"props":1618,"children":1619},{"class":637,"line":108},[1620,1625,1629,1634,1639,1644,1649,1653],{"type":606,"tag":635,"props":1621,"children":1622},{"style":647},[1623],{"type":611,"value":1624},"    items_dict ",{"type":606,"tag":635,"props":1626,"children":1627},{"style":641},[1628],{"type":611,"value":723},{"type":606,"tag":635,"props":1630,"children":1631},{"style":647},[1632],{"type":611,"value":1633}," {item: ",{"type":606,"tag":635,"props":1635,"children":1636},{"style":793},[1637],{"type":611,"value":1638},"True",{"type":606,"tag":635,"props":1640,"children":1641},{"style":641},[1642],{"type":611,"value":1643}," for",{"type":606,"tag":635,"props":1645,"children":1646},{"style":647},[1647],{"type":611,"value":1648}," item ",{"type":606,"tag":635,"props":1650,"children":1651},{"style":641},[1652],{"type":611,"value":747},{"type":606,"tag":635,"props":1654,"children":1655},{"style":647},[1656],{"type":611,"value":1657}," items}\n",{"type":606,"tag":635,"props":1659,"children":1660},{"class":637,"line":117},[1661],{"type":606,"tag":635,"props":1662,"children":1663},{"style":647},[1664],{"type":611,"value":778},{"type":606,"tag":635,"props":1666,"children":1667},{"class":637,"line":126},[1668],{"type":606,"tag":635,"props":1669,"children":1670},{"style":664},[1671],{"type":611,"value":1672},"    # Test item to search for\n",{"type":606,"tag":635,"props":1674,"children":1675},{"class":637,"line":135},[1676,1681,1685],{"type":606,"tag":635,"props":1677,"children":1678},{"style":647},[1679],{"type":611,"value":1680},"    search_item ",{"type":606,"tag":635,"props":1682,"children":1683},{"style":641},[1684],{"type":611,"value":723},{"type":606,"tag":635,"props":1686,"children":1687},{"style":793},[1688],{"type":611,"value":1689}," 9999\n",{"type":606,"tag":635,"props":1691,"children":1692},{"class":637,"line":144},[1693],{"type":606,"tag":635,"props":1694,"children":1695},{"style":647},[1696],{"type":611,"value":778},{"type":606,"tag":635,"props":1698,"children":1699},{"class":637,"line":153},[1700],{"type":606,"tag":635,"props":1701,"children":1702},{"style":664},[1703],{"type":611,"value":1704},"    # Time list lookup (slow - O(n))\n",{"type":606,"tag":635,"props":1706,"children":1707},{"class":637,"line":163},[1708,1713,1717],{"type":606,"tag":635,"props":1709,"children":1710},{"style":647},[1711],{"type":611,"value":1712},"    start_time ",{"type":606,"tag":635,"props":1714,"children":1715},{"style":641},[1716],{"type":611,"value":723},{"type":606,"tag":635,"props":1718,"children":1719},{"style":647},[1720],{"type":611,"value":1025},{"type":606,"tag":635,"props":1722,"children":1723},{"class":637,"line":172},[1724,1728,1733,1737,1742,1746,1751],{"type":606,"tag":635,"props":1725,"children":1726},{"style":641},[1727],{"type":611,"value":737},{"type":606,"tag":635,"props":1729,"children":1730},{"style":647},[1731],{"type":611,"value":1732}," _ ",{"type":606,"tag":635,"props":1734,"children":1735},{"style":641},[1736],{"type":611,"value":747},{"type":606,"tag":635,"props":1738,"children":1739},{"style":793},[1740],{"type":611,"value":1741}," range",{"type":606,"tag":635,"props":1743,"children":1744},{"style":647},[1745],{"type":611,"value":974},{"type":606,"tag":635,"props":1747,"children":1748},{"style":793},[1749],{"type":611,"value":1750},"1000",{"type":606,"tag":635,"props":1752,"children":1753},{"style":647},[1754],{"type":611,"value":1755},"):\n",{"type":606,"tag":635,"props":1757,"children":1758},{"class":637,"line":181},[1759,1764,1768,1773,1777],{"type":606,"tag":635,"props":1760,"children":1761},{"style":647},[1762],{"type":611,"value":1763},"        found ",{"type":606,"tag":635,"props":1765,"children":1766},{"style":641},[1767],{"type":611,"value":723},{"type":606,"tag":635,"props":1769,"children":1770},{"style":647},[1771],{"type":611,"value":1772}," search_item ",{"type":606,"tag":635,"props":1774,"children":1775},{"style":641},[1776],{"type":611,"value":747},{"type":606,"tag":635,"props":1778,"children":1779},{"style":647},[1780],{"type":611,"value":1781}," items\n",{"type":606,"tag":635,"props":1783,"children":1784},{"class":637,"line":190},[1785,1790,1794,1798,1802],{"type":606,"tag":635,"props":1786,"children":1787},{"style":647},[1788],{"type":611,"value":1789},"    list_time ",{"type":606,"tag":635,"props":1791,"children":1792},{"style":641},[1793],{"type":611,"value":723},{"type":606,"tag":635,"props":1795,"children":1796},{"style":647},[1797],{"type":611,"value":1059},{"type":606,"tag":635,"props":1799,"children":1800},{"style":641},[1801],{"type":611,"value":1064},{"type":606,"tag":635,"props":1803,"children":1804},{"style":647},[1805],{"type":611,"value":1069},{"type":606,"tag":635,"props":1807,"children":1808},{"class":637,"line":199},[1809],{"type":606,"tag":635,"props":1810,"children":1811},{"style":647},[1812],{"type":611,"value":778},{"type":606,"tag":635,"props":1814,"children":1815},{"class":637,"line":208},[1816],{"type":606,"tag":635,"props":1817,"children":1818},{"style":664},[1819],{"type":611,"value":1820},"    # Time set lookup (fast - O(1))\n",{"type":606,"tag":635,"props":1822,"children":1823},{"class":637,"line":217},[1824,1828,1832],{"type":606,"tag":635,"props":1825,"children":1826},{"style":647},[1827],{"type":611,"value":1712},{"type":606,"tag":635,"props":1829,"children":1830},{"style":641},[1831],{"type":611,"value":723},{"type":606,"tag":635,"props":1833,"children":1834},{"style":647},[1835],{"type":611,"value":1025},{"type":606,"tag":635,"props":1837,"children":1838},{"class":637,"line":227},[1839,1843,1847,1851,1855,1859,1863],{"type":606,"tag":635,"props":1840,"children":1841},{"style":641},[1842],{"type":611,"value":737},{"type":606,"tag":635,"props":1844,"children":1845},{"style":647},[1846],{"type":611,"value":1732},{"type":606,"tag":635,"props":1848,"children":1849},{"style":641},[1850],{"type":611,"value":747},{"type":606,"tag":635,"props":1852,"children":1853},{"style":793},[1854],{"type":611,"value":1741},{"type":606,"tag":635,"props":1856,"children":1857},{"style":647},[1858],{"type":611,"value":974},{"type":606,"tag":635,"props":1860,"children":1861},{"style":793},[1862],{"type":611,"value":1750},{"type":606,"tag":635,"props":1864,"children":1865},{"style":647},[1866],{"type":611,"value":1755},{"type":606,"tag":635,"props":1868,"children":1869},{"class":637,"line":236},[1870,1874,1878,1882,1886],{"type":606,"tag":635,"props":1871,"children":1872},{"style":647},[1873],{"type":611,"value":1763},{"type":606,"tag":635,"props":1875,"children":1876},{"style":641},[1877],{"type":611,"value":723},{"type":606,"tag":635,"props":1879,"children":1880},{"style":647},[1881],{"type":611,"value":1772},{"type":606,"tag":635,"props":1883,"children":1884},{"style":641},[1885],{"type":611,"value":747},{"type":606,"tag":635,"props":1887,"children":1888},{"style":647},[1889],{"type":611,"value":1890}," items_set\n",{"type":606,"tag":635,"props":1892,"children":1893},{"class":637,"line":245},[1894,1899,1903,1907,1911],{"type":606,"tag":635,"props":1895,"children":1896},{"style":647},[1897],{"type":611,"value":1898},"    set_time ",{"type":606,"tag":635,"props":1900,"children":1901},{"style":641},[1902],{"type":611,"value":723},{"type":606,"tag":635,"props":1904,"children":1905},{"style":647},[1906],{"type":611,"value":1059},{"type":606,"tag":635,"props":1908,"children":1909},{"style":641},[1910],{"type":611,"value":1064},{"type":606,"tag":635,"props":1912,"children":1913},{"style":647},[1914],{"type":611,"value":1069},{"type":606,"tag":635,"props":1916,"children":1917},{"class":637,"line":254},[1918],{"type":606,"tag":635,"props":1919,"children":1920},{"style":647},[1921],{"type":611,"value":778},{"type":606,"tag":635,"props":1923,"children":1924},{"class":637,"line":263},[1925],{"type":606,"tag":635,"props":1926,"children":1927},{"style":664},[1928],{"type":611,"value":1929},"    # Time dict lookup (fast - O(1))\n",{"type":606,"tag":635,"props":1931,"children":1932},{"class":637,"line":272},[1933,1937,1941],{"type":606,"tag":635,"props":1934,"children":1935},{"style":647},[1936],{"type":611,"value":1712},{"type":606,"tag":635,"props":1938,"children":1939},{"style":641},[1940],{"type":611,"value":723},{"type":606,"tag":635,"props":1942,"children":1943},{"style":647},[1944],{"type":611,"value":1025},{"type":606,"tag":635,"props":1946,"children":1947},{"class":637,"line":281},[1948,1952,1956,1960,1964,1968,1972],{"type":606,"tag":635,"props":1949,"children":1950},{"style":641},[1951],{"type":611,"value":737},{"type":606,"tag":635,"props":1953,"children":1954},{"style":647},[1955],{"type":611,"value":1732},{"type":606,"tag":635,"props":1957,"children":1958},{"style":641},[1959],{"type":611,"value":747},{"type":606,"tag":635,"props":1961,"children":1962},{"style":793},[1963],{"type":611,"value":1741},{"type":606,"tag":635,"props":1965,"children":1966},{"style":647},[1967],{"type":611,"value":974},{"type":606,"tag":635,"props":1969,"children":1970},{"style":793},[1971],{"type":611,"value":1750},{"type":606,"tag":635,"props":1973,"children":1974},{"style":647},[1975],{"type":611,"value":1755},{"type":606,"tag":635,"props":1977,"children":1978},{"class":637,"line":291},[1979,1983,1987,1991,1995],{"type":606,"tag":635,"props":1980,"children":1981},{"style":647},[1982],{"type":611,"value":1763},{"type":606,"tag":635,"props":1984,"children":1985},{"style":641},[1986],{"type":611,"value":723},{"type":606,"tag":635,"props":1988,"children":1989},{"style":647},[1990],{"type":611,"value":1772},{"type":606,"tag":635,"props":1992,"children":1993},{"style":641},[1994],{"type":611,"value":747},{"type":606,"tag":635,"props":1996,"children":1997},{"style":647},[1998],{"type":611,"value":1999}," items_dict\n",{"type":606,"tag":635,"props":2001,"children":2002},{"class":637,"line":302},[2003,2008,2012,2016,2020],{"type":606,"tag":635,"props":2004,"children":2005},{"style":647},[2006],{"type":611,"value":2007},"    dict_time ",{"type":606,"tag":635,"props":2009,"children":2010},{"style":641},[2011],{"type":611,"value":723},{"type":606,"tag":635,"props":2013,"children":2014},{"style":647},[2015],{"type":611,"value":1059},{"type":606,"tag":635,"props":2017,"children":2018},{"style":641},[2019],{"type":611,"value":1064},{"type":606,"tag":635,"props":2021,"children":2022},{"style":647},[2023],{"type":611,"value":1069},{"type":606,"tag":635,"props":2025,"children":2026},{"class":637,"line":311},[2027],{"type":606,"tag":635,"props":2028,"children":2029},{"style":647},[2030],{"type":611,"value":778},{"type":606,"tag":635,"props":2032,"children":2033},{"class":637,"line":320},[2034,2039,2043,2048],{"type":606,"tag":635,"props":2035,"children":2036},{"style":793},[2037],{"type":611,"value":2038},"    print",{"type":606,"tag":635,"props":2040,"children":2041},{"style":647},[2042],{"type":611,"value":974},{"type":606,"tag":635,"props":2044,"children":2045},{"style":707},[2046],{"type":611,"value":2047},"\"Lookup Performance:\"",{"type":606,"tag":635,"props":2049,"children":2050},{"style":647},[2051],{"type":611,"value":1199},{"type":606,"tag":635,"props":2053,"children":2054},{"class":637,"line":329},[2055,2059,2063,2067,2072,2076,2081,2085,2089,2093],{"type":606,"tag":635,"props":2056,"children":2057},{"style":793},[2058],{"type":611,"value":2038},{"type":606,"tag":635,"props":2060,"children":2061},{"style":647},[2062],{"type":611,"value":974},{"type":606,"tag":635,"props":2064,"children":2065},{"style":641},[2066],{"type":611,"value":1164},{"type":606,"tag":635,"props":2068,"children":2069},{"style":707},[2070],{"type":611,"value":2071},"\"List: ",{"type":606,"tag":635,"props":2073,"children":2074},{"style":793},[2075],{"type":611,"value":1174},{"type":606,"tag":635,"props":2077,"children":2078},{"style":647},[2079],{"type":611,"value":2080},"list_time",{"type":606,"tag":635,"props":2082,"children":2083},{"style":641},[2084],{"type":611,"value":1184},{"type":606,"tag":635,"props":2086,"children":2087},{"style":793},[2088],{"type":611,"value":1189},{"type":606,"tag":635,"props":2090,"children":2091},{"style":707},[2092],{"type":611,"value":1194},{"type":606,"tag":635,"props":2094,"children":2095},{"style":647},[2096],{"type":611,"value":1199},{"type":606,"tag":635,"props":2098,"children":2099},{"class":637,"line":338},[2100,2104,2108,2112,2117,2121,2126,2130,2134,2139,2143,2147,2151,2155,2160,2164,2169],{"type":606,"tag":635,"props":2101,"children":2102},{"style":793},[2103],{"type":611,"value":2038},{"type":606,"tag":635,"props":2105,"children":2106},{"style":647},[2107],{"type":611,"value":974},{"type":606,"tag":635,"props":2109,"children":2110},{"style":641},[2111],{"type":611,"value":1164},{"type":606,"tag":635,"props":2113,"children":2114},{"style":707},[2115],{"type":611,"value":2116},"\"Set:  ",{"type":606,"tag":635,"props":2118,"children":2119},{"style":793},[2120],{"type":611,"value":1174},{"type":606,"tag":635,"props":2122,"children":2123},{"style":647},[2124],{"type":611,"value":2125},"set_time",{"type":606,"tag":635,"props":2127,"children":2128},{"style":641},[2129],{"type":611,"value":1184},{"type":606,"tag":635,"props":2131,"children":2132},{"style":793},[2133],{"type":611,"value":1189},{"type":606,"tag":635,"props":2135,"children":2136},{"style":707},[2137],{"type":611,"value":2138}," seconds (",{"type":606,"tag":635,"props":2140,"children":2141},{"style":793},[2142],{"type":611,"value":1174},{"type":606,"tag":635,"props":2144,"children":2145},{"style":647},[2146],{"type":611,"value":2080},{"type":606,"tag":635,"props":2148,"children":2149},{"style":641},[2150],{"type":611,"value":1277},{"type":606,"tag":635,"props":2152,"children":2153},{"style":647},[2154],{"type":611,"value":2125},{"type":606,"tag":635,"props":2156,"children":2157},{"style":641},[2158],{"type":611,"value":2159},":.0f",{"type":606,"tag":635,"props":2161,"children":2162},{"style":793},[2163],{"type":611,"value":1189},{"type":606,"tag":635,"props":2165,"children":2166},{"style":707},[2167],{"type":611,"value":2168},"x faster)\"",{"type":606,"tag":635,"props":2170,"children":2171},{"style":647},[2172],{"type":611,"value":1199},{"type":606,"tag":635,"props":2174,"children":2175},{"class":637,"line":347},[2176,2180,2184,2188,2193,2197,2202,2206,2210,2214,2218,2222,2226,2230,2234,2238,2242],{"type":606,"tag":635,"props":2177,"children":2178},{"style":793},[2179],{"type":611,"value":2038},{"type":606,"tag":635,"props":2181,"children":2182},{"style":647},[2183],{"type":611,"value":974},{"type":606,"tag":635,"props":2185,"children":2186},{"style":641},[2187],{"type":611,"value":1164},{"type":606,"tag":635,"props":2189,"children":2190},{"style":707},[2191],{"type":611,"value":2192},"\"Dict: ",{"type":606,"tag":635,"props":2194,"children":2195},{"style":793},[2196],{"type":611,"value":1174},{"type":606,"tag":635,"props":2198,"children":2199},{"style":647},[2200],{"type":611,"value":2201},"dict_time",{"type":606,"tag":635,"props":2203,"children":2204},{"style":641},[2205],{"type":611,"value":1184},{"type":606,"tag":635,"props":2207,"children":2208},{"style":793},[2209],{"type":611,"value":1189},{"type":606,"tag":635,"props":2211,"children":2212},{"style":707},[2213],{"type":611,"value":2138},{"type":606,"tag":635,"props":2215,"children":2216},{"style":793},[2217],{"type":611,"value":1174},{"type":606,"tag":635,"props":2219,"children":2220},{"style":647},[2221],{"type":611,"value":2080},{"type":606,"tag":635,"props":2223,"children":2224},{"style":641},[2225],{"type":611,"value":1277},{"type":606,"tag":635,"props":2227,"children":2228},{"style":647},[2229],{"type":611,"value":2201},{"type":606,"tag":635,"props":2231,"children":2232},{"style":641},[2233],{"type":611,"value":2159},{"type":606,"tag":635,"props":2235,"children":2236},{"style":793},[2237],{"type":611,"value":1189},{"type":606,"tag":635,"props":2239,"children":2240},{"style":707},[2241],{"type":611,"value":2168},{"type":606,"tag":635,"props":2243,"children":2244},{"style":647},[2245],{"type":611,"value":1199},{"type":606,"tag":635,"props":2247,"children":2248},{"class":637,"line":356},[2249],{"type":606,"tag":635,"props":2250,"children":2251},{"emptyLinePlaceholder":13},[2252],{"type":611,"value":658},{"type":606,"tag":635,"props":2254,"children":2255},{"class":637,"line":367},[2256,2260,2265],{"type":606,"tag":635,"props":2257,"children":2258},{"style":641},[2259],{"type":611,"value":690},{"type":606,"tag":635,"props":2261,"children":2262},{"style":693},[2263],{"type":611,"value":2264}," efficient_data_processing",{"type":606,"tag":635,"props":2266,"children":2267},{"style":647},[2268],{"type":611,"value":1534},{"type":606,"tag":635,"props":2270,"children":2271},{"class":637,"line":376},[2272],{"type":606,"tag":635,"props":2273,"children":2274},{"style":707},[2275],{"type":611,"value":2276},"    \"\"\"Show efficient ways to process data.\"\"\"\n",{"type":606,"tag":635,"props":2278,"children":2279},{"class":637,"line":385},[2280],{"type":606,"tag":635,"props":2281,"children":2282},{"style":647},[2283],{"type":611,"value":778},{"type":606,"tag":635,"props":2285,"children":2286},{"class":637,"line":394},[2287],{"type":606,"tag":635,"props":2288,"children":2289},{"style":664},[2290],{"type":611,"value":2291},"    # Sample data\n",{"type":606,"tag":635,"props":2293,"children":2294},{"class":637,"line":403},[2295,2300,2304],{"type":606,"tag":635,"props":2296,"children":2297},{"style":647},[2298],{"type":611,"value":2299},"    sales_data ",{"type":606,"tag":635,"props":2301,"children":2302},{"style":641},[2303],{"type":611,"value":723},{"type":606,"tag":635,"props":2305,"children":2306},{"style":647},[2307],{"type":611,"value":2308}," [\n",{"type":606,"tag":635,"props":2310,"children":2311},{"class":637,"line":412},[2312,2317,2322,2327,2332,2337,2342,2346,2351,2355,2360,2364,2369],{"type":606,"tag":635,"props":2313,"children":2314},{"style":647},[2315],{"type":611,"value":2316},"        {",{"type":606,"tag":635,"props":2318,"children":2319},{"style":707},[2320],{"type":611,"value":2321},"'product'",{"type":606,"tag":635,"props":2323,"children":2324},{"style":647},[2325],{"type":611,"value":2326},": ",{"type":606,"tag":635,"props":2328,"children":2329},{"style":707},[2330],{"type":611,"value":2331},"'laptop'",{"type":606,"tag":635,"props":2333,"children":2334},{"style":647},[2335],{"type":611,"value":2336},", ",{"type":606,"tag":635,"props":2338,"children":2339},{"style":707},[2340],{"type":611,"value":2341},"'category'",{"type":606,"tag":635,"props":2343,"children":2344},{"style":647},[2345],{"type":611,"value":2326},{"type":606,"tag":635,"props":2347,"children":2348},{"style":707},[2349],{"type":611,"value":2350},"'electronics'",{"type":606,"tag":635,"props":2352,"children":2353},{"style":647},[2354],{"type":611,"value":2336},{"type":606,"tag":635,"props":2356,"children":2357},{"style":707},[2358],{"type":611,"value":2359},"'price'",{"type":606,"tag":635,"props":2361,"children":2362},{"style":647},[2363],{"type":611,"value":2326},{"type":606,"tag":635,"props":2365,"children":2366},{"style":793},[2367],{"type":611,"value":2368},"999",{"type":606,"tag":635,"props":2370,"children":2371},{"style":647},[2372],{"type":611,"value":2373},"},\n",{"type":606,"tag":635,"props":2375,"children":2376},{"class":637,"line":423},[2377,2381,2385,2389,2394,2398,2402,2406,2410,2414,2418,2422,2427],{"type":606,"tag":635,"props":2378,"children":2379},{"style":647},[2380],{"type":611,"value":2316},{"type":606,"tag":635,"props":2382,"children":2383},{"style":707},[2384],{"type":611,"value":2321},{"type":606,"tag":635,"props":2386,"children":2387},{"style":647},[2388],{"type":611,"value":2326},{"type":606,"tag":635,"props":2390,"children":2391},{"style":707},[2392],{"type":611,"value":2393},"'mouse'",{"type":606,"tag":635,"props":2395,"children":2396},{"style":647},[2397],{"type":611,"value":2336},{"type":606,"tag":635,"props":2399,"children":2400},{"style":707},[2401],{"type":611,"value":2341},{"type":606,"tag":635,"props":2403,"children":2404},{"style":647},[2405],{"type":611,"value":2326},{"type":606,"tag":635,"props":2407,"children":2408},{"style":707},[2409],{"type":611,"value":2350},{"type":606,"tag":635,"props":2411,"children":2412},{"style":647},[2413],{"type":611,"value":2336},{"type":606,"tag":635,"props":2415,"children":2416},{"style":707},[2417],{"type":611,"value":2359},{"type":606,"tag":635,"props":2419,"children":2420},{"style":647},[2421],{"type":611,"value":2326},{"type":606,"tag":635,"props":2423,"children":2424},{"style":793},[2425],{"type":611,"value":2426},"25",{"type":606,"tag":635,"props":2428,"children":2429},{"style":647},[2430],{"type":611,"value":2373},{"type":606,"tag":635,"props":2432,"children":2433},{"class":637,"line":432},[2434,2438,2442,2446,2451,2455,2459,2463,2468,2472,2476,2480,2485],{"type":606,"tag":635,"props":2435,"children":2436},{"style":647},[2437],{"type":611,"value":2316},{"type":606,"tag":635,"props":2439,"children":2440},{"style":707},[2441],{"type":611,"value":2321},{"type":606,"tag":635,"props":2443,"children":2444},{"style":647},[2445],{"type":611,"value":2326},{"type":606,"tag":635,"props":2447,"children":2448},{"style":707},[2449],{"type":611,"value":2450},"'book'",{"type":606,"tag":635,"props":2452,"children":2453},{"style":647},[2454],{"type":611,"value":2336},{"type":606,"tag":635,"props":2456,"children":2457},{"style":707},[2458],{"type":611,"value":2341},{"type":606,"tag":635,"props":2460,"children":2461},{"style":647},[2462],{"type":611,"value":2326},{"type":606,"tag":635,"props":2464,"children":2465},{"style":707},[2466],{"type":611,"value":2467},"'education'",{"type":606,"tag":635,"props":2469,"children":2470},{"style":647},[2471],{"type":611,"value":2336},{"type":606,"tag":635,"props":2473,"children":2474},{"style":707},[2475],{"type":611,"value":2359},{"type":606,"tag":635,"props":2477,"children":2478},{"style":647},[2479],{"type":611,"value":2326},{"type":606,"tag":635,"props":2481,"children":2482},{"style":793},[2483],{"type":611,"value":2484},"15",{"type":606,"tag":635,"props":2486,"children":2487},{"style":647},[2488],{"type":611,"value":2373},{"type":606,"tag":635,"props":2490,"children":2491},{"class":637,"line":441},[2492,2496,2500,2504,2509,2513,2517,2521,2525,2529,2533,2537,2542],{"type":606,"tag":635,"props":2493,"children":2494},{"style":647},[2495],{"type":611,"value":2316},{"type":606,"tag":635,"props":2497,"children":2498},{"style":707},[2499],{"type":611,"value":2321},{"type":606,"tag":635,"props":2501,"children":2502},{"style":647},[2503],{"type":611,"value":2326},{"type":606,"tag":635,"props":2505,"children":2506},{"style":707},[2507],{"type":611,"value":2508},"'keyboard'",{"type":606,"tag":635,"props":2510,"children":2511},{"style":647},[2512],{"type":611,"value":2336},{"type":606,"tag":635,"props":2514,"children":2515},{"style":707},[2516],{"type":611,"value":2341},{"type":606,"tag":635,"props":2518,"children":2519},{"style":647},[2520],{"type":611,"value":2326},{"type":606,"tag":635,"props":2522,"children":2523},{"style":707},[2524],{"type":611,"value":2350},{"type":606,"tag":635,"props":2526,"children":2527},{"style":647},[2528],{"type":611,"value":2336},{"type":606,"tag":635,"props":2530,"children":2531},{"style":707},[2532],{"type":611,"value":2359},{"type":606,"tag":635,"props":2534,"children":2535},{"style":647},[2536],{"type":611,"value":2326},{"type":606,"tag":635,"props":2538,"children":2539},{"style":793},[2540],{"type":611,"value":2541},"75",{"type":606,"tag":635,"props":2543,"children":2544},{"style":647},[2545],{"type":611,"value":2373},{"type":606,"tag":635,"props":2547,"children":2548},{"class":637,"line":450},[2549,2553,2557,2561,2566,2570,2574,2578,2582,2586,2590,2594,2599],{"type":606,"tag":635,"props":2550,"children":2551},{"style":647},[2552],{"type":611,"value":2316},{"type":606,"tag":635,"props":2554,"children":2555},{"style":707},[2556],{"type":611,"value":2321},{"type":606,"tag":635,"props":2558,"children":2559},{"style":647},[2560],{"type":611,"value":2326},{"type":606,"tag":635,"props":2562,"children":2563},{"style":707},[2564],{"type":611,"value":2565},"'course'",{"type":606,"tag":635,"props":2567,"children":2568},{"style":647},[2569],{"type":611,"value":2336},{"type":606,"tag":635,"props":2571,"children":2572},{"style":707},[2573],{"type":611,"value":2341},{"type":606,"tag":635,"props":2575,"children":2576},{"style":647},[2577],{"type":611,"value":2326},{"type":606,"tag":635,"props":2579,"children":2580},{"style":707},[2581],{"type":611,"value":2467},{"type":606,"tag":635,"props":2583,"children":2584},{"style":647},[2585],{"type":611,"value":2336},{"type":606,"tag":635,"props":2587,"children":2588},{"style":707},[2589],{"type":611,"value":2359},{"type":606,"tag":635,"props":2591,"children":2592},{"style":647},[2593],{"type":611,"value":2326},{"type":606,"tag":635,"props":2595,"children":2596},{"style":793},[2597],{"type":611,"value":2598},"200",{"type":606,"tag":635,"props":2600,"children":2601},{"style":647},[2602],{"type":611,"value":2603},"}\n",{"type":606,"tag":635,"props":2605,"children":2606},{"class":637,"line":459},[2607],{"type":606,"tag":635,"props":2608,"children":2609},{"style":647},[2610],{"type":611,"value":2611},"    ]\n",{"type":606,"tag":635,"props":2613,"children":2614},{"class":637,"line":468},[2615],{"type":606,"tag":635,"props":2616,"children":2617},{"style":647},[2618],{"type":611,"value":778},{"type":606,"tag":635,"props":2620,"children":2621},{"class":637,"line":477},[2622],{"type":606,"tag":635,"props":2623,"children":2624},{"style":664},[2625],{"type":611,"value":2626},"    # Efficient grouping using dict\n",{"type":606,"tag":635,"props":2628,"children":2629},{"class":637,"line":488},[2630,2635,2639],{"type":606,"tag":635,"props":2631,"children":2632},{"style":647},[2633],{"type":611,"value":2634},"    categories ",{"type":606,"tag":635,"props":2636,"children":2637},{"style":641},[2638],{"type":611,"value":723},{"type":606,"tag":635,"props":2640,"children":2641},{"style":647},[2642],{"type":611,"value":2643}," {}\n",{"type":606,"tag":635,"props":2645,"children":2646},{"class":637,"line":497},[2647,2651,2655,2659],{"type":606,"tag":635,"props":2648,"children":2649},{"style":641},[2650],{"type":611,"value":737},{"type":606,"tag":635,"props":2652,"children":2653},{"style":647},[2654],{"type":611,"value":1648},{"type":606,"tag":635,"props":2656,"children":2657},{"style":641},[2658],{"type":611,"value":747},{"type":606,"tag":635,"props":2660,"children":2661},{"style":647},[2662],{"type":611,"value":2663}," sales_data:\n",{"type":606,"tag":635,"props":2665,"children":2666},{"class":637,"line":506},[2667,2672,2676,2681,2685],{"type":606,"tag":635,"props":2668,"children":2669},{"style":647},[2670],{"type":611,"value":2671},"        category ",{"type":606,"tag":635,"props":2673,"children":2674},{"style":641},[2675],{"type":611,"value":723},{"type":606,"tag":635,"props":2677,"children":2678},{"style":647},[2679],{"type":611,"value":2680}," item[",{"type":606,"tag":635,"props":2682,"children":2683},{"style":707},[2684],{"type":611,"value":2341},{"type":606,"tag":635,"props":2686,"children":2687},{"style":647},[2688],{"type":611,"value":2689},"]\n",{"type":606,"tag":635,"props":2691,"children":2692},{"class":637,"line":515},[2693,2698,2703,2708,2713],{"type":606,"tag":635,"props":2694,"children":2695},{"style":641},[2696],{"type":611,"value":2697},"        if",{"type":606,"tag":635,"props":2699,"children":2700},{"style":647},[2701],{"type":611,"value":2702}," category ",{"type":606,"tag":635,"props":2704,"children":2705},{"style":641},[2706],{"type":611,"value":2707},"not",{"type":606,"tag":635,"props":2709,"children":2710},{"style":641},[2711],{"type":611,"value":2712}," in",{"type":606,"tag":635,"props":2714,"children":2715},{"style":647},[2716],{"type":611,"value":2717}," categories:\n",{"type":606,"tag":635,"props":2719,"children":2720},{"class":637,"line":524},[2721,2726,2730],{"type":606,"tag":635,"props":2722,"children":2723},{"style":647},[2724],{"type":611,"value":2725},"            categories[category] ",{"type":606,"tag":635,"props":2727,"children":2728},{"style":641},[2729],{"type":611,"value":723},{"type":606,"tag":635,"props":2731,"children":2732},{"style":647},[2733],{"type":611,"value":728},{"type":606,"tag":635,"props":2735,"children":2736},{"class":637,"line":533},[2737],{"type":606,"tag":635,"props":2738,"children":2739},{"style":647},[2740],{"type":611,"value":2741},"        categories[category].append(item)\n",{"type":606,"tag":635,"props":2743,"children":2744},{"class":637,"line":544},[2745],{"type":606,"tag":635,"props":2746,"children":2747},{"style":647},[2748],{"type":611,"value":778},{"type":606,"tag":635,"props":2750,"children":2751},{"class":637,"line":553},[2752],{"type":606,"tag":635,"props":2753,"children":2754},{"style":664},[2755],{"type":611,"value":2756},"    # Calculate totals efficiently\n",{"type":606,"tag":635,"props":2758,"children":2759},{"class":637,"line":562},[2760,2765,2769],{"type":606,"tag":635,"props":2761,"children":2762},{"style":647},[2763],{"type":611,"value":2764},"    category_totals ",{"type":606,"tag":635,"props":2766,"children":2767},{"style":641},[2768],{"type":611,"value":723},{"type":606,"tag":635,"props":2770,"children":2771},{"style":647},[2772],{"type":611,"value":2643},{"type":606,"tag":635,"props":2774,"children":2775},{"class":637,"line":571},[2776,2780,2785,2789],{"type":606,"tag":635,"props":2777,"children":2778},{"style":641},[2779],{"type":611,"value":737},{"type":606,"tag":635,"props":2781,"children":2782},{"style":647},[2783],{"type":611,"value":2784}," category, items ",{"type":606,"tag":635,"props":2786,"children":2787},{"style":641},[2788],{"type":611,"value":747},{"type":606,"tag":635,"props":2790,"children":2791},{"style":647},[2792],{"type":611,"value":2793}," categories.items():\n",{"type":606,"tag":635,"props":2795,"children":2796},{"class":637,"line":580},[2797,2801,2805,2809,2814,2818,2823,2827,2831,2835],{"type":606,"tag":635,"props":2798,"children":2799},{"style":647},[2800],{"type":611,"value":825},{"type":606,"tag":635,"props":2802,"children":2803},{"style":641},[2804],{"type":611,"value":723},{"type":606,"tag":635,"props":2806,"children":2807},{"style":793},[2808],{"type":611,"value":906},{"type":606,"tag":635,"props":2810,"children":2811},{"style":647},[2812],{"type":611,"value":2813},"(item[",{"type":606,"tag":635,"props":2815,"children":2816},{"style":707},[2817],{"type":611,"value":2359},{"type":606,"tag":635,"props":2819,"children":2820},{"style":647},[2821],{"type":611,"value":2822},"] ",{"type":606,"tag":635,"props":2824,"children":2825},{"style":641},[2826],{"type":611,"value":924},{"type":606,"tag":635,"props":2828,"children":2829},{"style":647},[2830],{"type":611,"value":1648},{"type":606,"tag":635,"props":2832,"children":2833},{"style":641},[2834],{"type":611,"value":747},{"type":606,"tag":635,"props":2836,"children":2837},{"style":647},[2838],{"type":611,"value":2839}," items)\n",{"type":606,"tag":635,"props":2841,"children":2842},{"class":637,"line":589},[2843,2848,2852],{"type":606,"tag":635,"props":2844,"children":2845},{"style":647},[2846],{"type":611,"value":2847},"        category_totals[category] ",{"type":606,"tag":635,"props":2849,"children":2850},{"style":641},[2851],{"type":611,"value":723},{"type":606,"tag":635,"props":2853,"children":2854},{"style":647},[2855],{"type":611,"value":855},{"type":606,"tag":635,"props":2857,"children":2859},{"class":637,"line":2858},64,[2860],{"type":606,"tag":635,"props":2861,"children":2862},{"style":647},[2863],{"type":611,"value":778},{"type":606,"tag":635,"props":2865,"children":2867},{"class":637,"line":2866},65,[2868,2872,2876,2880,2885,2890],{"type":606,"tag":635,"props":2869,"children":2870},{"style":793},[2871],{"type":611,"value":2038},{"type":606,"tag":635,"props":2873,"children":2874},{"style":647},[2875],{"type":611,"value":974},{"type":606,"tag":635,"props":2877,"children":2878},{"style":707},[2879],{"type":611,"value":1347},{"type":606,"tag":635,"props":2881,"children":2882},{"style":793},[2883],{"type":611,"value":2884},"\\n",{"type":606,"tag":635,"props":2886,"children":2887},{"style":707},[2888],{"type":611,"value":2889},"Category Sales:\"",{"type":606,"tag":635,"props":2891,"children":2892},{"style":647},[2893],{"type":611,"value":1199},{"type":606,"tag":635,"props":2895,"children":2897},{"class":637,"line":2896},66,[2898,2902,2907,2911],{"type":606,"tag":635,"props":2899,"children":2900},{"style":641},[2901],{"type":611,"value":737},{"type":606,"tag":635,"props":2903,"children":2904},{"style":647},[2905],{"type":611,"value":2906}," category, total ",{"type":606,"tag":635,"props":2908,"children":2909},{"style":641},[2910],{"type":611,"value":747},{"type":606,"tag":635,"props":2912,"children":2913},{"style":647},[2914],{"type":611,"value":2915}," category_totals.items():\n",{"type":606,"tag":635,"props":2917,"children":2919},{"class":637,"line":2918},67,[2920,2925,2929,2933,2937,2941,2946,2950,2955,2959,2964,2968,2972],{"type":606,"tag":635,"props":2921,"children":2922},{"style":793},[2923],{"type":611,"value":2924},"        print",{"type":606,"tag":635,"props":2926,"children":2927},{"style":647},[2928],{"type":611,"value":974},{"type":606,"tag":635,"props":2930,"children":2931},{"style":641},[2932],{"type":611,"value":1164},{"type":606,"tag":635,"props":2934,"children":2935},{"style":707},[2936],{"type":611,"value":1347},{"type":606,"tag":635,"props":2938,"children":2939},{"style":793},[2940],{"type":611,"value":1174},{"type":606,"tag":635,"props":2942,"children":2943},{"style":647},[2944],{"type":611,"value":2945},"category",{"type":606,"tag":635,"props":2947,"children":2948},{"style":793},[2949],{"type":611,"value":1189},{"type":606,"tag":635,"props":2951,"children":2952},{"style":707},[2953],{"type":611,"value":2954},": $",{"type":606,"tag":635,"props":2956,"children":2957},{"style":793},[2958],{"type":611,"value":1174},{"type":606,"tag":635,"props":2960,"children":2961},{"style":647},[2962],{"type":611,"value":2963},"total",{"type":606,"tag":635,"props":2965,"children":2966},{"style":793},[2967],{"type":611,"value":1189},{"type":606,"tag":635,"props":2969,"children":2970},{"style":707},[2971],{"type":611,"value":1347},{"type":606,"tag":635,"props":2973,"children":2974},{"style":647},[2975],{"type":611,"value":1199},{"type":606,"tag":635,"props":2977,"children":2979},{"class":637,"line":2978},68,[2980],{"type":606,"tag":635,"props":2981,"children":2982},{"style":647},[2983],{"type":611,"value":778},{"type":606,"tag":635,"props":2985,"children":2987},{"class":637,"line":2986},69,[2988,2992],{"type":606,"tag":635,"props":2989,"children":2990},{"style":641},[2991],{"type":611,"value":850},{"type":606,"tag":635,"props":2993,"children":2994},{"style":647},[2995],{"type":611,"value":2996}," categories\n",{"type":606,"tag":635,"props":2998,"children":3000},{"class":637,"line":2999},70,[3001],{"type":606,"tag":635,"props":3002,"children":3003},{"emptyLinePlaceholder":13},[3004],{"type":611,"value":658},{"type":606,"tag":635,"props":3006,"children":3008},{"class":637,"line":3007},71,[3009],{"type":606,"tag":635,"props":3010,"children":3011},{"style":647},[3012],{"type":611,"value":3013},"test_lookup_performance()\n",{"type":606,"tag":635,"props":3015,"children":3017},{"class":637,"line":3016},72,[3018],{"type":606,"tag":635,"props":3019,"children":3020},{"style":647},[3021],{"type":611,"value":3022},"efficient_data_processing()\n",{"type":606,"tag":1469,"props":3024,"children":3026},{"id":3025},"list-comprehensions-vs-loops",[3027],{"type":611,"value":3028},"List Comprehensions vs Loops",{"type":606,"tag":620,"props":3030,"children":3031},{},[3032],{"type":606,"tag":624,"props":3033,"children":3035},{"className":626,"code":3034,"language":628,"meta":8,"style":8},"import time\n\ndef compare_list_operations():\n    \"\"\"Compare different ways to create and process lists.\"\"\"\n    \n    numbers = list(range(50000))\n    \n    # Method 1: Traditional loop (slower)\n    start_time = time.time()\n    squares_loop = []\n    for num in numbers:\n        if num % 2 == 0:\n            squares_loop.append(num * num)\n    loop_time = time.time() - start_time\n    \n    # Method 2: List comprehension (faster)\n    start_time = time.time()\n    squares_comp = [num * num for num in numbers if num % 2 == 0]\n    comp_time = time.time() - start_time\n    \n    # Method 3: Generator expression (memory efficient)\n    start_time = time.time()\n    squares_gen = list(num * num for num in numbers if num % 2 == 0)\n    gen_time = time.time() - start_time\n    \n    print(\"List Creation Performance:\")\n    print(f\"Loop:          {loop_time:.4f} seconds\")\n    print(f\"Comprehension: {comp_time:.4f} seconds ({loop_time/comp_time:.1f}x faster)\")\n    print(f\"Generator:     {gen_time:.4f} seconds\")\n    print(f\"Results equal: {squares_loop == squares_comp == squares_gen}\")\n\ndef efficient_string_operations():\n    \"\"\"Show efficient string operations.\"\"\"\n    \n    words = ['hello', 'world', 'python', 'programming', 'optimization']\n    \n    # Slow way - string concatenation in loop\n    start_time = time.time()\n    result_slow = \"\"\n    for word in words * 1000:  # Repeat for timing\n        result_slow += word + \" \"\n    slow_time = time.time() - start_time\n    \n    # Fast way - join method\n    start_time = time.time()\n    result_fast = \" \".join(words * 1000)\n    fast_time = time.time() - start_time\n    \n    print(f\"\\nString Operations:\")\n    print(f\"Concatenation: {slow_time:.4f} seconds\")\n    print(f\"Join method:   {fast_time:.4f} seconds ({slow_time/fast_time:.1f}x faster)\")\n\ncompare_list_operations()\nefficient_string_operations()\n",[3036],{"type":606,"tag":631,"props":3037,"children":3038},{"__ignoreMap":8},[3039,3050,3057,3073,3081,3088,3125,3132,3140,3155,3171,3190,3226,3242,3266,3273,3281,3296,3367,3391,3398,3406,3421,3493,3517,3524,3544,3589,3662,3707,3766,3773,3789,3797,3804,3866,3873,3881,3896,3913,3953,3979,4003,4010,4018,4033,4067,4091,4098,4130,4174,4246,4253,4261],{"type":606,"tag":635,"props":3040,"children":3041},{"class":637,"line":12},[3042,3046],{"type":606,"tag":635,"props":3043,"children":3044},{"style":641},[3045],{"type":611,"value":644},{"type":606,"tag":635,"props":3047,"children":3048},{"style":647},[3049],{"type":611,"value":650},{"type":606,"tag":635,"props":3051,"children":3052},{"class":637,"line":27},[3053],{"type":606,"tag":635,"props":3054,"children":3055},{"emptyLinePlaceholder":13},[3056],{"type":611,"value":658},{"type":606,"tag":635,"props":3058,"children":3059},{"class":637,"line":36},[3060,3064,3069],{"type":606,"tag":635,"props":3061,"children":3062},{"style":641},[3063],{"type":611,"value":690},{"type":606,"tag":635,"props":3065,"children":3066},{"style":693},[3067],{"type":611,"value":3068}," compare_list_operations",{"type":606,"tag":635,"props":3070,"children":3071},{"style":647},[3072],{"type":611,"value":1534},{"type":606,"tag":635,"props":3074,"children":3075},{"class":637,"line":45},[3076],{"type":606,"tag":635,"props":3077,"children":3078},{"style":707},[3079],{"type":611,"value":3080},"    \"\"\"Compare different ways to create and process lists.\"\"\"\n",{"type":606,"tag":635,"props":3082,"children":3083},{"class":637,"line":54},[3084],{"type":606,"tag":635,"props":3085,"children":3086},{"style":647},[3087],{"type":611,"value":778},{"type":606,"tag":635,"props":3089,"children":3090},{"class":637,"line":63},[3091,3096,3100,3104,3108,3112,3116,3121],{"type":606,"tag":635,"props":3092,"children":3093},{"style":647},[3094],{"type":611,"value":3095},"    numbers ",{"type":606,"tag":635,"props":3097,"children":3098},{"style":641},[3099],{"type":611,"value":723},{"type":606,"tag":635,"props":3101,"children":3102},{"style":793},[3103],{"type":611,"value":969},{"type":606,"tag":635,"props":3105,"children":3106},{"style":647},[3107],{"type":611,"value":974},{"type":606,"tag":635,"props":3109,"children":3110},{"style":793},[3111],{"type":611,"value":979},{"type":606,"tag":635,"props":3113,"children":3114},{"style":647},[3115],{"type":611,"value":974},{"type":606,"tag":635,"props":3117,"children":3118},{"style":793},[3119],{"type":611,"value":3120},"50000",{"type":606,"tag":635,"props":3122,"children":3123},{"style":647},[3124],{"type":611,"value":993},{"type":606,"tag":635,"props":3126,"children":3127},{"class":637,"line":72},[3128],{"type":606,"tag":635,"props":3129,"children":3130},{"style":647},[3131],{"type":611,"value":778},{"type":606,"tag":635,"props":3133,"children":3134},{"class":637,"line":81},[3135],{"type":606,"tag":635,"props":3136,"children":3137},{"style":664},[3138],{"type":611,"value":3139},"    # Method 1: Traditional loop (slower)\n",{"type":606,"tag":635,"props":3141,"children":3142},{"class":637,"line":731},[3143,3147,3151],{"type":606,"tag":635,"props":3144,"children":3145},{"style":647},[3146],{"type":611,"value":1712},{"type":606,"tag":635,"props":3148,"children":3149},{"style":641},[3150],{"type":611,"value":723},{"type":606,"tag":635,"props":3152,"children":3153},{"style":647},[3154],{"type":611,"value":1025},{"type":606,"tag":635,"props":3156,"children":3157},{"class":637,"line":99},[3158,3163,3167],{"type":606,"tag":635,"props":3159,"children":3160},{"style":647},[3161],{"type":611,"value":3162},"    squares_loop ",{"type":606,"tag":635,"props":3164,"children":3165},{"style":641},[3166],{"type":611,"value":723},{"type":606,"tag":635,"props":3168,"children":3169},{"style":647},[3170],{"type":611,"value":728},{"type":606,"tag":635,"props":3172,"children":3173},{"class":637,"line":108},[3174,3178,3182,3186],{"type":606,"tag":635,"props":3175,"children":3176},{"style":641},[3177],{"type":611,"value":737},{"type":606,"tag":635,"props":3179,"children":3180},{"style":647},[3181],{"type":611,"value":742},{"type":606,"tag":635,"props":3183,"children":3184},{"style":641},[3185],{"type":611,"value":747},{"type":606,"tag":635,"props":3187,"children":3188},{"style":647},[3189],{"type":611,"value":752},{"type":606,"tag":635,"props":3191,"children":3192},{"class":637,"line":117},[3193,3197,3201,3206,3211,3216,3221],{"type":606,"tag":635,"props":3194,"children":3195},{"style":641},[3196],{"type":611,"value":2697},{"type":606,"tag":635,"props":3198,"children":3199},{"style":647},[3200],{"type":611,"value":742},{"type":606,"tag":635,"props":3202,"children":3203},{"style":641},[3204],{"type":611,"value":3205},"%",{"type":606,"tag":635,"props":3207,"children":3208},{"style":793},[3209],{"type":611,"value":3210}," 2",{"type":606,"tag":635,"props":3212,"children":3213},{"style":641},[3214],{"type":611,"value":3215}," ==",{"type":606,"tag":635,"props":3217,"children":3218},{"style":793},[3219],{"type":611,"value":3220}," 0",{"type":606,"tag":635,"props":3222,"children":3223},{"style":647},[3224],{"type":611,"value":3225},":\n",{"type":606,"tag":635,"props":3227,"children":3228},{"class":637,"line":126},[3229,3234,3238],{"type":606,"tag":635,"props":3230,"children":3231},{"style":647},[3232],{"type":611,"value":3233},"            squares_loop.append(num ",{"type":606,"tag":635,"props":3235,"children":3236},{"style":641},[3237],{"type":611,"value":765},{"type":606,"tag":635,"props":3239,"children":3240},{"style":647},[3241],{"type":611,"value":770},{"type":606,"tag":635,"props":3243,"children":3244},{"class":637,"line":135},[3245,3250,3254,3258,3262],{"type":606,"tag":635,"props":3246,"children":3247},{"style":647},[3248],{"type":611,"value":3249},"    loop_time ",{"type":606,"tag":635,"props":3251,"children":3252},{"style":641},[3253],{"type":611,"value":723},{"type":606,"tag":635,"props":3255,"children":3256},{"style":647},[3257],{"type":611,"value":1059},{"type":606,"tag":635,"props":3259,"children":3260},{"style":641},[3261],{"type":611,"value":1064},{"type":606,"tag":635,"props":3263,"children":3264},{"style":647},[3265],{"type":611,"value":1069},{"type":606,"tag":635,"props":3267,"children":3268},{"class":637,"line":144},[3269],{"type":606,"tag":635,"props":3270,"children":3271},{"style":647},[3272],{"type":611,"value":778},{"type":606,"tag":635,"props":3274,"children":3275},{"class":637,"line":153},[3276],{"type":606,"tag":635,"props":3277,"children":3278},{"style":664},[3279],{"type":611,"value":3280},"    # Method 2: List comprehension (faster)\n",{"type":606,"tag":635,"props":3282,"children":3283},{"class":637,"line":163},[3284,3288,3292],{"type":606,"tag":635,"props":3285,"children":3286},{"style":647},[3287],{"type":611,"value":1712},{"type":606,"tag":635,"props":3289,"children":3290},{"style":641},[3291],{"type":611,"value":723},{"type":606,"tag":635,"props":3293,"children":3294},{"style":647},[3295],{"type":611,"value":1025},{"type":606,"tag":635,"props":3297,"children":3298},{"class":637,"line":172},[3299,3304,3308,3313,3317,3321,3325,3329,3333,3338,3343,3347,3351,3355,3359,3363],{"type":606,"tag":635,"props":3300,"children":3301},{"style":647},[3302],{"type":611,"value":3303},"    squares_comp ",{"type":606,"tag":635,"props":3305,"children":3306},{"style":641},[3307],{"type":611,"value":723},{"type":606,"tag":635,"props":3309,"children":3310},{"style":647},[3311],{"type":611,"value":3312}," [num ",{"type":606,"tag":635,"props":3314,"children":3315},{"style":641},[3316],{"type":611,"value":765},{"type":606,"tag":635,"props":3318,"children":3319},{"style":647},[3320],{"type":611,"value":742},{"type":606,"tag":635,"props":3322,"children":3323},{"style":641},[3324],{"type":611,"value":924},{"type":606,"tag":635,"props":3326,"children":3327},{"style":647},[3328],{"type":611,"value":742},{"type":606,"tag":635,"props":3330,"children":3331},{"style":641},[3332],{"type":611,"value":747},{"type":606,"tag":635,"props":3334,"children":3335},{"style":647},[3336],{"type":611,"value":3337}," numbers ",{"type":606,"tag":635,"props":3339,"children":3340},{"style":641},[3341],{"type":611,"value":3342},"if",{"type":606,"tag":635,"props":3344,"children":3345},{"style":647},[3346],{"type":611,"value":742},{"type":606,"tag":635,"props":3348,"children":3349},{"style":641},[3350],{"type":611,"value":3205},{"type":606,"tag":635,"props":3352,"children":3353},{"style":793},[3354],{"type":611,"value":3210},{"type":606,"tag":635,"props":3356,"children":3357},{"style":641},[3358],{"type":611,"value":3215},{"type":606,"tag":635,"props":3360,"children":3361},{"style":793},[3362],{"type":611,"value":3220},{"type":606,"tag":635,"props":3364,"children":3365},{"style":647},[3366],{"type":611,"value":2689},{"type":606,"tag":635,"props":3368,"children":3369},{"class":637,"line":181},[3370,3375,3379,3383,3387],{"type":606,"tag":635,"props":3371,"children":3372},{"style":647},[3373],{"type":611,"value":3374},"    comp_time ",{"type":606,"tag":635,"props":3376,"children":3377},{"style":641},[3378],{"type":611,"value":723},{"type":606,"tag":635,"props":3380,"children":3381},{"style":647},[3382],{"type":611,"value":1059},{"type":606,"tag":635,"props":3384,"children":3385},{"style":641},[3386],{"type":611,"value":1064},{"type":606,"tag":635,"props":3388,"children":3389},{"style":647},[3390],{"type":611,"value":1069},{"type":606,"tag":635,"props":3392,"children":3393},{"class":637,"line":190},[3394],{"type":606,"tag":635,"props":3395,"children":3396},{"style":647},[3397],{"type":611,"value":778},{"type":606,"tag":635,"props":3399,"children":3400},{"class":637,"line":199},[3401],{"type":606,"tag":635,"props":3402,"children":3403},{"style":664},[3404],{"type":611,"value":3405},"    # Method 3: Generator expression (memory efficient)\n",{"type":606,"tag":635,"props":3407,"children":3408},{"class":637,"line":208},[3409,3413,3417],{"type":606,"tag":635,"props":3410,"children":3411},{"style":647},[3412],{"type":611,"value":1712},{"type":606,"tag":635,"props":3414,"children":3415},{"style":641},[3416],{"type":611,"value":723},{"type":606,"tag":635,"props":3418,"children":3419},{"style":647},[3420],{"type":611,"value":1025},{"type":606,"tag":635,"props":3422,"children":3423},{"class":637,"line":217},[3424,3429,3433,3437,3441,3445,3449,3453,3457,3461,3465,3469,3473,3477,3481,3485,3489],{"type":606,"tag":635,"props":3425,"children":3426},{"style":647},[3427],{"type":611,"value":3428},"    squares_gen ",{"type":606,"tag":635,"props":3430,"children":3431},{"style":641},[3432],{"type":611,"value":723},{"type":606,"tag":635,"props":3434,"children":3435},{"style":793},[3436],{"type":611,"value":969},{"type":606,"tag":635,"props":3438,"children":3439},{"style":647},[3440],{"type":611,"value":911},{"type":606,"tag":635,"props":3442,"children":3443},{"style":641},[3444],{"type":611,"value":765},{"type":606,"tag":635,"props":3446,"children":3447},{"style":647},[3448],{"type":611,"value":742},{"type":606,"tag":635,"props":3450,"children":3451},{"style":641},[3452],{"type":611,"value":924},{"type":606,"tag":635,"props":3454,"children":3455},{"style":647},[3456],{"type":611,"value":742},{"type":606,"tag":635,"props":3458,"children":3459},{"style":641},[3460],{"type":611,"value":747},{"type":606,"tag":635,"props":3462,"children":3463},{"style":647},[3464],{"type":611,"value":3337},{"type":606,"tag":635,"props":3466,"children":3467},{"style":641},[3468],{"type":611,"value":3342},{"type":606,"tag":635,"props":3470,"children":3471},{"style":647},[3472],{"type":611,"value":742},{"type":606,"tag":635,"props":3474,"children":3475},{"style":641},[3476],{"type":611,"value":3205},{"type":606,"tag":635,"props":3478,"children":3479},{"style":793},[3480],{"type":611,"value":3210},{"type":606,"tag":635,"props":3482,"children":3483},{"style":641},[3484],{"type":611,"value":3215},{"type":606,"tag":635,"props":3486,"children":3487},{"style":793},[3488],{"type":611,"value":3220},{"type":606,"tag":635,"props":3490,"children":3491},{"style":647},[3492],{"type":611,"value":1199},{"type":606,"tag":635,"props":3494,"children":3495},{"class":637,"line":227},[3496,3501,3505,3509,3513],{"type":606,"tag":635,"props":3497,"children":3498},{"style":647},[3499],{"type":611,"value":3500},"    gen_time ",{"type":606,"tag":635,"props":3502,"children":3503},{"style":641},[3504],{"type":611,"value":723},{"type":606,"tag":635,"props":3506,"children":3507},{"style":647},[3508],{"type":611,"value":1059},{"type":606,"tag":635,"props":3510,"children":3511},{"style":641},[3512],{"type":611,"value":1064},{"type":606,"tag":635,"props":3514,"children":3515},{"style":647},[3516],{"type":611,"value":1069},{"type":606,"tag":635,"props":3518,"children":3519},{"class":637,"line":236},[3520],{"type":606,"tag":635,"props":3521,"children":3522},{"style":647},[3523],{"type":611,"value":778},{"type":606,"tag":635,"props":3525,"children":3526},{"class":637,"line":245},[3527,3531,3535,3540],{"type":606,"tag":635,"props":3528,"children":3529},{"style":793},[3530],{"type":611,"value":2038},{"type":606,"tag":635,"props":3532,"children":3533},{"style":647},[3534],{"type":611,"value":974},{"type":606,"tag":635,"props":3536,"children":3537},{"style":707},[3538],{"type":611,"value":3539},"\"List Creation Performance:\"",{"type":606,"tag":635,"props":3541,"children":3542},{"style":647},[3543],{"type":611,"value":1199},{"type":606,"tag":635,"props":3545,"children":3546},{"class":637,"line":254},[3547,3551,3555,3559,3564,3568,3573,3577,3581,3585],{"type":606,"tag":635,"props":3548,"children":3549},{"style":793},[3550],{"type":611,"value":2038},{"type":606,"tag":635,"props":3552,"children":3553},{"style":647},[3554],{"type":611,"value":974},{"type":606,"tag":635,"props":3556,"children":3557},{"style":641},[3558],{"type":611,"value":1164},{"type":606,"tag":635,"props":3560,"children":3561},{"style":707},[3562],{"type":611,"value":3563},"\"Loop:          ",{"type":606,"tag":635,"props":3565,"children":3566},{"style":793},[3567],{"type":611,"value":1174},{"type":606,"tag":635,"props":3569,"children":3570},{"style":647},[3571],{"type":611,"value":3572},"loop_time",{"type":606,"tag":635,"props":3574,"children":3575},{"style":641},[3576],{"type":611,"value":1184},{"type":606,"tag":635,"props":3578,"children":3579},{"style":793},[3580],{"type":611,"value":1189},{"type":606,"tag":635,"props":3582,"children":3583},{"style":707},[3584],{"type":611,"value":1194},{"type":606,"tag":635,"props":3586,"children":3587},{"style":647},[3588],{"type":611,"value":1199},{"type":606,"tag":635,"props":3590,"children":3591},{"class":637,"line":263},[3592,3596,3600,3604,3609,3613,3618,3622,3626,3630,3634,3638,3642,3646,3650,3654,3658],{"type":606,"tag":635,"props":3593,"children":3594},{"style":793},[3595],{"type":611,"value":2038},{"type":606,"tag":635,"props":3597,"children":3598},{"style":647},[3599],{"type":611,"value":974},{"type":606,"tag":635,"props":3601,"children":3602},{"style":641},[3603],{"type":611,"value":1164},{"type":606,"tag":635,"props":3605,"children":3606},{"style":707},[3607],{"type":611,"value":3608},"\"Comprehension: ",{"type":606,"tag":635,"props":3610,"children":3611},{"style":793},[3612],{"type":611,"value":1174},{"type":606,"tag":635,"props":3614,"children":3615},{"style":647},[3616],{"type":611,"value":3617},"comp_time",{"type":606,"tag":635,"props":3619,"children":3620},{"style":641},[3621],{"type":611,"value":1184},{"type":606,"tag":635,"props":3623,"children":3624},{"style":793},[3625],{"type":611,"value":1189},{"type":606,"tag":635,"props":3627,"children":3628},{"style":707},[3629],{"type":611,"value":2138},{"type":606,"tag":635,"props":3631,"children":3632},{"style":793},[3633],{"type":611,"value":1174},{"type":606,"tag":635,"props":3635,"children":3636},{"style":647},[3637],{"type":611,"value":3572},{"type":606,"tag":635,"props":3639,"children":3640},{"style":641},[3641],{"type":611,"value":1277},{"type":606,"tag":635,"props":3643,"children":3644},{"style":647},[3645],{"type":611,"value":3617},{"type":606,"tag":635,"props":3647,"children":3648},{"style":641},[3649],{"type":611,"value":1287},{"type":606,"tag":635,"props":3651,"children":3652},{"style":793},[3653],{"type":611,"value":1189},{"type":606,"tag":635,"props":3655,"children":3656},{"style":707},[3657],{"type":611,"value":2168},{"type":606,"tag":635,"props":3659,"children":3660},{"style":647},[3661],{"type":611,"value":1199},{"type":606,"tag":635,"props":3663,"children":3664},{"class":637,"line":272},[3665,3669,3673,3677,3682,3686,3691,3695,3699,3703],{"type":606,"tag":635,"props":3666,"children":3667},{"style":793},[3668],{"type":611,"value":2038},{"type":606,"tag":635,"props":3670,"children":3671},{"style":647},[3672],{"type":611,"value":974},{"type":606,"tag":635,"props":3674,"children":3675},{"style":641},[3676],{"type":611,"value":1164},{"type":606,"tag":635,"props":3678,"children":3679},{"style":707},[3680],{"type":611,"value":3681},"\"Generator:     ",{"type":606,"tag":635,"props":3683,"children":3684},{"style":793},[3685],{"type":611,"value":1174},{"type":606,"tag":635,"props":3687,"children":3688},{"style":647},[3689],{"type":611,"value":3690},"gen_time",{"type":606,"tag":635,"props":3692,"children":3693},{"style":641},[3694],{"type":611,"value":1184},{"type":606,"tag":635,"props":3696,"children":3697},{"style":793},[3698],{"type":611,"value":1189},{"type":606,"tag":635,"props":3700,"children":3701},{"style":707},[3702],{"type":611,"value":1194},{"type":606,"tag":635,"props":3704,"children":3705},{"style":647},[3706],{"type":611,"value":1199},{"type":606,"tag":635,"props":3708,"children":3709},{"class":637,"line":281},[3710,3714,3718,3722,3727,3731,3736,3740,3745,3749,3754,3758,3762],{"type":606,"tag":635,"props":3711,"children":3712},{"style":793},[3713],{"type":611,"value":2038},{"type":606,"tag":635,"props":3715,"children":3716},{"style":647},[3717],{"type":611,"value":974},{"type":606,"tag":635,"props":3719,"children":3720},{"style":641},[3721],{"type":611,"value":1164},{"type":606,"tag":635,"props":3723,"children":3724},{"style":707},[3725],{"type":611,"value":3726},"\"Results equal: ",{"type":606,"tag":635,"props":3728,"children":3729},{"style":793},[3730],{"type":611,"value":1174},{"type":606,"tag":635,"props":3732,"children":3733},{"style":647},[3734],{"type":611,"value":3735},"squares_loop ",{"type":606,"tag":635,"props":3737,"children":3738},{"style":641},[3739],{"type":611,"value":1333},{"type":606,"tag":635,"props":3741,"children":3742},{"style":647},[3743],{"type":611,"value":3744}," squares_comp ",{"type":606,"tag":635,"props":3746,"children":3747},{"style":641},[3748],{"type":611,"value":1333},{"type":606,"tag":635,"props":3750,"children":3751},{"style":647},[3752],{"type":611,"value":3753}," squares_gen",{"type":606,"tag":635,"props":3755,"children":3756},{"style":793},[3757],{"type":611,"value":1189},{"type":606,"tag":635,"props":3759,"children":3760},{"style":707},[3761],{"type":611,"value":1347},{"type":606,"tag":635,"props":3763,"children":3764},{"style":647},[3765],{"type":611,"value":1199},{"type":606,"tag":635,"props":3767,"children":3768},{"class":637,"line":291},[3769],{"type":606,"tag":635,"props":3770,"children":3771},{"emptyLinePlaceholder":13},[3772],{"type":611,"value":658},{"type":606,"tag":635,"props":3774,"children":3775},{"class":637,"line":302},[3776,3780,3785],{"type":606,"tag":635,"props":3777,"children":3778},{"style":641},[3779],{"type":611,"value":690},{"type":606,"tag":635,"props":3781,"children":3782},{"style":693},[3783],{"type":611,"value":3784}," efficient_string_operations",{"type":606,"tag":635,"props":3786,"children":3787},{"style":647},[3788],{"type":611,"value":1534},{"type":606,"tag":635,"props":3790,"children":3791},{"class":637,"line":311},[3792],{"type":606,"tag":635,"props":3793,"children":3794},{"style":707},[3795],{"type":611,"value":3796},"    \"\"\"Show efficient string operations.\"\"\"\n",{"type":606,"tag":635,"props":3798,"children":3799},{"class":637,"line":320},[3800],{"type":606,"tag":635,"props":3801,"children":3802},{"style":647},[3803],{"type":611,"value":778},{"type":606,"tag":635,"props":3805,"children":3806},{"class":637,"line":329},[3807,3812,3816,3821,3826,3830,3835,3839,3844,3848,3853,3857,3862],{"type":606,"tag":635,"props":3808,"children":3809},{"style":647},[3810],{"type":611,"value":3811},"    words ",{"type":606,"tag":635,"props":3813,"children":3814},{"style":641},[3815],{"type":611,"value":723},{"type":606,"tag":635,"props":3817,"children":3818},{"style":647},[3819],{"type":611,"value":3820}," [",{"type":606,"tag":635,"props":3822,"children":3823},{"style":707},[3824],{"type":611,"value":3825},"'hello'",{"type":606,"tag":635,"props":3827,"children":3828},{"style":647},[3829],{"type":611,"value":2336},{"type":606,"tag":635,"props":3831,"children":3832},{"style":707},[3833],{"type":611,"value":3834},"'world'",{"type":606,"tag":635,"props":3836,"children":3837},{"style":647},[3838],{"type":611,"value":2336},{"type":606,"tag":635,"props":3840,"children":3841},{"style":707},[3842],{"type":611,"value":3843},"'python'",{"type":606,"tag":635,"props":3845,"children":3846},{"style":647},[3847],{"type":611,"value":2336},{"type":606,"tag":635,"props":3849,"children":3850},{"style":707},[3851],{"type":611,"value":3852},"'programming'",{"type":606,"tag":635,"props":3854,"children":3855},{"style":647},[3856],{"type":611,"value":2336},{"type":606,"tag":635,"props":3858,"children":3859},{"style":707},[3860],{"type":611,"value":3861},"'optimization'",{"type":606,"tag":635,"props":3863,"children":3864},{"style":647},[3865],{"type":611,"value":2689},{"type":606,"tag":635,"props":3867,"children":3868},{"class":637,"line":338},[3869],{"type":606,"tag":635,"props":3870,"children":3871},{"style":647},[3872],{"type":611,"value":778},{"type":606,"tag":635,"props":3874,"children":3875},{"class":637,"line":347},[3876],{"type":606,"tag":635,"props":3877,"children":3878},{"style":664},[3879],{"type":611,"value":3880},"    # Slow way - string concatenation in loop\n",{"type":606,"tag":635,"props":3882,"children":3883},{"class":637,"line":356},[3884,3888,3892],{"type":606,"tag":635,"props":3885,"children":3886},{"style":647},[3887],{"type":611,"value":1712},{"type":606,"tag":635,"props":3889,"children":3890},{"style":641},[3891],{"type":611,"value":723},{"type":606,"tag":635,"props":3893,"children":3894},{"style":647},[3895],{"type":611,"value":1025},{"type":606,"tag":635,"props":3897,"children":3898},{"class":637,"line":367},[3899,3904,3908],{"type":606,"tag":635,"props":3900,"children":3901},{"style":647},[3902],{"type":611,"value":3903},"    result_slow ",{"type":606,"tag":635,"props":3905,"children":3906},{"style":641},[3907],{"type":611,"value":723},{"type":606,"tag":635,"props":3909,"children":3910},{"style":707},[3911],{"type":611,"value":3912}," \"\"\n",{"type":606,"tag":635,"props":3914,"children":3915},{"class":637,"line":376},[3916,3920,3925,3929,3934,3938,3943,3948],{"type":606,"tag":635,"props":3917,"children":3918},{"style":641},[3919],{"type":611,"value":737},{"type":606,"tag":635,"props":3921,"children":3922},{"style":647},[3923],{"type":611,"value":3924}," word ",{"type":606,"tag":635,"props":3926,"children":3927},{"style":641},[3928],{"type":611,"value":747},{"type":606,"tag":635,"props":3930,"children":3931},{"style":647},[3932],{"type":611,"value":3933}," words ",{"type":606,"tag":635,"props":3935,"children":3936},{"style":641},[3937],{"type":611,"value":765},{"type":606,"tag":635,"props":3939,"children":3940},{"style":793},[3941],{"type":611,"value":3942}," 1000",{"type":606,"tag":635,"props":3944,"children":3945},{"style":647},[3946],{"type":611,"value":3947},":  ",{"type":606,"tag":635,"props":3949,"children":3950},{"style":664},[3951],{"type":611,"value":3952},"# Repeat for timing\n",{"type":606,"tag":635,"props":3954,"children":3955},{"class":637,"line":385},[3956,3961,3965,3969,3974],{"type":606,"tag":635,"props":3957,"children":3958},{"style":647},[3959],{"type":611,"value":3960},"        result_slow ",{"type":606,"tag":635,"props":3962,"children":3963},{"style":641},[3964],{"type":611,"value":830},{"type":606,"tag":635,"props":3966,"children":3967},{"style":647},[3968],{"type":611,"value":3924},{"type":606,"tag":635,"props":3970,"children":3971},{"style":641},[3972],{"type":611,"value":3973},"+",{"type":606,"tag":635,"props":3975,"children":3976},{"style":707},[3977],{"type":611,"value":3978}," \" \"\n",{"type":606,"tag":635,"props":3980,"children":3981},{"class":637,"line":394},[3982,3987,3991,3995,3999],{"type":606,"tag":635,"props":3983,"children":3984},{"style":647},[3985],{"type":611,"value":3986},"    slow_time ",{"type":606,"tag":635,"props":3988,"children":3989},{"style":641},[3990],{"type":611,"value":723},{"type":606,"tag":635,"props":3992,"children":3993},{"style":647},[3994],{"type":611,"value":1059},{"type":606,"tag":635,"props":3996,"children":3997},{"style":641},[3998],{"type":611,"value":1064},{"type":606,"tag":635,"props":4000,"children":4001},{"style":647},[4002],{"type":611,"value":1069},{"type":606,"tag":635,"props":4004,"children":4005},{"class":637,"line":403},[4006],{"type":606,"tag":635,"props":4007,"children":4008},{"style":647},[4009],{"type":611,"value":778},{"type":606,"tag":635,"props":4011,"children":4012},{"class":637,"line":412},[4013],{"type":606,"tag":635,"props":4014,"children":4015},{"style":664},[4016],{"type":611,"value":4017},"    # Fast way - join method\n",{"type":606,"tag":635,"props":4019,"children":4020},{"class":637,"line":423},[4021,4025,4029],{"type":606,"tag":635,"props":4022,"children":4023},{"style":647},[4024],{"type":611,"value":1712},{"type":606,"tag":635,"props":4026,"children":4027},{"style":641},[4028],{"type":611,"value":723},{"type":606,"tag":635,"props":4030,"children":4031},{"style":647},[4032],{"type":611,"value":1025},{"type":606,"tag":635,"props":4034,"children":4035},{"class":637,"line":432},[4036,4041,4045,4050,4055,4059,4063],{"type":606,"tag":635,"props":4037,"children":4038},{"style":647},[4039],{"type":611,"value":4040},"    result_fast ",{"type":606,"tag":635,"props":4042,"children":4043},{"style":641},[4044],{"type":611,"value":723},{"type":606,"tag":635,"props":4046,"children":4047},{"style":707},[4048],{"type":611,"value":4049}," \" \"",{"type":606,"tag":635,"props":4051,"children":4052},{"style":647},[4053],{"type":611,"value":4054},".join(words ",{"type":606,"tag":635,"props":4056,"children":4057},{"style":641},[4058],{"type":611,"value":765},{"type":606,"tag":635,"props":4060,"children":4061},{"style":793},[4062],{"type":611,"value":3942},{"type":606,"tag":635,"props":4064,"children":4065},{"style":647},[4066],{"type":611,"value":1199},{"type":606,"tag":635,"props":4068,"children":4069},{"class":637,"line":441},[4070,4075,4079,4083,4087],{"type":606,"tag":635,"props":4071,"children":4072},{"style":647},[4073],{"type":611,"value":4074},"    fast_time ",{"type":606,"tag":635,"props":4076,"children":4077},{"style":641},[4078],{"type":611,"value":723},{"type":606,"tag":635,"props":4080,"children":4081},{"style":647},[4082],{"type":611,"value":1059},{"type":606,"tag":635,"props":4084,"children":4085},{"style":641},[4086],{"type":611,"value":1064},{"type":606,"tag":635,"props":4088,"children":4089},{"style":647},[4090],{"type":611,"value":1069},{"type":606,"tag":635,"props":4092,"children":4093},{"class":637,"line":450},[4094],{"type":606,"tag":635,"props":4095,"children":4096},{"style":647},[4097],{"type":611,"value":778},{"type":606,"tag":635,"props":4099,"children":4100},{"class":637,"line":459},[4101,4105,4109,4113,4117,4121,4126],{"type":606,"tag":635,"props":4102,"children":4103},{"style":793},[4104],{"type":611,"value":2038},{"type":606,"tag":635,"props":4106,"children":4107},{"style":647},[4108],{"type":611,"value":974},{"type":606,"tag":635,"props":4110,"children":4111},{"style":641},[4112],{"type":611,"value":1164},{"type":606,"tag":635,"props":4114,"children":4115},{"style":707},[4116],{"type":611,"value":1347},{"type":606,"tag":635,"props":4118,"children":4119},{"style":793},[4120],{"type":611,"value":2884},{"type":606,"tag":635,"props":4122,"children":4123},{"style":707},[4124],{"type":611,"value":4125},"String Operations:\"",{"type":606,"tag":635,"props":4127,"children":4128},{"style":647},[4129],{"type":611,"value":1199},{"type":606,"tag":635,"props":4131,"children":4132},{"class":637,"line":468},[4133,4137,4141,4145,4150,4154,4158,4162,4166,4170],{"type":606,"tag":635,"props":4134,"children":4135},{"style":793},[4136],{"type":611,"value":2038},{"type":606,"tag":635,"props":4138,"children":4139},{"style":647},[4140],{"type":611,"value":974},{"type":606,"tag":635,"props":4142,"children":4143},{"style":641},[4144],{"type":611,"value":1164},{"type":606,"tag":635,"props":4146,"children":4147},{"style":707},[4148],{"type":611,"value":4149},"\"Concatenation: ",{"type":606,"tag":635,"props":4151,"children":4152},{"style":793},[4153],{"type":611,"value":1174},{"type":606,"tag":635,"props":4155,"children":4156},{"style":647},[4157],{"type":611,"value":1179},{"type":606,"tag":635,"props":4159,"children":4160},{"style":641},[4161],{"type":611,"value":1184},{"type":606,"tag":635,"props":4163,"children":4164},{"style":793},[4165],{"type":611,"value":1189},{"type":606,"tag":635,"props":4167,"children":4168},{"style":707},[4169],{"type":611,"value":1194},{"type":606,"tag":635,"props":4171,"children":4172},{"style":647},[4173],{"type":611,"value":1199},{"type":606,"tag":635,"props":4175,"children":4176},{"class":637,"line":477},[4177,4181,4185,4189,4194,4198,4202,4206,4210,4214,4218,4222,4226,4230,4234,4238,4242],{"type":606,"tag":635,"props":4178,"children":4179},{"style":793},[4180],{"type":611,"value":2038},{"type":606,"tag":635,"props":4182,"children":4183},{"style":647},[4184],{"type":611,"value":974},{"type":606,"tag":635,"props":4186,"children":4187},{"style":641},[4188],{"type":611,"value":1164},{"type":606,"tag":635,"props":4190,"children":4191},{"style":707},[4192],{"type":611,"value":4193},"\"Join method:   ",{"type":606,"tag":635,"props":4195,"children":4196},{"style":793},[4197],{"type":611,"value":1174},{"type":606,"tag":635,"props":4199,"children":4200},{"style":647},[4201],{"type":611,"value":1228},{"type":606,"tag":635,"props":4203,"children":4204},{"style":641},[4205],{"type":611,"value":1184},{"type":606,"tag":635,"props":4207,"children":4208},{"style":793},[4209],{"type":611,"value":1189},{"type":606,"tag":635,"props":4211,"children":4212},{"style":707},[4213],{"type":611,"value":2138},{"type":606,"tag":635,"props":4215,"children":4216},{"style":793},[4217],{"type":611,"value":1174},{"type":606,"tag":635,"props":4219,"children":4220},{"style":647},[4221],{"type":611,"value":1179},{"type":606,"tag":635,"props":4223,"children":4224},{"style":641},[4225],{"type":611,"value":1277},{"type":606,"tag":635,"props":4227,"children":4228},{"style":647},[4229],{"type":611,"value":1228},{"type":606,"tag":635,"props":4231,"children":4232},{"style":641},[4233],{"type":611,"value":1287},{"type":606,"tag":635,"props":4235,"children":4236},{"style":793},[4237],{"type":611,"value":1189},{"type":606,"tag":635,"props":4239,"children":4240},{"style":707},[4241],{"type":611,"value":2168},{"type":606,"tag":635,"props":4243,"children":4244},{"style":647},[4245],{"type":611,"value":1199},{"type":606,"tag":635,"props":4247,"children":4248},{"class":637,"line":488},[4249],{"type":606,"tag":635,"props":4250,"children":4251},{"emptyLinePlaceholder":13},[4252],{"type":611,"value":658},{"type":606,"tag":635,"props":4254,"children":4255},{"class":637,"line":497},[4256],{"type":606,"tag":635,"props":4257,"children":4258},{"style":647},[4259],{"type":611,"value":4260},"compare_list_operations()\n",{"type":606,"tag":635,"props":4262,"children":4263},{"class":637,"line":506},[4264],{"type":606,"tag":635,"props":4265,"children":4266},{"style":647},[4267],{"type":611,"value":4268},"efficient_string_operations()\n",{"type":606,"tag":1353,"props":4270,"children":4272},{"id":4271},"performance-optimization-techniques",[4273],{"type":611,"value":4274},"📋 Performance Optimization Techniques",{"type":606,"tag":4276,"props":4277,"children":4278},"table",{},[4279,4303],{"type":606,"tag":4280,"props":4281,"children":4282},"thead",{},[4283],{"type":606,"tag":4284,"props":4285,"children":4286},"tr",{},[4287,4293,4298],{"type":606,"tag":4288,"props":4289,"children":4290},"th",{},[4291],{"type":611,"value":4292},"Technique",{"type":606,"tag":4288,"props":4294,"children":4295},{},[4296],{"type":611,"value":4297},"Use Case",{"type":606,"tag":4288,"props":4299,"children":4300},{},[4301],{"type":611,"value":4302},"Performance Gain",{"type":606,"tag":4304,"props":4305,"children":4306},"tbody",{},[4307,4329,4350,4371,4392,4413],{"type":606,"tag":4284,"props":4308,"children":4309},{},[4310,4319,4324],{"type":606,"tag":4311,"props":4312,"children":4313},"td",{},[4314],{"type":606,"tag":1375,"props":4315,"children":4316},{},[4317],{"type":611,"value":4318},"List Comprehensions",{"type":606,"tag":4311,"props":4320,"children":4321},{},[4322],{"type":611,"value":4323},"Creating/filtering lists",{"type":606,"tag":4311,"props":4325,"children":4326},{},[4327],{"type":611,"value":4328},"2-3x faster than loops",{"type":606,"tag":4284,"props":4330,"children":4331},{},[4332,4340,4345],{"type":606,"tag":4311,"props":4333,"children":4334},{},[4335],{"type":606,"tag":1375,"props":4336,"children":4337},{},[4338],{"type":611,"value":4339},"Set/Dict Lookups",{"type":606,"tag":4311,"props":4341,"children":4342},{},[4343],{"type":611,"value":4344},"Checking membership",{"type":606,"tag":4311,"props":4346,"children":4347},{},[4348],{"type":611,"value":4349},"100x+ faster than lists",{"type":606,"tag":4284,"props":4351,"children":4352},{},[4353,4361,4366],{"type":606,"tag":4311,"props":4354,"children":4355},{},[4356],{"type":606,"tag":1375,"props":4357,"children":4358},{},[4359],{"type":611,"value":4360},"Generator Expressions",{"type":606,"tag":4311,"props":4362,"children":4363},{},[4364],{"type":611,"value":4365},"Memory-efficient iteration",{"type":606,"tag":4311,"props":4367,"children":4368},{},[4369],{"type":611,"value":4370},"Constant memory usage",{"type":606,"tag":4284,"props":4372,"children":4373},{},[4374,4382,4387],{"type":606,"tag":4311,"props":4375,"children":4376},{},[4377],{"type":606,"tag":1375,"props":4378,"children":4379},{},[4380],{"type":611,"value":4381},"Built-in Functions",{"type":606,"tag":4311,"props":4383,"children":4384},{},[4385],{"type":611,"value":4386},"Common operations",{"type":606,"tag":4311,"props":4388,"children":4389},{},[4390],{"type":611,"value":4391},"Optimized C implementations",{"type":606,"tag":4284,"props":4393,"children":4394},{},[4395,4403,4408],{"type":606,"tag":4311,"props":4396,"children":4397},{},[4398],{"type":606,"tag":1375,"props":4399,"children":4400},{},[4401],{"type":611,"value":4402},"String .join()",{"type":606,"tag":4311,"props":4404,"children":4405},{},[4406],{"type":611,"value":4407},"Concatenating strings",{"type":606,"tag":4311,"props":4409,"children":4410},{},[4411],{"type":611,"value":4412},"10x+ faster than +=",{"type":606,"tag":4284,"props":4414,"children":4415},{},[4416,4424,4429],{"type":606,"tag":4311,"props":4417,"children":4418},{},[4419],{"type":606,"tag":1375,"props":4420,"children":4421},{},[4422],{"type":611,"value":4423},"Local Variables",{"type":606,"tag":4311,"props":4425,"children":4426},{},[4427],{"type":611,"value":4428},"Frequent access",{"type":606,"tag":4311,"props":4430,"children":4431},{},[4432],{"type":611,"value":4433},"Faster than global lookup",{"type":606,"tag":1353,"props":4435,"children":4437},{"id":4436},"profiling-and-measurement",[4438],{"type":611,"value":4439},"🔧 Profiling and Measurement",{"type":606,"tag":1469,"props":4441,"children":4443},{"id":4442},"simple-timing-functions",[4444],{"type":611,"value":4445},"Simple Timing Functions",{"type":606,"tag":620,"props":4447,"children":4448},{},[4449],{"type":606,"tag":624,"props":4450,"children":4452},{"className":626,"code":4451,"language":628,"meta":8,"style":8},"import time\nfrom functools import wraps\n\ndef timing_decorator(func):\n    \"\"\"Decorator to measure function execution time.\"\"\"\n    @wraps(func)\n    def wrapper(*args, **kwargs):\n        start_time = time.time()\n        result = func(*args, **kwargs)\n        end_time = time.time()\n        print(f\"{func.__name__} took {end_time - start_time:.4f} seconds\")\n        return result\n    return wrapper\n\n@timing_decorator\ndef process_data_slow(data):\n    \"\"\"Process data using slow methods.\"\"\"\n    result = []\n    for item in data:\n        if item % 2 == 0:\n            result.append(item ** 2)\n    return result\n\n@timing_decorator\ndef process_data_fast(data):\n    \"\"\"Process data using fast methods.\"\"\"\n    return [item ** 2 for item in data if item % 2 == 0]\n\ndef compare_algorithms():\n    \"\"\"Compare algorithm performance.\"\"\"\n    \n    # Test with different data sizes\n    sizes = [1000, 5000, 10000]\n    \n    for size in sizes:\n        data = list(range(size))\n        print(f\"\\nProcessing {size:,} items:\")\n        \n        slow_result = process_data_slow(data)\n        fast_result = process_data_fast(data)\n        \n        print(f\"Results match: {slow_result == fast_result}\")\n\ndef memory_efficient_processing():\n    \"\"\"Show memory-efficient data processing.\"\"\"\n    \n    def count_even_numbers_memory_heavy(max_num):\n        \"\"\"Memory-heavy approach - creates full list.\"\"\"\n        numbers = list(range(max_num))\n        even_numbers = [num for num in numbers if num % 2 == 0]\n        return len(even_numbers)\n    \n    def count_even_numbers_memory_light(max_num):\n        \"\"\"Memory-light approach - uses generator.\"\"\"\n        even_count = sum(1 for num in range(max_num) if num % 2 == 0)\n        return even_count\n    \n    # Test with large numbers\n    test_size = 1000000\n    \n    print(f\"\\nCounting even numbers up to {test_size:,}:\")\n    \n    # Time and compare both approaches\n    start_time = time.time()\n    result1 = count_even_numbers_memory_heavy(test_size)\n    heavy_time = time.time() - start_time\n    \n    start_time = time.time()\n    result2 = count_even_numbers_memory_light(test_size)\n    light_time = time.time() - start_time\n    \n    print(f\"Memory-heavy: {heavy_time:.4f} seconds, result: {result1:,}\")\n    print(f\"Memory-light: {light_time:.4f} seconds, result: {result2:,}\")\n    print(f\"Results match: {result1 == result2}\")\n\ncompare_algorithms()\nmemory_efficient_processing()\n",[4453],{"type":606,"tag":631,"props":4454,"children":4455},{"__ignoreMap":8},[4456,4467,4489,4496,4513,4521,4534,4570,4586,4620,4636,4708,4721,4733,4740,4748,4765,4773,4788,4808,4839,4859,4870,4877,4884,4900,4908,4973,4980,4996,5004,5011,5019,5060,5067,5088,5117,5172,5180,5197,5214,5221,5268,5275,5291,5299,5306,5323,5331,5360,5420,5437,5444,5460,5468,5542,5554,5561,5569,5586,5593,5647,5654,5662,5677,5694,5718,5725,5740,5757,5781,5788,5855,5922,5972,5980,5989],{"type":606,"tag":635,"props":4457,"children":4458},{"class":637,"line":12},[4459,4463],{"type":606,"tag":635,"props":4460,"children":4461},{"style":641},[4462],{"type":611,"value":644},{"type":606,"tag":635,"props":4464,"children":4465},{"style":647},[4466],{"type":611,"value":650},{"type":606,"tag":635,"props":4468,"children":4469},{"class":637,"line":27},[4470,4475,4480,4484],{"type":606,"tag":635,"props":4471,"children":4472},{"style":641},[4473],{"type":611,"value":4474},"from",{"type":606,"tag":635,"props":4476,"children":4477},{"style":647},[4478],{"type":611,"value":4479}," functools ",{"type":606,"tag":635,"props":4481,"children":4482},{"style":641},[4483],{"type":611,"value":644},{"type":606,"tag":635,"props":4485,"children":4486},{"style":647},[4487],{"type":611,"value":4488}," wraps\n",{"type":606,"tag":635,"props":4490,"children":4491},{"class":637,"line":36},[4492],{"type":606,"tag":635,"props":4493,"children":4494},{"emptyLinePlaceholder":13},[4495],{"type":611,"value":658},{"type":606,"tag":635,"props":4497,"children":4498},{"class":637,"line":45},[4499,4503,4508],{"type":606,"tag":635,"props":4500,"children":4501},{"style":641},[4502],{"type":611,"value":690},{"type":606,"tag":635,"props":4504,"children":4505},{"style":693},[4506],{"type":611,"value":4507}," timing_decorator",{"type":606,"tag":635,"props":4509,"children":4510},{"style":647},[4511],{"type":611,"value":4512},"(func):\n",{"type":606,"tag":635,"props":4514,"children":4515},{"class":637,"line":54},[4516],{"type":606,"tag":635,"props":4517,"children":4518},{"style":707},[4519],{"type":611,"value":4520},"    \"\"\"Decorator to measure function execution time.\"\"\"\n",{"type":606,"tag":635,"props":4522,"children":4523},{"class":637,"line":63},[4524,4529],{"type":606,"tag":635,"props":4525,"children":4526},{"style":693},[4527],{"type":611,"value":4528},"    @wraps",{"type":606,"tag":635,"props":4530,"children":4531},{"style":647},[4532],{"type":611,"value":4533},"(func)\n",{"type":606,"tag":635,"props":4535,"children":4536},{"class":637,"line":72},[4537,4542,4547,4551,4555,4560,4565],{"type":606,"tag":635,"props":4538,"children":4539},{"style":641},[4540],{"type":611,"value":4541},"    def",{"type":606,"tag":635,"props":4543,"children":4544},{"style":693},[4545],{"type":611,"value":4546}," wrapper",{"type":606,"tag":635,"props":4548,"children":4549},{"style":647},[4550],{"type":611,"value":974},{"type":606,"tag":635,"props":4552,"children":4553},{"style":641},[4554],{"type":611,"value":765},{"type":606,"tag":635,"props":4556,"children":4557},{"style":647},[4558],{"type":611,"value":4559},"args, ",{"type":606,"tag":635,"props":4561,"children":4562},{"style":641},[4563],{"type":611,"value":4564},"**",{"type":606,"tag":635,"props":4566,"children":4567},{"style":647},[4568],{"type":611,"value":4569},"kwargs):\n",{"type":606,"tag":635,"props":4571,"children":4572},{"class":637,"line":81},[4573,4578,4582],{"type":606,"tag":635,"props":4574,"children":4575},{"style":647},[4576],{"type":611,"value":4577},"        start_time ",{"type":606,"tag":635,"props":4579,"children":4580},{"style":641},[4581],{"type":611,"value":723},{"type":606,"tag":635,"props":4583,"children":4584},{"style":647},[4585],{"type":611,"value":1025},{"type":606,"tag":635,"props":4587,"children":4588},{"class":637,"line":731},[4589,4594,4598,4603,4607,4611,4615],{"type":606,"tag":635,"props":4590,"children":4591},{"style":647},[4592],{"type":611,"value":4593},"        result ",{"type":606,"tag":635,"props":4595,"children":4596},{"style":641},[4597],{"type":611,"value":723},{"type":606,"tag":635,"props":4599,"children":4600},{"style":647},[4601],{"type":611,"value":4602}," func(",{"type":606,"tag":635,"props":4604,"children":4605},{"style":641},[4606],{"type":611,"value":765},{"type":606,"tag":635,"props":4608,"children":4609},{"style":647},[4610],{"type":611,"value":4559},{"type":606,"tag":635,"props":4612,"children":4613},{"style":641},[4614],{"type":611,"value":4564},{"type":606,"tag":635,"props":4616,"children":4617},{"style":647},[4618],{"type":611,"value":4619},"kwargs)\n",{"type":606,"tag":635,"props":4621,"children":4622},{"class":637,"line":99},[4623,4628,4632],{"type":606,"tag":635,"props":4624,"children":4625},{"style":647},[4626],{"type":611,"value":4627},"        end_time ",{"type":606,"tag":635,"props":4629,"children":4630},{"style":641},[4631],{"type":611,"value":723},{"type":606,"tag":635,"props":4633,"children":4634},{"style":647},[4635],{"type":611,"value":1025},{"type":606,"tag":635,"props":4637,"children":4638},{"class":637,"line":108},[4639,4643,4647,4651,4655,4659,4664,4669,4674,4678,4683,4687,4692,4696,4700,4704],{"type":606,"tag":635,"props":4640,"children":4641},{"style":793},[4642],{"type":611,"value":2924},{"type":606,"tag":635,"props":4644,"children":4645},{"style":647},[4646],{"type":611,"value":974},{"type":606,"tag":635,"props":4648,"children":4649},{"style":641},[4650],{"type":611,"value":1164},{"type":606,"tag":635,"props":4652,"children":4653},{"style":707},[4654],{"type":611,"value":1347},{"type":606,"tag":635,"props":4656,"children":4657},{"style":793},[4658],{"type":611,"value":1174},{"type":606,"tag":635,"props":4660,"children":4661},{"style":647},[4662],{"type":611,"value":4663},"func.",{"type":606,"tag":635,"props":4665,"children":4666},{"style":793},[4667],{"type":611,"value":4668},"__name__}",{"type":606,"tag":635,"props":4670,"children":4671},{"style":707},[4672],{"type":611,"value":4673}," took ",{"type":606,"tag":635,"props":4675,"children":4676},{"style":793},[4677],{"type":611,"value":1174},{"type":606,"tag":635,"props":4679,"children":4680},{"style":647},[4681],{"type":611,"value":4682},"end_time ",{"type":606,"tag":635,"props":4684,"children":4685},{"style":641},[4686],{"type":611,"value":1064},{"type":606,"tag":635,"props":4688,"children":4689},{"style":647},[4690],{"type":611,"value":4691}," start_time",{"type":606,"tag":635,"props":4693,"children":4694},{"style":641},[4695],{"type":611,"value":1184},{"type":606,"tag":635,"props":4697,"children":4698},{"style":793},[4699],{"type":611,"value":1189},{"type":606,"tag":635,"props":4701,"children":4702},{"style":707},[4703],{"type":611,"value":1194},{"type":606,"tag":635,"props":4705,"children":4706},{"style":647},[4707],{"type":611,"value":1199},{"type":606,"tag":635,"props":4709,"children":4710},{"class":637,"line":117},[4711,4716],{"type":606,"tag":635,"props":4712,"children":4713},{"style":641},[4714],{"type":611,"value":4715},"        return",{"type":606,"tag":635,"props":4717,"children":4718},{"style":647},[4719],{"type":611,"value":4720}," result\n",{"type":606,"tag":635,"props":4722,"children":4723},{"class":637,"line":126},[4724,4728],{"type":606,"tag":635,"props":4725,"children":4726},{"style":641},[4727],{"type":611,"value":850},{"type":606,"tag":635,"props":4729,"children":4730},{"style":647},[4731],{"type":611,"value":4732}," wrapper\n",{"type":606,"tag":635,"props":4734,"children":4735},{"class":637,"line":135},[4736],{"type":606,"tag":635,"props":4737,"children":4738},{"emptyLinePlaceholder":13},[4739],{"type":611,"value":658},{"type":606,"tag":635,"props":4741,"children":4742},{"class":637,"line":144},[4743],{"type":606,"tag":635,"props":4744,"children":4745},{"style":693},[4746],{"type":611,"value":4747},"@timing_decorator\n",{"type":606,"tag":635,"props":4749,"children":4750},{"class":637,"line":153},[4751,4755,4760],{"type":606,"tag":635,"props":4752,"children":4753},{"style":641},[4754],{"type":611,"value":690},{"type":606,"tag":635,"props":4756,"children":4757},{"style":693},[4758],{"type":611,"value":4759}," process_data_slow",{"type":606,"tag":635,"props":4761,"children":4762},{"style":647},[4763],{"type":611,"value":4764},"(data):\n",{"type":606,"tag":635,"props":4766,"children":4767},{"class":637,"line":163},[4768],{"type":606,"tag":635,"props":4769,"children":4770},{"style":707},[4771],{"type":611,"value":4772},"    \"\"\"Process data using slow methods.\"\"\"\n",{"type":606,"tag":635,"props":4774,"children":4775},{"class":637,"line":172},[4776,4780,4784],{"type":606,"tag":635,"props":4777,"children":4778},{"style":647},[4779],{"type":611,"value":718},{"type":606,"tag":635,"props":4781,"children":4782},{"style":641},[4783],{"type":611,"value":723},{"type":606,"tag":635,"props":4785,"children":4786},{"style":647},[4787],{"type":611,"value":728},{"type":606,"tag":635,"props":4789,"children":4790},{"class":637,"line":181},[4791,4795,4799,4803],{"type":606,"tag":635,"props":4792,"children":4793},{"style":641},[4794],{"type":611,"value":737},{"type":606,"tag":635,"props":4796,"children":4797},{"style":647},[4798],{"type":611,"value":1648},{"type":606,"tag":635,"props":4800,"children":4801},{"style":641},[4802],{"type":611,"value":747},{"type":606,"tag":635,"props":4804,"children":4805},{"style":647},[4806],{"type":611,"value":4807}," data:\n",{"type":606,"tag":635,"props":4809,"children":4810},{"class":637,"line":190},[4811,4815,4819,4823,4827,4831,4835],{"type":606,"tag":635,"props":4812,"children":4813},{"style":641},[4814],{"type":611,"value":2697},{"type":606,"tag":635,"props":4816,"children":4817},{"style":647},[4818],{"type":611,"value":1648},{"type":606,"tag":635,"props":4820,"children":4821},{"style":641},[4822],{"type":611,"value":3205},{"type":606,"tag":635,"props":4824,"children":4825},{"style":793},[4826],{"type":611,"value":3210},{"type":606,"tag":635,"props":4828,"children":4829},{"style":641},[4830],{"type":611,"value":3215},{"type":606,"tag":635,"props":4832,"children":4833},{"style":793},[4834],{"type":611,"value":3220},{"type":606,"tag":635,"props":4836,"children":4837},{"style":647},[4838],{"type":611,"value":3225},{"type":606,"tag":635,"props":4840,"children":4841},{"class":637,"line":199},[4842,4847,4851,4855],{"type":606,"tag":635,"props":4843,"children":4844},{"style":647},[4845],{"type":611,"value":4846},"            result.append(item ",{"type":606,"tag":635,"props":4848,"children":4849},{"style":641},[4850],{"type":611,"value":4564},{"type":606,"tag":635,"props":4852,"children":4853},{"style":793},[4854],{"type":611,"value":3210},{"type":606,"tag":635,"props":4856,"children":4857},{"style":647},[4858],{"type":611,"value":1199},{"type":606,"tag":635,"props":4860,"children":4861},{"class":637,"line":208},[4862,4866],{"type":606,"tag":635,"props":4863,"children":4864},{"style":641},[4865],{"type":611,"value":850},{"type":606,"tag":635,"props":4867,"children":4868},{"style":647},[4869],{"type":611,"value":4720},{"type":606,"tag":635,"props":4871,"children":4872},{"class":637,"line":217},[4873],{"type":606,"tag":635,"props":4874,"children":4875},{"emptyLinePlaceholder":13},[4876],{"type":611,"value":658},{"type":606,"tag":635,"props":4878,"children":4879},{"class":637,"line":227},[4880],{"type":606,"tag":635,"props":4881,"children":4882},{"style":693},[4883],{"type":611,"value":4747},{"type":606,"tag":635,"props":4885,"children":4886},{"class":637,"line":236},[4887,4891,4896],{"type":606,"tag":635,"props":4888,"children":4889},{"style":641},[4890],{"type":611,"value":690},{"type":606,"tag":635,"props":4892,"children":4893},{"style":693},[4894],{"type":611,"value":4895}," process_data_fast",{"type":606,"tag":635,"props":4897,"children":4898},{"style":647},[4899],{"type":611,"value":4764},{"type":606,"tag":635,"props":4901,"children":4902},{"class":637,"line":245},[4903],{"type":606,"tag":635,"props":4904,"children":4905},{"style":707},[4906],{"type":611,"value":4907},"    \"\"\"Process data using fast methods.\"\"\"\n",{"type":606,"tag":635,"props":4909,"children":4910},{"class":637,"line":254},[4911,4915,4920,4924,4928,4932,4936,4940,4945,4949,4953,4957,4961,4965,4969],{"type":606,"tag":635,"props":4912,"children":4913},{"style":641},[4914],{"type":611,"value":850},{"type":606,"tag":635,"props":4916,"children":4917},{"style":647},[4918],{"type":611,"value":4919}," [item ",{"type":606,"tag":635,"props":4921,"children":4922},{"style":641},[4923],{"type":611,"value":4564},{"type":606,"tag":635,"props":4925,"children":4926},{"style":793},[4927],{"type":611,"value":3210},{"type":606,"tag":635,"props":4929,"children":4930},{"style":641},[4931],{"type":611,"value":1643},{"type":606,"tag":635,"props":4933,"children":4934},{"style":647},[4935],{"type":611,"value":1648},{"type":606,"tag":635,"props":4937,"children":4938},{"style":641},[4939],{"type":611,"value":747},{"type":606,"tag":635,"props":4941,"children":4942},{"style":647},[4943],{"type":611,"value":4944}," data ",{"type":606,"tag":635,"props":4946,"children":4947},{"style":641},[4948],{"type":611,"value":3342},{"type":606,"tag":635,"props":4950,"children":4951},{"style":647},[4952],{"type":611,"value":1648},{"type":606,"tag":635,"props":4954,"children":4955},{"style":641},[4956],{"type":611,"value":3205},{"type":606,"tag":635,"props":4958,"children":4959},{"style":793},[4960],{"type":611,"value":3210},{"type":606,"tag":635,"props":4962,"children":4963},{"style":641},[4964],{"type":611,"value":3215},{"type":606,"tag":635,"props":4966,"children":4967},{"style":793},[4968],{"type":611,"value":3220},{"type":606,"tag":635,"props":4970,"children":4971},{"style":647},[4972],{"type":611,"value":2689},{"type":606,"tag":635,"props":4974,"children":4975},{"class":637,"line":263},[4976],{"type":606,"tag":635,"props":4977,"children":4978},{"emptyLinePlaceholder":13},[4979],{"type":611,"value":658},{"type":606,"tag":635,"props":4981,"children":4982},{"class":637,"line":272},[4983,4987,4992],{"type":606,"tag":635,"props":4984,"children":4985},{"style":641},[4986],{"type":611,"value":690},{"type":606,"tag":635,"props":4988,"children":4989},{"style":693},[4990],{"type":611,"value":4991}," compare_algorithms",{"type":606,"tag":635,"props":4993,"children":4994},{"style":647},[4995],{"type":611,"value":1534},{"type":606,"tag":635,"props":4997,"children":4998},{"class":637,"line":281},[4999],{"type":606,"tag":635,"props":5000,"children":5001},{"style":707},[5002],{"type":611,"value":5003},"    \"\"\"Compare algorithm performance.\"\"\"\n",{"type":606,"tag":635,"props":5005,"children":5006},{"class":637,"line":291},[5007],{"type":606,"tag":635,"props":5008,"children":5009},{"style":647},[5010],{"type":611,"value":778},{"type":606,"tag":635,"props":5012,"children":5013},{"class":637,"line":302},[5014],{"type":606,"tag":635,"props":5015,"children":5016},{"style":664},[5017],{"type":611,"value":5018},"    # Test with different data sizes\n",{"type":606,"tag":635,"props":5020,"children":5021},{"class":637,"line":311},[5022,5027,5031,5035,5039,5043,5048,5052,5056],{"type":606,"tag":635,"props":5023,"children":5024},{"style":647},[5025],{"type":611,"value":5026},"    sizes ",{"type":606,"tag":635,"props":5028,"children":5029},{"style":641},[5030],{"type":611,"value":723},{"type":606,"tag":635,"props":5032,"children":5033},{"style":647},[5034],{"type":611,"value":3820},{"type":606,"tag":635,"props":5036,"children":5037},{"style":793},[5038],{"type":611,"value":1750},{"type":606,"tag":635,"props":5040,"children":5041},{"style":647},[5042],{"type":611,"value":2336},{"type":606,"tag":635,"props":5044,"children":5045},{"style":793},[5046],{"type":611,"value":5047},"5000",{"type":606,"tag":635,"props":5049,"children":5050},{"style":647},[5051],{"type":611,"value":2336},{"type":606,"tag":635,"props":5053,"children":5054},{"style":793},[5055],{"type":611,"value":1590},{"type":606,"tag":635,"props":5057,"children":5058},{"style":647},[5059],{"type":611,"value":2689},{"type":606,"tag":635,"props":5061,"children":5062},{"class":637,"line":320},[5063],{"type":606,"tag":635,"props":5064,"children":5065},{"style":647},[5066],{"type":611,"value":778},{"type":606,"tag":635,"props":5068,"children":5069},{"class":637,"line":329},[5070,5074,5079,5083],{"type":606,"tag":635,"props":5071,"children":5072},{"style":641},[5073],{"type":611,"value":737},{"type":606,"tag":635,"props":5075,"children":5076},{"style":647},[5077],{"type":611,"value":5078}," size ",{"type":606,"tag":635,"props":5080,"children":5081},{"style":641},[5082],{"type":611,"value":747},{"type":606,"tag":635,"props":5084,"children":5085},{"style":647},[5086],{"type":611,"value":5087}," sizes:\n",{"type":606,"tag":635,"props":5089,"children":5090},{"class":637,"line":338},[5091,5096,5100,5104,5108,5112],{"type":606,"tag":635,"props":5092,"children":5093},{"style":647},[5094],{"type":611,"value":5095},"        data ",{"type":606,"tag":635,"props":5097,"children":5098},{"style":641},[5099],{"type":611,"value":723},{"type":606,"tag":635,"props":5101,"children":5102},{"style":793},[5103],{"type":611,"value":969},{"type":606,"tag":635,"props":5105,"children":5106},{"style":647},[5107],{"type":611,"value":974},{"type":606,"tag":635,"props":5109,"children":5110},{"style":793},[5111],{"type":611,"value":979},{"type":606,"tag":635,"props":5113,"children":5114},{"style":647},[5115],{"type":611,"value":5116},"(size))\n",{"type":606,"tag":635,"props":5118,"children":5119},{"class":637,"line":347},[5120,5124,5128,5132,5136,5140,5145,5149,5154,5159,5163,5168],{"type":606,"tag":635,"props":5121,"children":5122},{"style":793},[5123],{"type":611,"value":2924},{"type":606,"tag":635,"props":5125,"children":5126},{"style":647},[5127],{"type":611,"value":974},{"type":606,"tag":635,"props":5129,"children":5130},{"style":641},[5131],{"type":611,"value":1164},{"type":606,"tag":635,"props":5133,"children":5134},{"style":707},[5135],{"type":611,"value":1347},{"type":606,"tag":635,"props":5137,"children":5138},{"style":793},[5139],{"type":611,"value":2884},{"type":606,"tag":635,"props":5141,"children":5142},{"style":707},[5143],{"type":611,"value":5144},"Processing ",{"type":606,"tag":635,"props":5146,"children":5147},{"style":793},[5148],{"type":611,"value":1174},{"type":606,"tag":635,"props":5150,"children":5151},{"style":647},[5152],{"type":611,"value":5153},"size",{"type":606,"tag":635,"props":5155,"children":5156},{"style":641},[5157],{"type":611,"value":5158},":,",{"type":606,"tag":635,"props":5160,"children":5161},{"style":793},[5162],{"type":611,"value":1189},{"type":606,"tag":635,"props":5164,"children":5165},{"style":707},[5166],{"type":611,"value":5167}," items:\"",{"type":606,"tag":635,"props":5169,"children":5170},{"style":647},[5171],{"type":611,"value":1199},{"type":606,"tag":635,"props":5173,"children":5174},{"class":637,"line":356},[5175],{"type":606,"tag":635,"props":5176,"children":5177},{"style":647},[5178],{"type":611,"value":5179},"        \n",{"type":606,"tag":635,"props":5181,"children":5182},{"class":637,"line":367},[5183,5188,5192],{"type":606,"tag":635,"props":5184,"children":5185},{"style":647},[5186],{"type":611,"value":5187},"        slow_result ",{"type":606,"tag":635,"props":5189,"children":5190},{"style":641},[5191],{"type":611,"value":723},{"type":606,"tag":635,"props":5193,"children":5194},{"style":647},[5195],{"type":611,"value":5196}," process_data_slow(data)\n",{"type":606,"tag":635,"props":5198,"children":5199},{"class":637,"line":376},[5200,5205,5209],{"type":606,"tag":635,"props":5201,"children":5202},{"style":647},[5203],{"type":611,"value":5204},"        fast_result ",{"type":606,"tag":635,"props":5206,"children":5207},{"style":641},[5208],{"type":611,"value":723},{"type":606,"tag":635,"props":5210,"children":5211},{"style":647},[5212],{"type":611,"value":5213}," process_data_fast(data)\n",{"type":606,"tag":635,"props":5215,"children":5216},{"class":637,"line":385},[5217],{"type":606,"tag":635,"props":5218,"children":5219},{"style":647},[5220],{"type":611,"value":5179},{"type":606,"tag":635,"props":5222,"children":5223},{"class":637,"line":394},[5224,5228,5232,5236,5240,5244,5248,5252,5256,5260,5264],{"type":606,"tag":635,"props":5225,"children":5226},{"style":793},[5227],{"type":611,"value":2924},{"type":606,"tag":635,"props":5229,"children":5230},{"style":647},[5231],{"type":611,"value":974},{"type":606,"tag":635,"props":5233,"children":5234},{"style":641},[5235],{"type":611,"value":1164},{"type":606,"tag":635,"props":5237,"children":5238},{"style":707},[5239],{"type":611,"value":1320},{"type":606,"tag":635,"props":5241,"children":5242},{"style":793},[5243],{"type":611,"value":1174},{"type":606,"tag":635,"props":5245,"children":5246},{"style":647},[5247],{"type":611,"value":1033},{"type":606,"tag":635,"props":5249,"children":5250},{"style":641},[5251],{"type":611,"value":1333},{"type":606,"tag":635,"props":5253,"children":5254},{"style":647},[5255],{"type":611,"value":1338},{"type":606,"tag":635,"props":5257,"children":5258},{"style":793},[5259],{"type":611,"value":1189},{"type":606,"tag":635,"props":5261,"children":5262},{"style":707},[5263],{"type":611,"value":1347},{"type":606,"tag":635,"props":5265,"children":5266},{"style":647},[5267],{"type":611,"value":1199},{"type":606,"tag":635,"props":5269,"children":5270},{"class":637,"line":403},[5271],{"type":606,"tag":635,"props":5272,"children":5273},{"emptyLinePlaceholder":13},[5274],{"type":611,"value":658},{"type":606,"tag":635,"props":5276,"children":5277},{"class":637,"line":412},[5278,5282,5287],{"type":606,"tag":635,"props":5279,"children":5280},{"style":641},[5281],{"type":611,"value":690},{"type":606,"tag":635,"props":5283,"children":5284},{"style":693},[5285],{"type":611,"value":5286}," memory_efficient_processing",{"type":606,"tag":635,"props":5288,"children":5289},{"style":647},[5290],{"type":611,"value":1534},{"type":606,"tag":635,"props":5292,"children":5293},{"class":637,"line":423},[5294],{"type":606,"tag":635,"props":5295,"children":5296},{"style":707},[5297],{"type":611,"value":5298},"    \"\"\"Show memory-efficient data processing.\"\"\"\n",{"type":606,"tag":635,"props":5300,"children":5301},{"class":637,"line":432},[5302],{"type":606,"tag":635,"props":5303,"children":5304},{"style":647},[5305],{"type":611,"value":778},{"type":606,"tag":635,"props":5307,"children":5308},{"class":637,"line":441},[5309,5313,5318],{"type":606,"tag":635,"props":5310,"children":5311},{"style":641},[5312],{"type":611,"value":4541},{"type":606,"tag":635,"props":5314,"children":5315},{"style":693},[5316],{"type":611,"value":5317}," count_even_numbers_memory_heavy",{"type":606,"tag":635,"props":5319,"children":5320},{"style":647},[5321],{"type":611,"value":5322},"(max_num):\n",{"type":606,"tag":635,"props":5324,"children":5325},{"class":637,"line":450},[5326],{"type":606,"tag":635,"props":5327,"children":5328},{"style":707},[5329],{"type":611,"value":5330},"        \"\"\"Memory-heavy approach - creates full list.\"\"\"\n",{"type":606,"tag":635,"props":5332,"children":5333},{"class":637,"line":459},[5334,5339,5343,5347,5351,5355],{"type":606,"tag":635,"props":5335,"children":5336},{"style":647},[5337],{"type":611,"value":5338},"        numbers ",{"type":606,"tag":635,"props":5340,"children":5341},{"style":641},[5342],{"type":611,"value":723},{"type":606,"tag":635,"props":5344,"children":5345},{"style":793},[5346],{"type":611,"value":969},{"type":606,"tag":635,"props":5348,"children":5349},{"style":647},[5350],{"type":611,"value":974},{"type":606,"tag":635,"props":5352,"children":5353},{"style":793},[5354],{"type":611,"value":979},{"type":606,"tag":635,"props":5356,"children":5357},{"style":647},[5358],{"type":611,"value":5359},"(max_num))\n",{"type":606,"tag":635,"props":5361,"children":5362},{"class":637,"line":468},[5363,5368,5372,5376,5380,5384,5388,5392,5396,5400,5404,5408,5412,5416],{"type":606,"tag":635,"props":5364,"children":5365},{"style":647},[5366],{"type":611,"value":5367},"        even_numbers ",{"type":606,"tag":635,"props":5369,"children":5370},{"style":641},[5371],{"type":611,"value":723},{"type":606,"tag":635,"props":5373,"children":5374},{"style":647},[5375],{"type":611,"value":3312},{"type":606,"tag":635,"props":5377,"children":5378},{"style":641},[5379],{"type":611,"value":924},{"type":606,"tag":635,"props":5381,"children":5382},{"style":647},[5383],{"type":611,"value":742},{"type":606,"tag":635,"props":5385,"children":5386},{"style":641},[5387],{"type":611,"value":747},{"type":606,"tag":635,"props":5389,"children":5390},{"style":647},[5391],{"type":611,"value":3337},{"type":606,"tag":635,"props":5393,"children":5394},{"style":641},[5395],{"type":611,"value":3342},{"type":606,"tag":635,"props":5397,"children":5398},{"style":647},[5399],{"type":611,"value":742},{"type":606,"tag":635,"props":5401,"children":5402},{"style":641},[5403],{"type":611,"value":3205},{"type":606,"tag":635,"props":5405,"children":5406},{"style":793},[5407],{"type":611,"value":3210},{"type":606,"tag":635,"props":5409,"children":5410},{"style":641},[5411],{"type":611,"value":3215},{"type":606,"tag":635,"props":5413,"children":5414},{"style":793},[5415],{"type":611,"value":3220},{"type":606,"tag":635,"props":5417,"children":5418},{"style":647},[5419],{"type":611,"value":2689},{"type":606,"tag":635,"props":5421,"children":5422},{"class":637,"line":477},[5423,5427,5432],{"type":606,"tag":635,"props":5424,"children":5425},{"style":641},[5426],{"type":611,"value":4715},{"type":606,"tag":635,"props":5428,"children":5429},{"style":793},[5430],{"type":611,"value":5431}," len",{"type":606,"tag":635,"props":5433,"children":5434},{"style":647},[5435],{"type":611,"value":5436},"(even_numbers)\n",{"type":606,"tag":635,"props":5438,"children":5439},{"class":637,"line":488},[5440],{"type":606,"tag":635,"props":5441,"children":5442},{"style":647},[5443],{"type":611,"value":778},{"type":606,"tag":635,"props":5445,"children":5446},{"class":637,"line":497},[5447,5451,5456],{"type":606,"tag":635,"props":5448,"children":5449},{"style":641},[5450],{"type":611,"value":4541},{"type":606,"tag":635,"props":5452,"children":5453},{"style":693},[5454],{"type":611,"value":5455}," count_even_numbers_memory_light",{"type":606,"tag":635,"props":5457,"children":5458},{"style":647},[5459],{"type":611,"value":5322},{"type":606,"tag":635,"props":5461,"children":5462},{"class":637,"line":506},[5463],{"type":606,"tag":635,"props":5464,"children":5465},{"style":707},[5466],{"type":611,"value":5467},"        \"\"\"Memory-light approach - uses generator.\"\"\"\n",{"type":606,"tag":635,"props":5469,"children":5470},{"class":637,"line":515},[5471,5476,5480,5484,5488,5493,5497,5501,5505,5509,5514,5518,5522,5526,5530,5534,5538],{"type":606,"tag":635,"props":5472,"children":5473},{"style":647},[5474],{"type":611,"value":5475},"        even_count ",{"type":606,"tag":635,"props":5477,"children":5478},{"style":641},[5479],{"type":611,"value":723},{"type":606,"tag":635,"props":5481,"children":5482},{"style":793},[5483],{"type":611,"value":906},{"type":606,"tag":635,"props":5485,"children":5486},{"style":647},[5487],{"type":611,"value":974},{"type":606,"tag":635,"props":5489,"children":5490},{"style":793},[5491],{"type":611,"value":5492},"1",{"type":606,"tag":635,"props":5494,"children":5495},{"style":641},[5496],{"type":611,"value":1643},{"type":606,"tag":635,"props":5498,"children":5499},{"style":647},[5500],{"type":611,"value":742},{"type":606,"tag":635,"props":5502,"children":5503},{"style":641},[5504],{"type":611,"value":747},{"type":606,"tag":635,"props":5506,"children":5507},{"style":793},[5508],{"type":611,"value":1741},{"type":606,"tag":635,"props":5510,"children":5511},{"style":647},[5512],{"type":611,"value":5513},"(max_num) ",{"type":606,"tag":635,"props":5515,"children":5516},{"style":641},[5517],{"type":611,"value":3342},{"type":606,"tag":635,"props":5519,"children":5520},{"style":647},[5521],{"type":611,"value":742},{"type":606,"tag":635,"props":5523,"children":5524},{"style":641},[5525],{"type":611,"value":3205},{"type":606,"tag":635,"props":5527,"children":5528},{"style":793},[5529],{"type":611,"value":3210},{"type":606,"tag":635,"props":5531,"children":5532},{"style":641},[5533],{"type":611,"value":3215},{"type":606,"tag":635,"props":5535,"children":5536},{"style":793},[5537],{"type":611,"value":3220},{"type":606,"tag":635,"props":5539,"children":5540},{"style":647},[5541],{"type":611,"value":1199},{"type":606,"tag":635,"props":5543,"children":5544},{"class":637,"line":524},[5545,5549],{"type":606,"tag":635,"props":5546,"children":5547},{"style":641},[5548],{"type":611,"value":4715},{"type":606,"tag":635,"props":5550,"children":5551},{"style":647},[5552],{"type":611,"value":5553}," even_count\n",{"type":606,"tag":635,"props":5555,"children":5556},{"class":637,"line":533},[5557],{"type":606,"tag":635,"props":5558,"children":5559},{"style":647},[5560],{"type":611,"value":778},{"type":606,"tag":635,"props":5562,"children":5563},{"class":637,"line":544},[5564],{"type":606,"tag":635,"props":5565,"children":5566},{"style":664},[5567],{"type":611,"value":5568},"    # Test with large numbers\n",{"type":606,"tag":635,"props":5570,"children":5571},{"class":637,"line":553},[5572,5577,5581],{"type":606,"tag":635,"props":5573,"children":5574},{"style":647},[5575],{"type":611,"value":5576},"    test_size ",{"type":606,"tag":635,"props":5578,"children":5579},{"style":641},[5580],{"type":611,"value":723},{"type":606,"tag":635,"props":5582,"children":5583},{"style":793},[5584],{"type":611,"value":5585}," 1000000\n",{"type":606,"tag":635,"props":5587,"children":5588},{"class":637,"line":562},[5589],{"type":606,"tag":635,"props":5590,"children":5591},{"style":647},[5592],{"type":611,"value":778},{"type":606,"tag":635,"props":5594,"children":5595},{"class":637,"line":571},[5596,5600,5604,5608,5612,5616,5621,5625,5630,5634,5638,5643],{"type":606,"tag":635,"props":5597,"children":5598},{"style":793},[5599],{"type":611,"value":2038},{"type":606,"tag":635,"props":5601,"children":5602},{"style":647},[5603],{"type":611,"value":974},{"type":606,"tag":635,"props":5605,"children":5606},{"style":641},[5607],{"type":611,"value":1164},{"type":606,"tag":635,"props":5609,"children":5610},{"style":707},[5611],{"type":611,"value":1347},{"type":606,"tag":635,"props":5613,"children":5614},{"style":793},[5615],{"type":611,"value":2884},{"type":606,"tag":635,"props":5617,"children":5618},{"style":707},[5619],{"type":611,"value":5620},"Counting even numbers up to ",{"type":606,"tag":635,"props":5622,"children":5623},{"style":793},[5624],{"type":611,"value":1174},{"type":606,"tag":635,"props":5626,"children":5627},{"style":647},[5628],{"type":611,"value":5629},"test_size",{"type":606,"tag":635,"props":5631,"children":5632},{"style":641},[5633],{"type":611,"value":5158},{"type":606,"tag":635,"props":5635,"children":5636},{"style":793},[5637],{"type":611,"value":1189},{"type":606,"tag":635,"props":5639,"children":5640},{"style":707},[5641],{"type":611,"value":5642},":\"",{"type":606,"tag":635,"props":5644,"children":5645},{"style":647},[5646],{"type":611,"value":1199},{"type":606,"tag":635,"props":5648,"children":5649},{"class":637,"line":580},[5650],{"type":606,"tag":635,"props":5651,"children":5652},{"style":647},[5653],{"type":611,"value":778},{"type":606,"tag":635,"props":5655,"children":5656},{"class":637,"line":589},[5657],{"type":606,"tag":635,"props":5658,"children":5659},{"style":664},[5660],{"type":611,"value":5661},"    # Time and compare both approaches\n",{"type":606,"tag":635,"props":5663,"children":5664},{"class":637,"line":2858},[5665,5669,5673],{"type":606,"tag":635,"props":5666,"children":5667},{"style":647},[5668],{"type":611,"value":1712},{"type":606,"tag":635,"props":5670,"children":5671},{"style":641},[5672],{"type":611,"value":723},{"type":606,"tag":635,"props":5674,"children":5675},{"style":647},[5676],{"type":611,"value":1025},{"type":606,"tag":635,"props":5678,"children":5679},{"class":637,"line":2866},[5680,5685,5689],{"type":606,"tag":635,"props":5681,"children":5682},{"style":647},[5683],{"type":611,"value":5684},"    result1 ",{"type":606,"tag":635,"props":5686,"children":5687},{"style":641},[5688],{"type":611,"value":723},{"type":606,"tag":635,"props":5690,"children":5691},{"style":647},[5692],{"type":611,"value":5693}," count_even_numbers_memory_heavy(test_size)\n",{"type":606,"tag":635,"props":5695,"children":5696},{"class":637,"line":2896},[5697,5702,5706,5710,5714],{"type":606,"tag":635,"props":5698,"children":5699},{"style":647},[5700],{"type":611,"value":5701},"    heavy_time ",{"type":606,"tag":635,"props":5703,"children":5704},{"style":641},[5705],{"type":611,"value":723},{"type":606,"tag":635,"props":5707,"children":5708},{"style":647},[5709],{"type":611,"value":1059},{"type":606,"tag":635,"props":5711,"children":5712},{"style":641},[5713],{"type":611,"value":1064},{"type":606,"tag":635,"props":5715,"children":5716},{"style":647},[5717],{"type":611,"value":1069},{"type":606,"tag":635,"props":5719,"children":5720},{"class":637,"line":2918},[5721],{"type":606,"tag":635,"props":5722,"children":5723},{"style":647},[5724],{"type":611,"value":778},{"type":606,"tag":635,"props":5726,"children":5727},{"class":637,"line":2978},[5728,5732,5736],{"type":606,"tag":635,"props":5729,"children":5730},{"style":647},[5731],{"type":611,"value":1712},{"type":606,"tag":635,"props":5733,"children":5734},{"style":641},[5735],{"type":611,"value":723},{"type":606,"tag":635,"props":5737,"children":5738},{"style":647},[5739],{"type":611,"value":1025},{"type":606,"tag":635,"props":5741,"children":5742},{"class":637,"line":2986},[5743,5748,5752],{"type":606,"tag":635,"props":5744,"children":5745},{"style":647},[5746],{"type":611,"value":5747},"    result2 ",{"type":606,"tag":635,"props":5749,"children":5750},{"style":641},[5751],{"type":611,"value":723},{"type":606,"tag":635,"props":5753,"children":5754},{"style":647},[5755],{"type":611,"value":5756}," count_even_numbers_memory_light(test_size)\n",{"type":606,"tag":635,"props":5758,"children":5759},{"class":637,"line":2999},[5760,5765,5769,5773,5777],{"type":606,"tag":635,"props":5761,"children":5762},{"style":647},[5763],{"type":611,"value":5764},"    light_time ",{"type":606,"tag":635,"props":5766,"children":5767},{"style":641},[5768],{"type":611,"value":723},{"type":606,"tag":635,"props":5770,"children":5771},{"style":647},[5772],{"type":611,"value":1059},{"type":606,"tag":635,"props":5774,"children":5775},{"style":641},[5776],{"type":611,"value":1064},{"type":606,"tag":635,"props":5778,"children":5779},{"style":647},[5780],{"type":611,"value":1069},{"type":606,"tag":635,"props":5782,"children":5783},{"class":637,"line":3007},[5784],{"type":606,"tag":635,"props":5785,"children":5786},{"style":647},[5787],{"type":611,"value":778},{"type":606,"tag":635,"props":5789,"children":5790},{"class":637,"line":3016},[5791,5795,5799,5803,5808,5812,5817,5821,5825,5830,5834,5839,5843,5847,5851],{"type":606,"tag":635,"props":5792,"children":5793},{"style":793},[5794],{"type":611,"value":2038},{"type":606,"tag":635,"props":5796,"children":5797},{"style":647},[5798],{"type":611,"value":974},{"type":606,"tag":635,"props":5800,"children":5801},{"style":641},[5802],{"type":611,"value":1164},{"type":606,"tag":635,"props":5804,"children":5805},{"style":707},[5806],{"type":611,"value":5807},"\"Memory-heavy: ",{"type":606,"tag":635,"props":5809,"children":5810},{"style":793},[5811],{"type":611,"value":1174},{"type":606,"tag":635,"props":5813,"children":5814},{"style":647},[5815],{"type":611,"value":5816},"heavy_time",{"type":606,"tag":635,"props":5818,"children":5819},{"style":641},[5820],{"type":611,"value":1184},{"type":606,"tag":635,"props":5822,"children":5823},{"style":793},[5824],{"type":611,"value":1189},{"type":606,"tag":635,"props":5826,"children":5827},{"style":707},[5828],{"type":611,"value":5829}," seconds, result: ",{"type":606,"tag":635,"props":5831,"children":5832},{"style":793},[5833],{"type":611,"value":1174},{"type":606,"tag":635,"props":5835,"children":5836},{"style":647},[5837],{"type":611,"value":5838},"result1",{"type":606,"tag":635,"props":5840,"children":5841},{"style":641},[5842],{"type":611,"value":5158},{"type":606,"tag":635,"props":5844,"children":5845},{"style":793},[5846],{"type":611,"value":1189},{"type":606,"tag":635,"props":5848,"children":5849},{"style":707},[5850],{"type":611,"value":1347},{"type":606,"tag":635,"props":5852,"children":5853},{"style":647},[5854],{"type":611,"value":1199},{"type":606,"tag":635,"props":5856,"children":5858},{"class":637,"line":5857},73,[5859,5863,5867,5871,5876,5880,5885,5889,5893,5897,5901,5906,5910,5914,5918],{"type":606,"tag":635,"props":5860,"children":5861},{"style":793},[5862],{"type":611,"value":2038},{"type":606,"tag":635,"props":5864,"children":5865},{"style":647},[5866],{"type":611,"value":974},{"type":606,"tag":635,"props":5868,"children":5869},{"style":641},[5870],{"type":611,"value":1164},{"type":606,"tag":635,"props":5872,"children":5873},{"style":707},[5874],{"type":611,"value":5875},"\"Memory-light: ",{"type":606,"tag":635,"props":5877,"children":5878},{"style":793},[5879],{"type":611,"value":1174},{"type":606,"tag":635,"props":5881,"children":5882},{"style":647},[5883],{"type":611,"value":5884},"light_time",{"type":606,"tag":635,"props":5886,"children":5887},{"style":641},[5888],{"type":611,"value":1184},{"type":606,"tag":635,"props":5890,"children":5891},{"style":793},[5892],{"type":611,"value":1189},{"type":606,"tag":635,"props":5894,"children":5895},{"style":707},[5896],{"type":611,"value":5829},{"type":606,"tag":635,"props":5898,"children":5899},{"style":793},[5900],{"type":611,"value":1174},{"type":606,"tag":635,"props":5902,"children":5903},{"style":647},[5904],{"type":611,"value":5905},"result2",{"type":606,"tag":635,"props":5907,"children":5908},{"style":641},[5909],{"type":611,"value":5158},{"type":606,"tag":635,"props":5911,"children":5912},{"style":793},[5913],{"type":611,"value":1189},{"type":606,"tag":635,"props":5915,"children":5916},{"style":707},[5917],{"type":611,"value":1347},{"type":606,"tag":635,"props":5919,"children":5920},{"style":647},[5921],{"type":611,"value":1199},{"type":606,"tag":635,"props":5923,"children":5925},{"class":637,"line":5924},74,[5926,5930,5934,5938,5942,5946,5951,5955,5960,5964,5968],{"type":606,"tag":635,"props":5927,"children":5928},{"style":793},[5929],{"type":611,"value":2038},{"type":606,"tag":635,"props":5931,"children":5932},{"style":647},[5933],{"type":611,"value":974},{"type":606,"tag":635,"props":5935,"children":5936},{"style":641},[5937],{"type":611,"value":1164},{"type":606,"tag":635,"props":5939,"children":5940},{"style":707},[5941],{"type":611,"value":1320},{"type":606,"tag":635,"props":5943,"children":5944},{"style":793},[5945],{"type":611,"value":1174},{"type":606,"tag":635,"props":5947,"children":5948},{"style":647},[5949],{"type":611,"value":5950},"result1 ",{"type":606,"tag":635,"props":5952,"children":5953},{"style":641},[5954],{"type":611,"value":1333},{"type":606,"tag":635,"props":5956,"children":5957},{"style":647},[5958],{"type":611,"value":5959}," result2",{"type":606,"tag":635,"props":5961,"children":5962},{"style":793},[5963],{"type":611,"value":1189},{"type":606,"tag":635,"props":5965,"children":5966},{"style":707},[5967],{"type":611,"value":1347},{"type":606,"tag":635,"props":5969,"children":5970},{"style":647},[5971],{"type":611,"value":1199},{"type":606,"tag":635,"props":5973,"children":5975},{"class":637,"line":5974},75,[5976],{"type":606,"tag":635,"props":5977,"children":5978},{"emptyLinePlaceholder":13},[5979],{"type":611,"value":658},{"type":606,"tag":635,"props":5981,"children":5983},{"class":637,"line":5982},76,[5984],{"type":606,"tag":635,"props":5985,"children":5986},{"style":647},[5987],{"type":611,"value":5988},"compare_algorithms()\n",{"type":606,"tag":635,"props":5990,"children":5992},{"class":637,"line":5991},77,[5993],{"type":606,"tag":635,"props":5994,"children":5995},{"style":647},[5996],{"type":611,"value":5997},"memory_efficient_processing()\n",{"type":606,"tag":1469,"props":5999,"children":6001},{"id":6000},"caching-and-memoization",[6002],{"type":611,"value":6003},"Caching and Memoization",{"type":606,"tag":620,"props":6005,"children":6006},{},[6007],{"type":606,"tag":624,"props":6008,"children":6010},{"className":626,"code":6009,"language":628,"meta":8,"style":8},"import time\nfrom functools import lru_cache\n\n# Without caching - slow for repeated calculations\ndef fibonacci_slow(n):\n    \"\"\"Calculate fibonacci number without caching.\"\"\"\n    if n \u003C= 1:\n        return n\n    return fibonacci_slow(n-1) + fibonacci_slow(n-2)\n\n# With caching - fast for repeated calculations\n@lru_cache(maxsize=None)\ndef fibonacci_fast(n):\n    \"\"\"Calculate fibonacci number with caching.\"\"\"\n    if n \u003C= 1:\n        return n\n    return fibonacci_fast(n-1) + fibonacci_fast(n-2)\n\ndef test_caching_performance():\n    \"\"\"Compare performance with and without caching.\"\"\"\n    \n    test_numbers = [30, 35, 35, 30, 35]  # Repeated values\n    \n    print(\"Fibonacci Calculation Performance:\")\n    \n    # Test without caching\n    start_time = time.time()\n    for num in test_numbers:\n        result = fibonacci_slow(num)\n        print(f\"fib({num}) = {result}\")\n    slow_time = time.time() - start_time\n    \n    print(f\"Without caching: {slow_time:.4f} seconds\")\n    \n    # Test with caching\n    start_time = time.time()\n    for num in test_numbers:\n        result = fibonacci_fast(num)\n        print(f\"fib({num}) = {result}\")\n    fast_time = time.time() - start_time\n    \n    print(f\"With caching: {fast_time:.4f} seconds\")\n    print(f\"Speedup: {slow_time / fast_time:.1f}x faster\")\n\n# Simple manual caching example\nclass SimpleCache:\n    \"\"\"Simple cache implementation for expensive operations.\"\"\"\n    \n    def __init__(self):\n        self._cache = {}\n    \n    def expensive_calculation(self, x, y):\n        \"\"\"Simulate expensive calculation with caching.\"\"\"\n        cache_key = (x, y)\n        \n        if cache_key in self._cache:\n            print(f\"Cache hit for ({x}, {y})\")\n            return self._cache[cache_key]\n        \n        print(f\"Computing for ({x}, {y})\")\n        \n        # Simulate expensive operation\n        time.sleep(0.1)  # Pretend this takes time\n        result = x ** 2 + y ** 2\n        \n        # Store in cache\n        self._cache[cache_key] = result\n        return result\n\ndef test_simple_cache():\n    \"\"\"Test simple caching implementation.\"\"\"\n    \n    cache = SimpleCache()\n    \n    # Test repeated calculations\n    test_cases = [(3, 4), (5, 12), (3, 4), (8, 6), (5, 12)]\n    \n    print(\"\\nSimple Cache Example:\")\n    for x, y in test_cases:\n        result = cache.expensive_calculation(x, y)\n        print(f\"Result: {result}\")\n\ntest_caching_performance()\ntest_simple_cache()\n",[6011],{"type":606,"tag":631,"props":6012,"children":6013},{"__ignoreMap":8},[6014,6025,6045,6052,6060,6077,6085,6112,6124,6170,6177,6185,6216,6232,6240,6263,6274,6318,6325,6341,6349,6356,6420,6427,6447,6454,6462,6477,6497,6513,6572,6595,6602,6646,6653,6661,6676,6695,6711,6766,6789,6796,6840,6891,6898,6906,6923,6931,6938,6955,6976,6983,7000,7008,7025,7032,7058,7118,7135,7142,7198,7205,7213,7236,7279,7286,7294,7314,7325,7332,7348,7356,7363,7380,7387,7395,7500,7507,7536,7558,7575,7616,7624,7633],{"type":606,"tag":635,"props":6015,"children":6016},{"class":637,"line":12},[6017,6021],{"type":606,"tag":635,"props":6018,"children":6019},{"style":641},[6020],{"type":611,"value":644},{"type":606,"tag":635,"props":6022,"children":6023},{"style":647},[6024],{"type":611,"value":650},{"type":606,"tag":635,"props":6026,"children":6027},{"class":637,"line":27},[6028,6032,6036,6040],{"type":606,"tag":635,"props":6029,"children":6030},{"style":641},[6031],{"type":611,"value":4474},{"type":606,"tag":635,"props":6033,"children":6034},{"style":647},[6035],{"type":611,"value":4479},{"type":606,"tag":635,"props":6037,"children":6038},{"style":641},[6039],{"type":611,"value":644},{"type":606,"tag":635,"props":6041,"children":6042},{"style":647},[6043],{"type":611,"value":6044}," lru_cache\n",{"type":606,"tag":635,"props":6046,"children":6047},{"class":637,"line":36},[6048],{"type":606,"tag":635,"props":6049,"children":6050},{"emptyLinePlaceholder":13},[6051],{"type":611,"value":658},{"type":606,"tag":635,"props":6053,"children":6054},{"class":637,"line":45},[6055],{"type":606,"tag":635,"props":6056,"children":6057},{"style":664},[6058],{"type":611,"value":6059},"# Without caching - slow for repeated calculations\n",{"type":606,"tag":635,"props":6061,"children":6062},{"class":637,"line":54},[6063,6067,6072],{"type":606,"tag":635,"props":6064,"children":6065},{"style":641},[6066],{"type":611,"value":690},{"type":606,"tag":635,"props":6068,"children":6069},{"style":693},[6070],{"type":611,"value":6071}," fibonacci_slow",{"type":606,"tag":635,"props":6073,"children":6074},{"style":647},[6075],{"type":611,"value":6076},"(n):\n",{"type":606,"tag":635,"props":6078,"children":6079},{"class":637,"line":63},[6080],{"type":606,"tag":635,"props":6081,"children":6082},{"style":707},[6083],{"type":611,"value":6084},"    \"\"\"Calculate fibonacci number without caching.\"\"\"\n",{"type":606,"tag":635,"props":6086,"children":6087},{"class":637,"line":72},[6088,6093,6098,6103,6108],{"type":606,"tag":635,"props":6089,"children":6090},{"style":641},[6091],{"type":611,"value":6092},"    if",{"type":606,"tag":635,"props":6094,"children":6095},{"style":647},[6096],{"type":611,"value":6097}," n ",{"type":606,"tag":635,"props":6099,"children":6100},{"style":641},[6101],{"type":611,"value":6102},"\u003C=",{"type":606,"tag":635,"props":6104,"children":6105},{"style":793},[6106],{"type":611,"value":6107}," 1",{"type":606,"tag":635,"props":6109,"children":6110},{"style":647},[6111],{"type":611,"value":3225},{"type":606,"tag":635,"props":6113,"children":6114},{"class":637,"line":81},[6115,6119],{"type":606,"tag":635,"props":6116,"children":6117},{"style":641},[6118],{"type":611,"value":4715},{"type":606,"tag":635,"props":6120,"children":6121},{"style":647},[6122],{"type":611,"value":6123}," n\n",{"type":606,"tag":635,"props":6125,"children":6126},{"class":637,"line":731},[6127,6131,6136,6140,6144,6149,6153,6157,6161,6166],{"type":606,"tag":635,"props":6128,"children":6129},{"style":641},[6130],{"type":611,"value":850},{"type":606,"tag":635,"props":6132,"children":6133},{"style":647},[6134],{"type":611,"value":6135}," fibonacci_slow(n",{"type":606,"tag":635,"props":6137,"children":6138},{"style":641},[6139],{"type":611,"value":1064},{"type":606,"tag":635,"props":6141,"children":6142},{"style":793},[6143],{"type":611,"value":5492},{"type":606,"tag":635,"props":6145,"children":6146},{"style":647},[6147],{"type":611,"value":6148},") ",{"type":606,"tag":635,"props":6150,"children":6151},{"style":641},[6152],{"type":611,"value":3973},{"type":606,"tag":635,"props":6154,"children":6155},{"style":647},[6156],{"type":611,"value":6135},{"type":606,"tag":635,"props":6158,"children":6159},{"style":641},[6160],{"type":611,"value":1064},{"type":606,"tag":635,"props":6162,"children":6163},{"style":793},[6164],{"type":611,"value":6165},"2",{"type":606,"tag":635,"props":6167,"children":6168},{"style":647},[6169],{"type":611,"value":1199},{"type":606,"tag":635,"props":6171,"children":6172},{"class":637,"line":99},[6173],{"type":606,"tag":635,"props":6174,"children":6175},{"emptyLinePlaceholder":13},[6176],{"type":611,"value":658},{"type":606,"tag":635,"props":6178,"children":6179},{"class":637,"line":108},[6180],{"type":606,"tag":635,"props":6181,"children":6182},{"style":664},[6183],{"type":611,"value":6184},"# With caching - fast for repeated calculations\n",{"type":606,"tag":635,"props":6186,"children":6187},{"class":637,"line":117},[6188,6193,6197,6203,6207,6212],{"type":606,"tag":635,"props":6189,"children":6190},{"style":693},[6191],{"type":611,"value":6192},"@lru_cache",{"type":606,"tag":635,"props":6194,"children":6195},{"style":647},[6196],{"type":611,"value":974},{"type":606,"tag":635,"props":6198,"children":6200},{"style":6199},"--shiki-default:#E36209;--shiki-app-dark-mode:#FFAB70",[6201],{"type":611,"value":6202},"maxsize",{"type":606,"tag":635,"props":6204,"children":6205},{"style":641},[6206],{"type":611,"value":723},{"type":606,"tag":635,"props":6208,"children":6209},{"style":793},[6210],{"type":611,"value":6211},"None",{"type":606,"tag":635,"props":6213,"children":6214},{"style":647},[6215],{"type":611,"value":1199},{"type":606,"tag":635,"props":6217,"children":6218},{"class":637,"line":126},[6219,6223,6228],{"type":606,"tag":635,"props":6220,"children":6221},{"style":641},[6222],{"type":611,"value":690},{"type":606,"tag":635,"props":6224,"children":6225},{"style":693},[6226],{"type":611,"value":6227}," fibonacci_fast",{"type":606,"tag":635,"props":6229,"children":6230},{"style":647},[6231],{"type":611,"value":6076},{"type":606,"tag":635,"props":6233,"children":6234},{"class":637,"line":135},[6235],{"type":606,"tag":635,"props":6236,"children":6237},{"style":707},[6238],{"type":611,"value":6239},"    \"\"\"Calculate fibonacci number with caching.\"\"\"\n",{"type":606,"tag":635,"props":6241,"children":6242},{"class":637,"line":144},[6243,6247,6251,6255,6259],{"type":606,"tag":635,"props":6244,"children":6245},{"style":641},[6246],{"type":611,"value":6092},{"type":606,"tag":635,"props":6248,"children":6249},{"style":647},[6250],{"type":611,"value":6097},{"type":606,"tag":635,"props":6252,"children":6253},{"style":641},[6254],{"type":611,"value":6102},{"type":606,"tag":635,"props":6256,"children":6257},{"style":793},[6258],{"type":611,"value":6107},{"type":606,"tag":635,"props":6260,"children":6261},{"style":647},[6262],{"type":611,"value":3225},{"type":606,"tag":635,"props":6264,"children":6265},{"class":637,"line":153},[6266,6270],{"type":606,"tag":635,"props":6267,"children":6268},{"style":641},[6269],{"type":611,"value":4715},{"type":606,"tag":635,"props":6271,"children":6272},{"style":647},[6273],{"type":611,"value":6123},{"type":606,"tag":635,"props":6275,"children":6276},{"class":637,"line":163},[6277,6281,6286,6290,6294,6298,6302,6306,6310,6314],{"type":606,"tag":635,"props":6278,"children":6279},{"style":641},[6280],{"type":611,"value":850},{"type":606,"tag":635,"props":6282,"children":6283},{"style":647},[6284],{"type":611,"value":6285}," fibonacci_fast(n",{"type":606,"tag":635,"props":6287,"children":6288},{"style":641},[6289],{"type":611,"value":1064},{"type":606,"tag":635,"props":6291,"children":6292},{"style":793},[6293],{"type":611,"value":5492},{"type":606,"tag":635,"props":6295,"children":6296},{"style":647},[6297],{"type":611,"value":6148},{"type":606,"tag":635,"props":6299,"children":6300},{"style":641},[6301],{"type":611,"value":3973},{"type":606,"tag":635,"props":6303,"children":6304},{"style":647},[6305],{"type":611,"value":6285},{"type":606,"tag":635,"props":6307,"children":6308},{"style":641},[6309],{"type":611,"value":1064},{"type":606,"tag":635,"props":6311,"children":6312},{"style":793},[6313],{"type":611,"value":6165},{"type":606,"tag":635,"props":6315,"children":6316},{"style":647},[6317],{"type":611,"value":1199},{"type":606,"tag":635,"props":6319,"children":6320},{"class":637,"line":172},[6321],{"type":606,"tag":635,"props":6322,"children":6323},{"emptyLinePlaceholder":13},[6324],{"type":611,"value":658},{"type":606,"tag":635,"props":6326,"children":6327},{"class":637,"line":181},[6328,6332,6337],{"type":606,"tag":635,"props":6329,"children":6330},{"style":641},[6331],{"type":611,"value":690},{"type":606,"tag":635,"props":6333,"children":6334},{"style":693},[6335],{"type":611,"value":6336}," test_caching_performance",{"type":606,"tag":635,"props":6338,"children":6339},{"style":647},[6340],{"type":611,"value":1534},{"type":606,"tag":635,"props":6342,"children":6343},{"class":637,"line":190},[6344],{"type":606,"tag":635,"props":6345,"children":6346},{"style":707},[6347],{"type":611,"value":6348},"    \"\"\"Compare performance with and without caching.\"\"\"\n",{"type":606,"tag":635,"props":6350,"children":6351},{"class":637,"line":199},[6352],{"type":606,"tag":635,"props":6353,"children":6354},{"style":647},[6355],{"type":611,"value":778},{"type":606,"tag":635,"props":6357,"children":6358},{"class":637,"line":208},[6359,6364,6368,6372,6377,6381,6386,6390,6394,6398,6402,6406,6410,6415],{"type":606,"tag":635,"props":6360,"children":6361},{"style":647},[6362],{"type":611,"value":6363},"    test_numbers ",{"type":606,"tag":635,"props":6365,"children":6366},{"style":641},[6367],{"type":611,"value":723},{"type":606,"tag":635,"props":6369,"children":6370},{"style":647},[6371],{"type":611,"value":3820},{"type":606,"tag":635,"props":6373,"children":6374},{"style":793},[6375],{"type":611,"value":6376},"30",{"type":606,"tag":635,"props":6378,"children":6379},{"style":647},[6380],{"type":611,"value":2336},{"type":606,"tag":635,"props":6382,"children":6383},{"style":793},[6384],{"type":611,"value":6385},"35",{"type":606,"tag":635,"props":6387,"children":6388},{"style":647},[6389],{"type":611,"value":2336},{"type":606,"tag":635,"props":6391,"children":6392},{"style":793},[6393],{"type":611,"value":6385},{"type":606,"tag":635,"props":6395,"children":6396},{"style":647},[6397],{"type":611,"value":2336},{"type":606,"tag":635,"props":6399,"children":6400},{"style":793},[6401],{"type":611,"value":6376},{"type":606,"tag":635,"props":6403,"children":6404},{"style":647},[6405],{"type":611,"value":2336},{"type":606,"tag":635,"props":6407,"children":6408},{"style":793},[6409],{"type":611,"value":6385},{"type":606,"tag":635,"props":6411,"children":6412},{"style":647},[6413],{"type":611,"value":6414},"]  ",{"type":606,"tag":635,"props":6416,"children":6417},{"style":664},[6418],{"type":611,"value":6419},"# Repeated values\n",{"type":606,"tag":635,"props":6421,"children":6422},{"class":637,"line":217},[6423],{"type":606,"tag":635,"props":6424,"children":6425},{"style":647},[6426],{"type":611,"value":778},{"type":606,"tag":635,"props":6428,"children":6429},{"class":637,"line":227},[6430,6434,6438,6443],{"type":606,"tag":635,"props":6431,"children":6432},{"style":793},[6433],{"type":611,"value":2038},{"type":606,"tag":635,"props":6435,"children":6436},{"style":647},[6437],{"type":611,"value":974},{"type":606,"tag":635,"props":6439,"children":6440},{"style":707},[6441],{"type":611,"value":6442},"\"Fibonacci Calculation Performance:\"",{"type":606,"tag":635,"props":6444,"children":6445},{"style":647},[6446],{"type":611,"value":1199},{"type":606,"tag":635,"props":6448,"children":6449},{"class":637,"line":236},[6450],{"type":606,"tag":635,"props":6451,"children":6452},{"style":647},[6453],{"type":611,"value":778},{"type":606,"tag":635,"props":6455,"children":6456},{"class":637,"line":245},[6457],{"type":606,"tag":635,"props":6458,"children":6459},{"style":664},[6460],{"type":611,"value":6461},"    # Test without caching\n",{"type":606,"tag":635,"props":6463,"children":6464},{"class":637,"line":254},[6465,6469,6473],{"type":606,"tag":635,"props":6466,"children":6467},{"style":647},[6468],{"type":611,"value":1712},{"type":606,"tag":635,"props":6470,"children":6471},{"style":641},[6472],{"type":611,"value":723},{"type":606,"tag":635,"props":6474,"children":6475},{"style":647},[6476],{"type":611,"value":1025},{"type":606,"tag":635,"props":6478,"children":6479},{"class":637,"line":263},[6480,6484,6488,6492],{"type":606,"tag":635,"props":6481,"children":6482},{"style":641},[6483],{"type":611,"value":737},{"type":606,"tag":635,"props":6485,"children":6486},{"style":647},[6487],{"type":611,"value":742},{"type":606,"tag":635,"props":6489,"children":6490},{"style":641},[6491],{"type":611,"value":747},{"type":606,"tag":635,"props":6493,"children":6494},{"style":647},[6495],{"type":611,"value":6496}," test_numbers:\n",{"type":606,"tag":635,"props":6498,"children":6499},{"class":637,"line":272},[6500,6504,6508],{"type":606,"tag":635,"props":6501,"children":6502},{"style":647},[6503],{"type":611,"value":4593},{"type":606,"tag":635,"props":6505,"children":6506},{"style":641},[6507],{"type":611,"value":723},{"type":606,"tag":635,"props":6509,"children":6510},{"style":647},[6511],{"type":611,"value":6512}," fibonacci_slow(num)\n",{"type":606,"tag":635,"props":6514,"children":6515},{"class":637,"line":281},[6516,6520,6524,6528,6533,6537,6542,6546,6551,6555,6560,6564,6568],{"type":606,"tag":635,"props":6517,"children":6518},{"style":793},[6519],{"type":611,"value":2924},{"type":606,"tag":635,"props":6521,"children":6522},{"style":647},[6523],{"type":611,"value":974},{"type":606,"tag":635,"props":6525,"children":6526},{"style":641},[6527],{"type":611,"value":1164},{"type":606,"tag":635,"props":6529,"children":6530},{"style":707},[6531],{"type":611,"value":6532},"\"fib(",{"type":606,"tag":635,"props":6534,"children":6535},{"style":793},[6536],{"type":611,"value":1174},{"type":606,"tag":635,"props":6538,"children":6539},{"style":647},[6540],{"type":611,"value":6541},"num",{"type":606,"tag":635,"props":6543,"children":6544},{"style":793},[6545],{"type":611,"value":1189},{"type":606,"tag":635,"props":6547,"children":6548},{"style":707},[6549],{"type":611,"value":6550},") = ",{"type":606,"tag":635,"props":6552,"children":6553},{"style":793},[6554],{"type":611,"value":1174},{"type":606,"tag":635,"props":6556,"children":6557},{"style":647},[6558],{"type":611,"value":6559},"result",{"type":606,"tag":635,"props":6561,"children":6562},{"style":793},[6563],{"type":611,"value":1189},{"type":606,"tag":635,"props":6565,"children":6566},{"style":707},[6567],{"type":611,"value":1347},{"type":606,"tag":635,"props":6569,"children":6570},{"style":647},[6571],{"type":611,"value":1199},{"type":606,"tag":635,"props":6573,"children":6574},{"class":637,"line":291},[6575,6579,6583,6587,6591],{"type":606,"tag":635,"props":6576,"children":6577},{"style":647},[6578],{"type":611,"value":3986},{"type":606,"tag":635,"props":6580,"children":6581},{"style":641},[6582],{"type":611,"value":723},{"type":606,"tag":635,"props":6584,"children":6585},{"style":647},[6586],{"type":611,"value":1059},{"type":606,"tag":635,"props":6588,"children":6589},{"style":641},[6590],{"type":611,"value":1064},{"type":606,"tag":635,"props":6592,"children":6593},{"style":647},[6594],{"type":611,"value":1069},{"type":606,"tag":635,"props":6596,"children":6597},{"class":637,"line":302},[6598],{"type":606,"tag":635,"props":6599,"children":6600},{"style":647},[6601],{"type":611,"value":778},{"type":606,"tag":635,"props":6603,"children":6604},{"class":637,"line":311},[6605,6609,6613,6617,6622,6626,6630,6634,6638,6642],{"type":606,"tag":635,"props":6606,"children":6607},{"style":793},[6608],{"type":611,"value":2038},{"type":606,"tag":635,"props":6610,"children":6611},{"style":647},[6612],{"type":611,"value":974},{"type":606,"tag":635,"props":6614,"children":6615},{"style":641},[6616],{"type":611,"value":1164},{"type":606,"tag":635,"props":6618,"children":6619},{"style":707},[6620],{"type":611,"value":6621},"\"Without caching: ",{"type":606,"tag":635,"props":6623,"children":6624},{"style":793},[6625],{"type":611,"value":1174},{"type":606,"tag":635,"props":6627,"children":6628},{"style":647},[6629],{"type":611,"value":1179},{"type":606,"tag":635,"props":6631,"children":6632},{"style":641},[6633],{"type":611,"value":1184},{"type":606,"tag":635,"props":6635,"children":6636},{"style":793},[6637],{"type":611,"value":1189},{"type":606,"tag":635,"props":6639,"children":6640},{"style":707},[6641],{"type":611,"value":1194},{"type":606,"tag":635,"props":6643,"children":6644},{"style":647},[6645],{"type":611,"value":1199},{"type":606,"tag":635,"props":6647,"children":6648},{"class":637,"line":320},[6649],{"type":606,"tag":635,"props":6650,"children":6651},{"style":647},[6652],{"type":611,"value":778},{"type":606,"tag":635,"props":6654,"children":6655},{"class":637,"line":329},[6656],{"type":606,"tag":635,"props":6657,"children":6658},{"style":664},[6659],{"type":611,"value":6660},"    # Test with caching\n",{"type":606,"tag":635,"props":6662,"children":6663},{"class":637,"line":338},[6664,6668,6672],{"type":606,"tag":635,"props":6665,"children":6666},{"style":647},[6667],{"type":611,"value":1712},{"type":606,"tag":635,"props":6669,"children":6670},{"style":641},[6671],{"type":611,"value":723},{"type":606,"tag":635,"props":6673,"children":6674},{"style":647},[6675],{"type":611,"value":1025},{"type":606,"tag":635,"props":6677,"children":6678},{"class":637,"line":347},[6679,6683,6687,6691],{"type":606,"tag":635,"props":6680,"children":6681},{"style":641},[6682],{"type":611,"value":737},{"type":606,"tag":635,"props":6684,"children":6685},{"style":647},[6686],{"type":611,"value":742},{"type":606,"tag":635,"props":6688,"children":6689},{"style":641},[6690],{"type":611,"value":747},{"type":606,"tag":635,"props":6692,"children":6693},{"style":647},[6694],{"type":611,"value":6496},{"type":606,"tag":635,"props":6696,"children":6697},{"class":637,"line":356},[6698,6702,6706],{"type":606,"tag":635,"props":6699,"children":6700},{"style":647},[6701],{"type":611,"value":4593},{"type":606,"tag":635,"props":6703,"children":6704},{"style":641},[6705],{"type":611,"value":723},{"type":606,"tag":635,"props":6707,"children":6708},{"style":647},[6709],{"type":611,"value":6710}," fibonacci_fast(num)\n",{"type":606,"tag":635,"props":6712,"children":6713},{"class":637,"line":367},[6714,6718,6722,6726,6730,6734,6738,6742,6746,6750,6754,6758,6762],{"type":606,"tag":635,"props":6715,"children":6716},{"style":793},[6717],{"type":611,"value":2924},{"type":606,"tag":635,"props":6719,"children":6720},{"style":647},[6721],{"type":611,"value":974},{"type":606,"tag":635,"props":6723,"children":6724},{"style":641},[6725],{"type":611,"value":1164},{"type":606,"tag":635,"props":6727,"children":6728},{"style":707},[6729],{"type":611,"value":6532},{"type":606,"tag":635,"props":6731,"children":6732},{"style":793},[6733],{"type":611,"value":1174},{"type":606,"tag":635,"props":6735,"children":6736},{"style":647},[6737],{"type":611,"value":6541},{"type":606,"tag":635,"props":6739,"children":6740},{"style":793},[6741],{"type":611,"value":1189},{"type":606,"tag":635,"props":6743,"children":6744},{"style":707},[6745],{"type":611,"value":6550},{"type":606,"tag":635,"props":6747,"children":6748},{"style":793},[6749],{"type":611,"value":1174},{"type":606,"tag":635,"props":6751,"children":6752},{"style":647},[6753],{"type":611,"value":6559},{"type":606,"tag":635,"props":6755,"children":6756},{"style":793},[6757],{"type":611,"value":1189},{"type":606,"tag":635,"props":6759,"children":6760},{"style":707},[6761],{"type":611,"value":1347},{"type":606,"tag":635,"props":6763,"children":6764},{"style":647},[6765],{"type":611,"value":1199},{"type":606,"tag":635,"props":6767,"children":6768},{"class":637,"line":376},[6769,6773,6777,6781,6785],{"type":606,"tag":635,"props":6770,"children":6771},{"style":647},[6772],{"type":611,"value":4074},{"type":606,"tag":635,"props":6774,"children":6775},{"style":641},[6776],{"type":611,"value":723},{"type":606,"tag":635,"props":6778,"children":6779},{"style":647},[6780],{"type":611,"value":1059},{"type":606,"tag":635,"props":6782,"children":6783},{"style":641},[6784],{"type":611,"value":1064},{"type":606,"tag":635,"props":6786,"children":6787},{"style":647},[6788],{"type":611,"value":1069},{"type":606,"tag":635,"props":6790,"children":6791},{"class":637,"line":385},[6792],{"type":606,"tag":635,"props":6793,"children":6794},{"style":647},[6795],{"type":611,"value":778},{"type":606,"tag":635,"props":6797,"children":6798},{"class":637,"line":394},[6799,6803,6807,6811,6816,6820,6824,6828,6832,6836],{"type":606,"tag":635,"props":6800,"children":6801},{"style":793},[6802],{"type":611,"value":2038},{"type":606,"tag":635,"props":6804,"children":6805},{"style":647},[6806],{"type":611,"value":974},{"type":606,"tag":635,"props":6808,"children":6809},{"style":641},[6810],{"type":611,"value":1164},{"type":606,"tag":635,"props":6812,"children":6813},{"style":707},[6814],{"type":611,"value":6815},"\"With caching: ",{"type":606,"tag":635,"props":6817,"children":6818},{"style":793},[6819],{"type":611,"value":1174},{"type":606,"tag":635,"props":6821,"children":6822},{"style":647},[6823],{"type":611,"value":1228},{"type":606,"tag":635,"props":6825,"children":6826},{"style":641},[6827],{"type":611,"value":1184},{"type":606,"tag":635,"props":6829,"children":6830},{"style":793},[6831],{"type":611,"value":1189},{"type":606,"tag":635,"props":6833,"children":6834},{"style":707},[6835],{"type":611,"value":1194},{"type":606,"tag":635,"props":6837,"children":6838},{"style":647},[6839],{"type":611,"value":1199},{"type":606,"tag":635,"props":6841,"children":6842},{"class":637,"line":403},[6843,6847,6851,6855,6859,6863,6867,6871,6875,6879,6883,6887],{"type":606,"tag":635,"props":6844,"children":6845},{"style":793},[6846],{"type":611,"value":2038},{"type":606,"tag":635,"props":6848,"children":6849},{"style":647},[6850],{"type":611,"value":974},{"type":606,"tag":635,"props":6852,"children":6853},{"style":641},[6854],{"type":611,"value":1164},{"type":606,"tag":635,"props":6856,"children":6857},{"style":707},[6858],{"type":611,"value":1264},{"type":606,"tag":635,"props":6860,"children":6861},{"style":793},[6862],{"type":611,"value":1174},{"type":606,"tag":635,"props":6864,"children":6865},{"style":647},[6866],{"type":611,"value":1050},{"type":606,"tag":635,"props":6868,"children":6869},{"style":641},[6870],{"type":611,"value":1277},{"type":606,"tag":635,"props":6872,"children":6873},{"style":647},[6874],{"type":611,"value":1282},{"type":606,"tag":635,"props":6876,"children":6877},{"style":641},[6878],{"type":611,"value":1287},{"type":606,"tag":635,"props":6880,"children":6881},{"style":793},[6882],{"type":611,"value":1189},{"type":606,"tag":635,"props":6884,"children":6885},{"style":707},[6886],{"type":611,"value":1296},{"type":606,"tag":635,"props":6888,"children":6889},{"style":647},[6890],{"type":611,"value":1199},{"type":606,"tag":635,"props":6892,"children":6893},{"class":637,"line":412},[6894],{"type":606,"tag":635,"props":6895,"children":6896},{"emptyLinePlaceholder":13},[6897],{"type":611,"value":658},{"type":606,"tag":635,"props":6899,"children":6900},{"class":637,"line":423},[6901],{"type":606,"tag":635,"props":6902,"children":6903},{"style":664},[6904],{"type":611,"value":6905},"# Simple manual caching example\n",{"type":606,"tag":635,"props":6907,"children":6908},{"class":637,"line":432},[6909,6914,6919],{"type":606,"tag":635,"props":6910,"children":6911},{"style":641},[6912],{"type":611,"value":6913},"class",{"type":606,"tag":635,"props":6915,"children":6916},{"style":693},[6917],{"type":611,"value":6918}," SimpleCache",{"type":606,"tag":635,"props":6920,"children":6921},{"style":647},[6922],{"type":611,"value":3225},{"type":606,"tag":635,"props":6924,"children":6925},{"class":637,"line":441},[6926],{"type":606,"tag":635,"props":6927,"children":6928},{"style":707},[6929],{"type":611,"value":6930},"    \"\"\"Simple cache implementation for expensive operations.\"\"\"\n",{"type":606,"tag":635,"props":6932,"children":6933},{"class":637,"line":450},[6934],{"type":606,"tag":635,"props":6935,"children":6936},{"style":647},[6937],{"type":611,"value":778},{"type":606,"tag":635,"props":6939,"children":6940},{"class":637,"line":459},[6941,6945,6950],{"type":606,"tag":635,"props":6942,"children":6943},{"style":641},[6944],{"type":611,"value":4541},{"type":606,"tag":635,"props":6946,"children":6947},{"style":793},[6948],{"type":611,"value":6949}," __init__",{"type":606,"tag":635,"props":6951,"children":6952},{"style":647},[6953],{"type":611,"value":6954},"(self):\n",{"type":606,"tag":635,"props":6956,"children":6957},{"class":637,"line":468},[6958,6963,6968,6972],{"type":606,"tag":635,"props":6959,"children":6960},{"style":793},[6961],{"type":611,"value":6962},"        self",{"type":606,"tag":635,"props":6964,"children":6965},{"style":647},[6966],{"type":611,"value":6967},"._cache ",{"type":606,"tag":635,"props":6969,"children":6970},{"style":641},[6971],{"type":611,"value":723},{"type":606,"tag":635,"props":6973,"children":6974},{"style":647},[6975],{"type":611,"value":2643},{"type":606,"tag":635,"props":6977,"children":6978},{"class":637,"line":477},[6979],{"type":606,"tag":635,"props":6980,"children":6981},{"style":647},[6982],{"type":611,"value":778},{"type":606,"tag":635,"props":6984,"children":6985},{"class":637,"line":488},[6986,6990,6995],{"type":606,"tag":635,"props":6987,"children":6988},{"style":641},[6989],{"type":611,"value":4541},{"type":606,"tag":635,"props":6991,"children":6992},{"style":693},[6993],{"type":611,"value":6994}," expensive_calculation",{"type":606,"tag":635,"props":6996,"children":6997},{"style":647},[6998],{"type":611,"value":6999},"(self, x, y):\n",{"type":606,"tag":635,"props":7001,"children":7002},{"class":637,"line":497},[7003],{"type":606,"tag":635,"props":7004,"children":7005},{"style":707},[7006],{"type":611,"value":7007},"        \"\"\"Simulate expensive calculation with caching.\"\"\"\n",{"type":606,"tag":635,"props":7009,"children":7010},{"class":637,"line":506},[7011,7016,7020],{"type":606,"tag":635,"props":7012,"children":7013},{"style":647},[7014],{"type":611,"value":7015},"        cache_key ",{"type":606,"tag":635,"props":7017,"children":7018},{"style":641},[7019],{"type":611,"value":723},{"type":606,"tag":635,"props":7021,"children":7022},{"style":647},[7023],{"type":611,"value":7024}," (x, y)\n",{"type":606,"tag":635,"props":7026,"children":7027},{"class":637,"line":515},[7028],{"type":606,"tag":635,"props":7029,"children":7030},{"style":647},[7031],{"type":611,"value":5179},{"type":606,"tag":635,"props":7033,"children":7034},{"class":637,"line":524},[7035,7039,7044,7048,7053],{"type":606,"tag":635,"props":7036,"children":7037},{"style":641},[7038],{"type":611,"value":2697},{"type":606,"tag":635,"props":7040,"children":7041},{"style":647},[7042],{"type":611,"value":7043}," cache_key ",{"type":606,"tag":635,"props":7045,"children":7046},{"style":641},[7047],{"type":611,"value":747},{"type":606,"tag":635,"props":7049,"children":7050},{"style":793},[7051],{"type":611,"value":7052}," self",{"type":606,"tag":635,"props":7054,"children":7055},{"style":647},[7056],{"type":611,"value":7057},"._cache:\n",{"type":606,"tag":635,"props":7059,"children":7060},{"class":637,"line":533},[7061,7066,7070,7074,7079,7083,7088,7092,7096,7100,7105,7109,7114],{"type":606,"tag":635,"props":7062,"children":7063},{"style":793},[7064],{"type":611,"value":7065},"            print",{"type":606,"tag":635,"props":7067,"children":7068},{"style":647},[7069],{"type":611,"value":974},{"type":606,"tag":635,"props":7071,"children":7072},{"style":641},[7073],{"type":611,"value":1164},{"type":606,"tag":635,"props":7075,"children":7076},{"style":707},[7077],{"type":611,"value":7078},"\"Cache hit for (",{"type":606,"tag":635,"props":7080,"children":7081},{"style":793},[7082],{"type":611,"value":1174},{"type":606,"tag":635,"props":7084,"children":7085},{"style":647},[7086],{"type":611,"value":7087},"x",{"type":606,"tag":635,"props":7089,"children":7090},{"style":793},[7091],{"type":611,"value":1189},{"type":606,"tag":635,"props":7093,"children":7094},{"style":707},[7095],{"type":611,"value":2336},{"type":606,"tag":635,"props":7097,"children":7098},{"style":793},[7099],{"type":611,"value":1174},{"type":606,"tag":635,"props":7101,"children":7102},{"style":647},[7103],{"type":611,"value":7104},"y",{"type":606,"tag":635,"props":7106,"children":7107},{"style":793},[7108],{"type":611,"value":1189},{"type":606,"tag":635,"props":7110,"children":7111},{"style":707},[7112],{"type":611,"value":7113},")\"",{"type":606,"tag":635,"props":7115,"children":7116},{"style":647},[7117],{"type":611,"value":1199},{"type":606,"tag":635,"props":7119,"children":7120},{"class":637,"line":544},[7121,7126,7130],{"type":606,"tag":635,"props":7122,"children":7123},{"style":641},[7124],{"type":611,"value":7125},"            return",{"type":606,"tag":635,"props":7127,"children":7128},{"style":793},[7129],{"type":611,"value":7052},{"type":606,"tag":635,"props":7131,"children":7132},{"style":647},[7133],{"type":611,"value":7134},"._cache[cache_key]\n",{"type":606,"tag":635,"props":7136,"children":7137},{"class":637,"line":553},[7138],{"type":606,"tag":635,"props":7139,"children":7140},{"style":647},[7141],{"type":611,"value":5179},{"type":606,"tag":635,"props":7143,"children":7144},{"class":637,"line":562},[7145,7149,7153,7157,7162,7166,7170,7174,7178,7182,7186,7190,7194],{"type":606,"tag":635,"props":7146,"children":7147},{"style":793},[7148],{"type":611,"value":2924},{"type":606,"tag":635,"props":7150,"children":7151},{"style":647},[7152],{"type":611,"value":974},{"type":606,"tag":635,"props":7154,"children":7155},{"style":641},[7156],{"type":611,"value":1164},{"type":606,"tag":635,"props":7158,"children":7159},{"style":707},[7160],{"type":611,"value":7161},"\"Computing for (",{"type":606,"tag":635,"props":7163,"children":7164},{"style":793},[7165],{"type":611,"value":1174},{"type":606,"tag":635,"props":7167,"children":7168},{"style":647},[7169],{"type":611,"value":7087},{"type":606,"tag":635,"props":7171,"children":7172},{"style":793},[7173],{"type":611,"value":1189},{"type":606,"tag":635,"props":7175,"children":7176},{"style":707},[7177],{"type":611,"value":2336},{"type":606,"tag":635,"props":7179,"children":7180},{"style":793},[7181],{"type":611,"value":1174},{"type":606,"tag":635,"props":7183,"children":7184},{"style":647},[7185],{"type":611,"value":7104},{"type":606,"tag":635,"props":7187,"children":7188},{"style":793},[7189],{"type":611,"value":1189},{"type":606,"tag":635,"props":7191,"children":7192},{"style":707},[7193],{"type":611,"value":7113},{"type":606,"tag":635,"props":7195,"children":7196},{"style":647},[7197],{"type":611,"value":1199},{"type":606,"tag":635,"props":7199,"children":7200},{"class":637,"line":571},[7201],{"type":606,"tag":635,"props":7202,"children":7203},{"style":647},[7204],{"type":611,"value":5179},{"type":606,"tag":635,"props":7206,"children":7207},{"class":637,"line":580},[7208],{"type":606,"tag":635,"props":7209,"children":7210},{"style":664},[7211],{"type":611,"value":7212},"        # Simulate expensive operation\n",{"type":606,"tag":635,"props":7214,"children":7215},{"class":637,"line":589},[7216,7221,7226,7231],{"type":606,"tag":635,"props":7217,"children":7218},{"style":647},[7219],{"type":611,"value":7220},"        time.sleep(",{"type":606,"tag":635,"props":7222,"children":7223},{"style":793},[7224],{"type":611,"value":7225},"0.1",{"type":606,"tag":635,"props":7227,"children":7228},{"style":647},[7229],{"type":611,"value":7230},")  ",{"type":606,"tag":635,"props":7232,"children":7233},{"style":664},[7234],{"type":611,"value":7235},"# Pretend this takes time\n",{"type":606,"tag":635,"props":7237,"children":7238},{"class":637,"line":2858},[7239,7243,7247,7252,7256,7260,7265,7270,7274],{"type":606,"tag":635,"props":7240,"children":7241},{"style":647},[7242],{"type":611,"value":4593},{"type":606,"tag":635,"props":7244,"children":7245},{"style":641},[7246],{"type":611,"value":723},{"type":606,"tag":635,"props":7248,"children":7249},{"style":647},[7250],{"type":611,"value":7251}," x ",{"type":606,"tag":635,"props":7253,"children":7254},{"style":641},[7255],{"type":611,"value":4564},{"type":606,"tag":635,"props":7257,"children":7258},{"style":793},[7259],{"type":611,"value":3210},{"type":606,"tag":635,"props":7261,"children":7262},{"style":641},[7263],{"type":611,"value":7264}," +",{"type":606,"tag":635,"props":7266,"children":7267},{"style":647},[7268],{"type":611,"value":7269}," y ",{"type":606,"tag":635,"props":7271,"children":7272},{"style":641},[7273],{"type":611,"value":4564},{"type":606,"tag":635,"props":7275,"children":7276},{"style":793},[7277],{"type":611,"value":7278}," 2\n",{"type":606,"tag":635,"props":7280,"children":7281},{"class":637,"line":2866},[7282],{"type":606,"tag":635,"props":7283,"children":7284},{"style":647},[7285],{"type":611,"value":5179},{"type":606,"tag":635,"props":7287,"children":7288},{"class":637,"line":2896},[7289],{"type":606,"tag":635,"props":7290,"children":7291},{"style":664},[7292],{"type":611,"value":7293},"        # Store in cache\n",{"type":606,"tag":635,"props":7295,"children":7296},{"class":637,"line":2918},[7297,7301,7306,7310],{"type":606,"tag":635,"props":7298,"children":7299},{"style":793},[7300],{"type":611,"value":6962},{"type":606,"tag":635,"props":7302,"children":7303},{"style":647},[7304],{"type":611,"value":7305},"._cache[cache_key] ",{"type":606,"tag":635,"props":7307,"children":7308},{"style":641},[7309],{"type":611,"value":723},{"type":606,"tag":635,"props":7311,"children":7312},{"style":647},[7313],{"type":611,"value":4720},{"type":606,"tag":635,"props":7315,"children":7316},{"class":637,"line":2978},[7317,7321],{"type":606,"tag":635,"props":7318,"children":7319},{"style":641},[7320],{"type":611,"value":4715},{"type":606,"tag":635,"props":7322,"children":7323},{"style":647},[7324],{"type":611,"value":4720},{"type":606,"tag":635,"props":7326,"children":7327},{"class":637,"line":2986},[7328],{"type":606,"tag":635,"props":7329,"children":7330},{"emptyLinePlaceholder":13},[7331],{"type":611,"value":658},{"type":606,"tag":635,"props":7333,"children":7334},{"class":637,"line":2999},[7335,7339,7344],{"type":606,"tag":635,"props":7336,"children":7337},{"style":641},[7338],{"type":611,"value":690},{"type":606,"tag":635,"props":7340,"children":7341},{"style":693},[7342],{"type":611,"value":7343}," test_simple_cache",{"type":606,"tag":635,"props":7345,"children":7346},{"style":647},[7347],{"type":611,"value":1534},{"type":606,"tag":635,"props":7349,"children":7350},{"class":637,"line":3007},[7351],{"type":606,"tag":635,"props":7352,"children":7353},{"style":707},[7354],{"type":611,"value":7355},"    \"\"\"Test simple caching implementation.\"\"\"\n",{"type":606,"tag":635,"props":7357,"children":7358},{"class":637,"line":3016},[7359],{"type":606,"tag":635,"props":7360,"children":7361},{"style":647},[7362],{"type":611,"value":778},{"type":606,"tag":635,"props":7364,"children":7365},{"class":637,"line":5857},[7366,7371,7375],{"type":606,"tag":635,"props":7367,"children":7368},{"style":647},[7369],{"type":611,"value":7370},"    cache ",{"type":606,"tag":635,"props":7372,"children":7373},{"style":641},[7374],{"type":611,"value":723},{"type":606,"tag":635,"props":7376,"children":7377},{"style":647},[7378],{"type":611,"value":7379}," SimpleCache()\n",{"type":606,"tag":635,"props":7381,"children":7382},{"class":637,"line":5924},[7383],{"type":606,"tag":635,"props":7384,"children":7385},{"style":647},[7386],{"type":611,"value":778},{"type":606,"tag":635,"props":7388,"children":7389},{"class":637,"line":5974},[7390],{"type":606,"tag":635,"props":7391,"children":7392},{"style":664},[7393],{"type":611,"value":7394},"    # Test repeated calculations\n",{"type":606,"tag":635,"props":7396,"children":7397},{"class":637,"line":5982},[7398,7403,7407,7412,7417,7421,7426,7431,7436,7440,7445,7449,7453,7457,7461,7465,7470,7474,7479,7483,7487,7491,7495],{"type":606,"tag":635,"props":7399,"children":7400},{"style":647},[7401],{"type":611,"value":7402},"    test_cases ",{"type":606,"tag":635,"props":7404,"children":7405},{"style":641},[7406],{"type":611,"value":723},{"type":606,"tag":635,"props":7408,"children":7409},{"style":647},[7410],{"type":611,"value":7411}," [(",{"type":606,"tag":635,"props":7413,"children":7414},{"style":793},[7415],{"type":611,"value":7416},"3",{"type":606,"tag":635,"props":7418,"children":7419},{"style":647},[7420],{"type":611,"value":2336},{"type":606,"tag":635,"props":7422,"children":7423},{"style":793},[7424],{"type":611,"value":7425},"4",{"type":606,"tag":635,"props":7427,"children":7428},{"style":647},[7429],{"type":611,"value":7430},"), (",{"type":606,"tag":635,"props":7432,"children":7433},{"style":793},[7434],{"type":611,"value":7435},"5",{"type":606,"tag":635,"props":7437,"children":7438},{"style":647},[7439],{"type":611,"value":2336},{"type":606,"tag":635,"props":7441,"children":7442},{"style":793},[7443],{"type":611,"value":7444},"12",{"type":606,"tag":635,"props":7446,"children":7447},{"style":647},[7448],{"type":611,"value":7430},{"type":606,"tag":635,"props":7450,"children":7451},{"style":793},[7452],{"type":611,"value":7416},{"type":606,"tag":635,"props":7454,"children":7455},{"style":647},[7456],{"type":611,"value":2336},{"type":606,"tag":635,"props":7458,"children":7459},{"style":793},[7460],{"type":611,"value":7425},{"type":606,"tag":635,"props":7462,"children":7463},{"style":647},[7464],{"type":611,"value":7430},{"type":606,"tag":635,"props":7466,"children":7467},{"style":793},[7468],{"type":611,"value":7469},"8",{"type":606,"tag":635,"props":7471,"children":7472},{"style":647},[7473],{"type":611,"value":2336},{"type":606,"tag":635,"props":7475,"children":7476},{"style":793},[7477],{"type":611,"value":7478},"6",{"type":606,"tag":635,"props":7480,"children":7481},{"style":647},[7482],{"type":611,"value":7430},{"type":606,"tag":635,"props":7484,"children":7485},{"style":793},[7486],{"type":611,"value":7435},{"type":606,"tag":635,"props":7488,"children":7489},{"style":647},[7490],{"type":611,"value":2336},{"type":606,"tag":635,"props":7492,"children":7493},{"style":793},[7494],{"type":611,"value":7444},{"type":606,"tag":635,"props":7496,"children":7497},{"style":647},[7498],{"type":611,"value":7499},")]\n",{"type":606,"tag":635,"props":7501,"children":7502},{"class":637,"line":5991},[7503],{"type":606,"tag":635,"props":7504,"children":7505},{"style":647},[7506],{"type":611,"value":778},{"type":606,"tag":635,"props":7508,"children":7510},{"class":637,"line":7509},78,[7511,7515,7519,7523,7527,7532],{"type":606,"tag":635,"props":7512,"children":7513},{"style":793},[7514],{"type":611,"value":2038},{"type":606,"tag":635,"props":7516,"children":7517},{"style":647},[7518],{"type":611,"value":974},{"type":606,"tag":635,"props":7520,"children":7521},{"style":707},[7522],{"type":611,"value":1347},{"type":606,"tag":635,"props":7524,"children":7525},{"style":793},[7526],{"type":611,"value":2884},{"type":606,"tag":635,"props":7528,"children":7529},{"style":707},[7530],{"type":611,"value":7531},"Simple Cache Example:\"",{"type":606,"tag":635,"props":7533,"children":7534},{"style":647},[7535],{"type":611,"value":1199},{"type":606,"tag":635,"props":7537,"children":7539},{"class":637,"line":7538},79,[7540,7544,7549,7553],{"type":606,"tag":635,"props":7541,"children":7542},{"style":641},[7543],{"type":611,"value":737},{"type":606,"tag":635,"props":7545,"children":7546},{"style":647},[7547],{"type":611,"value":7548}," x, y ",{"type":606,"tag":635,"props":7550,"children":7551},{"style":641},[7552],{"type":611,"value":747},{"type":606,"tag":635,"props":7554,"children":7555},{"style":647},[7556],{"type":611,"value":7557}," test_cases:\n",{"type":606,"tag":635,"props":7559,"children":7561},{"class":637,"line":7560},80,[7562,7566,7570],{"type":606,"tag":635,"props":7563,"children":7564},{"style":647},[7565],{"type":611,"value":4593},{"type":606,"tag":635,"props":7567,"children":7568},{"style":641},[7569],{"type":611,"value":723},{"type":606,"tag":635,"props":7571,"children":7572},{"style":647},[7573],{"type":611,"value":7574}," cache.expensive_calculation(x, y)\n",{"type":606,"tag":635,"props":7576,"children":7578},{"class":637,"line":7577},81,[7579,7583,7587,7591,7596,7600,7604,7608,7612],{"type":606,"tag":635,"props":7580,"children":7581},{"style":793},[7582],{"type":611,"value":2924},{"type":606,"tag":635,"props":7584,"children":7585},{"style":647},[7586],{"type":611,"value":974},{"type":606,"tag":635,"props":7588,"children":7589},{"style":641},[7590],{"type":611,"value":1164},{"type":606,"tag":635,"props":7592,"children":7593},{"style":707},[7594],{"type":611,"value":7595},"\"Result: ",{"type":606,"tag":635,"props":7597,"children":7598},{"style":793},[7599],{"type":611,"value":1174},{"type":606,"tag":635,"props":7601,"children":7602},{"style":647},[7603],{"type":611,"value":6559},{"type":606,"tag":635,"props":7605,"children":7606},{"style":793},[7607],{"type":611,"value":1189},{"type":606,"tag":635,"props":7609,"children":7610},{"style":707},[7611],{"type":611,"value":1347},{"type":606,"tag":635,"props":7613,"children":7614},{"style":647},[7615],{"type":611,"value":1199},{"type":606,"tag":635,"props":7617,"children":7619},{"class":637,"line":7618},82,[7620],{"type":606,"tag":635,"props":7621,"children":7622},{"emptyLinePlaceholder":13},[7623],{"type":611,"value":658},{"type":606,"tag":635,"props":7625,"children":7627},{"class":637,"line":7626},83,[7628],{"type":606,"tag":635,"props":7629,"children":7630},{"style":647},[7631],{"type":611,"value":7632},"test_caching_performance()\n",{"type":606,"tag":635,"props":7634,"children":7636},{"class":637,"line":7635},84,[7637],{"type":606,"tag":635,"props":7638,"children":7639},{"style":647},[7640],{"type":611,"value":7641},"test_simple_cache()\n",{"type":606,"tag":1353,"props":7643,"children":7645},{"id":7644},"key-takeaways",[7646],{"type":611,"value":7647},"🎯 Key Takeaways",{"type":606,"tag":1365,"props":7649,"children":7653},{"emoji":7650,"title":7651,"type":7652},"📚","Performance Optimization Essentials","success",[7654,7662,7685,7693,7716,7724,7747,7755,7791],{"type":606,"tag":614,"props":7655,"children":7656},{},[7657],{"type":606,"tag":1375,"props":7658,"children":7659},{},[7660],{"type":611,"value":7661},"Measurement:",{"type":606,"tag":1381,"props":7663,"children":7664},{},[7665,7670,7675,7680],{"type":606,"tag":1385,"props":7666,"children":7667},{},[7668],{"type":611,"value":7669},"Always profile before optimizing",{"type":606,"tag":1385,"props":7671,"children":7672},{},[7673],{"type":611,"value":7674},"Use timing decorators for function analysis",{"type":606,"tag":1385,"props":7676,"children":7677},{},[7678],{"type":611,"value":7679},"Focus on the biggest bottlenecks first",{"type":606,"tag":1385,"props":7681,"children":7682},{},[7683],{"type":611,"value":7684},"Verify optimizations with tests",{"type":606,"tag":614,"props":7686,"children":7687},{},[7688],{"type":606,"tag":1375,"props":7689,"children":7690},{},[7691],{"type":611,"value":7692},"Data Structures:",{"type":606,"tag":1381,"props":7694,"children":7695},{},[7696,7701,7706,7711],{"type":606,"tag":1385,"props":7697,"children":7698},{},[7699],{"type":611,"value":7700},"Use sets/dicts for fast lookups (O(1) vs O(n))",{"type":606,"tag":1385,"props":7702,"children":7703},{},[7704],{"type":611,"value":7705},"Choose appropriate data structures for the task",{"type":606,"tag":1385,"props":7707,"children":7708},{},[7709],{"type":611,"value":7710},"Consider memory vs speed tradeoffs",{"type":606,"tag":1385,"props":7712,"children":7713},{},[7714],{"type":611,"value":7715},"Use generators for large datasets",{"type":606,"tag":614,"props":7717,"children":7718},{},[7719],{"type":606,"tag":1375,"props":7720,"children":7721},{},[7722],{"type":611,"value":7723},"Code Techniques:",{"type":606,"tag":1381,"props":7725,"children":7726},{},[7727,7732,7737,7742],{"type":606,"tag":1385,"props":7728,"children":7729},{},[7730],{"type":611,"value":7731},"Prefer list comprehensions over loops",{"type":606,"tag":1385,"props":7733,"children":7734},{},[7735],{"type":611,"value":7736},"Use built-in functions when possible",{"type":606,"tag":1385,"props":7738,"children":7739},{},[7740],{"type":611,"value":7741},"Cache expensive computations",{"type":606,"tag":1385,"props":7743,"children":7744},{},[7745],{"type":611,"value":7746},"Avoid premature optimization",{"type":606,"tag":614,"props":7748,"children":7749},{},[7750],{"type":606,"tag":1375,"props":7751,"children":7752},{},[7753],{"type":611,"value":7754},"Common Optimizations:",{"type":606,"tag":1381,"props":7756,"children":7757},{},[7758,7776,7781,7786],{"type":606,"tag":1385,"props":7759,"children":7760},{},[7761,7763,7769,7771],{"type":611,"value":7762},"String operations: use ",{"type":606,"tag":631,"props":7764,"children":7766},{"className":7765},[],[7767],{"type":611,"value":7768},".join()",{"type":611,"value":7770}," instead of ",{"type":606,"tag":631,"props":7772,"children":7774},{"className":7773},[],[7775],{"type":611,"value":830},{"type":606,"tag":1385,"props":7777,"children":7778},{},[7779],{"type":611,"value":7780},"Lookups: use sets instead of lists",{"type":606,"tag":1385,"props":7782,"children":7783},{},[7784],{"type":611,"value":7785},"Iteration: use comprehensions and generators",{"type":606,"tag":1385,"props":7787,"children":7788},{},[7789],{"type":611,"value":7790},"Functions: cache repeated calculations",{"type":606,"tag":614,"props":7792,"children":7793},{},[7794,7799],{"type":606,"tag":1375,"props":7795,"children":7796},{},[7797],{"type":611,"value":7798},"Remember:",{"type":611,"value":7800}," Premature optimization is the root of all evil - measure first!",{"type":606,"tag":1353,"props":7802,"children":7804},{"id":7803},"whats-next",[7805],{"type":611,"value":7806},"🚀 What's Next?",{"type":606,"tag":614,"props":7808,"children":7809},{},[7810],{"type":611,"value":7811},"Learn how to write reliable unit tests to ensure your code works correctly and catch bugs early.",{"type":606,"tag":614,"props":7813,"children":7814},{},[7815,7820,7821],{"type":606,"tag":1375,"props":7816,"children":7817},{},[7818],{"type":611,"value":7819},"Continue to",{"type":611,"value":2326},{"type":606,"tag":7822,"props":7823,"children":7824},"a",{"href":567},[7825],{"type":611,"value":568},{"type":606,"tag":7827,"props":7828,"children":7829},"style",{},[7830],{"type":611,"value":7831},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .app-dark-mode .shiki span {color: var(--shiki-app-dark-mode);background: var(--shiki-app-dark-mode-bg);font-style: var(--shiki-app-dark-mode-font-style);font-weight: var(--shiki-app-dark-mode-font-weight);text-decoration: var(--shiki-app-dark-mode-text-decoration);}html.app-dark-mode .shiki span {color: var(--shiki-app-dark-mode);background: var(--shiki-app-dark-mode-bg);font-style: var(--shiki-app-dark-mode-font-style);font-weight: var(--shiki-app-dark-mode-font-weight);text-decoration: var(--shiki-app-dark-mode-text-decoration);}",{"title":8,"searchDepth":36,"depth":36,"links":7833},[7834,7838,7839,7843,7844],{"id":1355,"depth":27,"text":1358,"children":7835},[7836,7837],{"id":1471,"depth":36,"text":1474},{"id":3025,"depth":36,"text":3028},{"id":4271,"depth":27,"text":4274},{"id":4436,"depth":27,"text":4439,"children":7840},[7841,7842],{"id":4442,"depth":36,"text":4445},{"id":6000,"depth":36,"text":6003},{"id":7644,"depth":27,"text":7647},{"id":7803,"depth":27,"text":7806},1782373764705]