Skip to main content
New Hire Training

General Tips


Optimizing your Mendix App


When you are building Mendix Apps, avoid/implement the following to make your app more efficient and to decrease load times:

  1. Remove Commits Inside of Loops

    1. When working with loops, committing inside of it adds unnecessary resource usage. Instead, create a list outside of the loop, and when you need to commit an object, add it to the list. After the loop, commit the list. This is especially important for large data sets, which would bloat the number of commits.
  2. Avoid Nested Loops

    1. Just like in traditional code, nested for loops are incredibly inefficient. While sometimes these are unavoidable, remove as many as you can. One common place this is done is for data sorting. Proper use of X-Path and list filtering actions should be able to avoid these for loops.
  3. Use Nanoflows

    1. Nanoflows run more efficiently than microflows since they are run in the browser instead of on the the server. Microflows require a round trip to the server and back so while this is a small optimization, it adds up on larger apps.
    2. It is important to note that nanoflows have some differing actions from microflows. If you need extended nanoflow functionality, download this module: https://marketplace.mendix.com/link/component/109515
  4. Retrieving by Association

    1. Retrieving by association is faster and less resource intensive. When possible, use it.
    2. It is important to note that retrieving over association will capture changes that have not been committed while retrieving from the database will not have these changes.
  5. Avoid Excessive Retrieves In List Views (LV) and Template Grids (TG)

    1. When you use one of these views on a page, adding retrieves has a large resource demand, which scales as the number of objects in the LV/TG. You will not see a large resource used for small list views (1-5 items), but the effect is exponential with larger sets. This effect is even worse when you have an LV/TG inside an LV/TG.
    2. When you need a lot of data views inside your LV, consider creating a new entity that will contain all the data you need. This will decrease the server resources required for the page.
  6. Decreasing Page Load Times

    1. If you have done all of the above and still have long load times, use this widget: https://marketplace.mendix.com/link/component/50833
    2. This widget allows you to load parts of your page independently, allowing the page to partially open and have part of it load asynchronously.
    3. There are video tutorials for this here.

Mendix Keyboard Shortcuts

Here is the link to the Mendix website for a complete list of their keyboard shortcuts: https://docs.mendix.com/refguide/keyboard-shortcuts/

Here are a few specific shortcuts that we commonly use at OIT:

  • Ctrl + F: Opens search dialog box. This allows you to search your complete Mendix app for specific text
  • Ctrl + G: Goes to any document or domain model element. This allows you to search you entire app for a specific element or page.
  • Ctrl + W: Closes the current page/microflow you're working on.
  • Ctrl + Shift+ S: Saves all changes you've made on your app.
  • F5: Runs the app locally so you can test it and debug your app
Previous Topic
Helpful Links and Resources
Next Topic
The Technical Challenge
Was this topic helpful?
Thanks for your feedback.