| || |
|Performance considerations|| page 4 of 6|
Code for performance. Here are some ways to code with the aim to achieve the best performance:
- Use local variables. It is quicker to access local variables than to access class members.
- Avoid string concatenation. String concatenation decreases performance and can increase the application's peak memory usage.
- Use threads and avoid synchronization. Any operation that takes more than 1/10 of a second to run requires a separate thread. Avoiding synchronization can increase performance as well.
- Separate the model using the model-view-controller (MVC). MVC separates the logic from the code that controls the presentation.