Performance impact of function properties in the data model

The Appfarm documentation warns against using runtime function properties on large data sources. Data model function properties are also calculated at runtime, but the documentation does not explicitly warn against using them on large data sources. Are there any guidelines on how data model function properties impact app performance?

In my case, the function would only do a simple string manipulation on a string field stored in the data model.

Hi!

I thought this was a perfect question to ask Appfarm AI about and the answer I recieved is pretty spot on. Please see the provided answer below and let me know if anything is unclear :slight_smile:

You’re correct that both runtime function properties (on data sources) and data model function properties (on object classes) are calculated at runtime. However, there are important differences in when and how often they are recalculated, which impacts performance differently.

Data Model Function Properties:

Data model function properties are calculated when objects are read from the database and are stored in memory as part of the object. They are recalculated when:

  • Objects are first loaded into a data source

  • The object or related data changes in ways that affect the function’s dependencies

For simple string manipulation on a single field (like your use case), the performance impact is typically minimal because:

  • The calculation happens once when the object is loaded

  • String operations are generally fast

  • There’s no complex data traversal or aggregation

Runtime Function Properties (on Data Sources):

Runtime function properties can trigger more frequent recalculations, especially when they reference other data sources or when actions modify related data. The documentation specifically warns about these because they can cause “Run Full Formula Recalculation” events, which you might see in Developer Tools warnings.

Guidelines for Your Use Case:

For a simple string manipulation on a stored field, using a data model function property is perfectly fine and should have negligible performance impact, even on large data sources. The calculation is straightforward and doesn’t involve complex operations or cross-data-source references.

When to be cautious:

Performance concerns arise when function properties (either type) involve:

  • Aggregating data from large arrays or related data sources

  • Deep data bindings across multiple object class references

  • Complex calculations that execute on every object in a large data source

  • Functions that reference other data sources that might trigger cascading recalculations

For your specific scenario with simple string manipulation, you should be safe to proceed with a data model function property without heavy performance concerns.

For more details on optimizing performance, see the Performance Optimization guide.

Additionally, depending on your use case - if the function property is information you only need in certain scenarios, you could also consider updating a runtime property on a whole data source before displaying or using it in the application. This gives you more control over when the calculation occurs, which can be beneficial if you’re working with very large datasets and only need the calculated value in specific views or workflows.

Malin

1 Like