After a little investigation, the excessive time could be traced to a single type of operation that occurs several times in this component inside the Validate and ReinitializeMetaData methods. It's quite a common thing to do - so if you happen to have created any components for SSIS, I suggest you read on .
What's Slow?

To avoid those iterations, I constructed my own "temporary" collection(s) with the same elements to iterate over instead. In some cases I used a Hashtable (keyed by column name or lineage ID), and in some cases a simple List was just fine. I still incurred one performance hit in building my temporary collection - because I had to iterate over the COM collection once. After that, smooth sailing and a huge performance increase.
Warning...
Do be a little careful though! Creating a temporary collection to "mirror" the built-in one is perfectly safe when in the Validation context, because nothing is permitted to change. However, you have to watch your own code and the "staleness" of your collection in the ReinitializeMetaData context. Both you and SSIS can be altering the input and output collections at this time. So if you're playing with the UsageType on inputs, or adding or removing columns from asynchronous outputs, you'll have to make similar adjustments to your temporary collections or they'll get out of sync.
No comments:
Post a Comment