Restructure performance tips (#54211)
This PR makes the documentation page on "performance tips" more
accessible and structured.
- Restructure the page into four main sections:
1. General advice
2. Type inference
3. Memory management and arrays
4. Miscellaneous
- Increase subsection depth of individual items and move them into the
appropriate category
- Try to put the most important items first, and the least important
last
- Rename one header to unify style
**No content has been modified, this is strictly copy-paste and moving
things around**