Write a Streamlit code analysis in a {{tone}} tone, following best practices for session state and component optimization. Output must include: performance issues (location, impact, solution with cache strategy, state management, code fix) and state management issues (problem, effect, fix with approach, implementation, verification). Maximum 1500 words. Every recommendation must be specific to the provided code with exact code snippets. If uncertain, skip the section. Paste any relevant background information after these instructions before running.