Performance: Making things go faster
Measure twice, optimize once
How do we measure?
- Java
- jvisualvm
- Can't be using docker!
- Python
- profile
- cProfile: same thing in python 3
- sort=cumtime
- profile
- C
- harder and more system-specific
- linux: perf
- os x: sample
- ps
- sample 5773 30
- harder and more system-specific
Getting around player killing
- Print early
- Connect in progress
- Exit Early
Case study: finding nearest units
- Starting problem: find the nearest enemy for all units
- Isolate the problem so it's easy to work with