inline fpc_initialize and fpc_finalize when possible
Original Reporter info from Mantis: BeniBela @benibela
-
Reporter name: Benito van der Zander
Original Reporter info from Mantis: BeniBela @benibela
- Reporter name: Benito van der Zander
Description:
Every record variable containing a reference counted type is initialized using fpc_initialize and freed using fpc_finalize.
But it is extraordinary slow as it uses rtti to discover which fields to initialize.
It is much faster to just zero the entire record with FillChar than to cherry pick some fields. (although zero might not work with variants? but it can fallback for that)
If there is a single field, it can directly be zeroed.
Similarly fpc_finalize can be replaced by a call to the actual finalizing function, at least if there is only one such field in the record.
Mantis conversion info:
- Mantis ID: 30333
- Version: 3.0.0
- Monitored by: » luizamerico (Luiz Americo), » Vincent (Vincent Snijders)