Semgrep is a tool that enables developers to search their code for security vulnerabilities, built with an OCaml engine and a Python frontend. This has come with a fair amount of performance pain. In this talk, I'll share some of the worst problems we ran into, how we found them, and how we solved them (mostly, rewriting Python code in OCaml).