Load product attributes more performant

Recently I had performance issues when importing several ten tausend products. The problem was, that I always used the “normal” product entity model to load attribute values. The following snippet shows, how to load product attributes directly instead. Therefore I use the product resource singleton.

Performance optimized attribute saving

Sometimes, when you have to handle many data-sets, it is more efficient to save only those attributes that have changed:

 

Automatically load custom product attribute with collection (every time)

You can do this with the following XML in your config.xml:

But ATTENTION: This can become a performance issue, because it loads the attribute every time the product collection is loaded! If you added too many attributes, the performance can get worse!