Performance cannot be negligible, depending on how often you access the field by name. If you use it for each field and each row, you may notice a decrease in performance (see, for example, http://www.delphifeeds.com/go/s/74559 ). To improve readability, you can improve performance:
- Use the syntax
['FieldName'] or FieldByName () only once and store the field reference in a variable. - Use static ad
, right-click the dataset, select Field Editor and add the required fields. It will declare a suitable TField descendant and allow you to assign a name.
In addition, AsXXXXX calls may be slower than using the native Value property for TField descendants.
user160694
source share