Hi,
When working with a custom Item type, creating a field of type User, we notice a performance leak.
- We create the field https://www.screencast.com/t/0JGDorEDOQb
- Our intent was to get the group Id and then do something with it.
- We used Model.Item.GetString("OnlyShowToLoginsFrom")
- In Development we did not notice anything special
- When we deployed the code to another environment with more data, we started to experience extreme slowness
Turns out that Model.Item.GetString("OnlyShowToLoginsFrom") ended up rendering the users of the groups, or at least the user addresses of those users, because this is what we got using debug=true https://www.screencast.com/t/NOjBdiWTj2
- It seems to query the AccessUserAddress table for each user
- It doesn't even cache it
- Refreshing would trigger the same logs
- We were using the code twice on the same page (2 separate templates) - so we were getting hit twice
We ended up using Model.Item.GetRawValueString(), and everything went back to normal. But should we be getting this experience? I was expecting that:
- Model.Item.GetString() would simply return a string value and not trigger some additional data to be requested
- Model.Item.GetUsers() would trigger that
- The response would have been cached so that at least a refresh would not cause it
Best Regards,
Nuno Aguiar