Build for performance
Client-side performance is just as important as server-side performance, but it's even easier to negatively impact client-side performance, since any server lookups have the potential to lock up the user's browser for a couple of seconds. Even scripted actions which you might not think would result in server lookups, such as updating a reference field value, can result in a synchronous server lookup, which can negatively impact a user's browser performance.
It's important to understand which actions may result in performance-impacting server lookups, as well as how (and when) to mitigate that performance impact using asynchronous callback functions or by combining lookups into one request and providing all of the information that would otherwise need to be looked up from the server when a field is populated, as with reference fields.
Reference fields
As we alluded to above, reference fields have a unique property that in order to populate them manually (i.e.: not from...