How Can I Improve the Performance of a Mendix Application?

0
Hello everyone!! I am currently working on a Mendix application and I am looking for ways to improve its performance. I've noticed that the app can be slow at times and I want to optimize it to ensure a smoother user experience. Could you please share some best practices or tips for making a Mendix application faster and more efficient? Specific areas of interest include: Optimizing database queries Efficient use of microflows and nanoflows Best practices for using widgets and custom JavaScript Handling large datasets General tips for performance Any advice, resources, or examples would be greatly appreciated! Thank you in advance for your help.
asked
2 answers
0

Hey João,

I'm going to answer your question giving some examples/tips for each topic.

 

Optimizing Database Queries

  • Make sure the attributes you query often have indexes. This can make reading data much faster.

  • Break down complex XPath queries into smaller, simpler ones whenever you can

  • Try not to use functions like "contains" in XPath queries on large datasets because they aren't indexed and can slow things down

  • When dealing with large datasets, process them in batches instead of all at once to avoid overloading the system

Efficient Use of Microflows and Nanoflows

  • Avoid using nested loops if possible, as they can significantly slow down your application

  • Consider using asynchronous microflows to keep the user interface responsive

  • Use in-memory cache (like non-persistent entities) for data that is accessed frequently

Best Practices for Using Widgets and Custom JavaScript

  • Whenever possible, use the built-in widgets provided by Mendix because they are optimized for performance

  • Write efficient JavaScript, minimizing changes to the DOM

Handling Large Datasets

  • Aggregate and process data on the backend to reduce the amount of data sent to the client

  • Split large entities into smaller, related entities to handle data more efficiently

  • Process large datasets in batches to manage the load better

 

General tips for performance

  • Use the Best Practice bot available in studio. You can get a lot of hints from it.

 

Doc: https://docs.mendix.com/refguide/community-best-practices-for-app-performance/

 

Best Regards,

Ricardo Pereira

answered
0

Hello Joao,

 

A good place to start is here with the documentation of mendix:

 

https://docs.mendix.com/refguide/community-best-practices-for-app-performance/

 

Further does the mendix bot best practice recommender helps you in studio pro with aligning your application to these best practices.

 

Big difference makers for me where mainly the set up of your domain model, using denormalization, using indexes, and trying to use asynchronous call/processes if possible. 

 

But there is many many more

 

Hope this gives you a nudge in the right direction

 

Good luck!

answered