title: Creating/Updating products programatically in Magento
body: <p>I've written a module to import products and I'm currently using Magento's product model to add/update products accordingly. However, this is proving to be very slow (possibly because I have the catalog index enabled?).</p>
  
  <p>Even doing just</p>
  
  <pre><code>$product = Mage::getModel('catalog/product')-&gt;load($id);
  $product-&gt;save();
  </code></pre>
  
  <p>Is incredibly slow - We're talking maybe 2 seconds per product (I'm doing 5 per http request, and using javascript to make several requests).</p>
  
  <p>Each product needs to have some attributes updated, category ids changed, and the stock levels updated. At the moment, I'm looping through 20 products and it's taking near enough 60 seconds. In production, it will be looping through 200-300 products (although on a much more powerful server).</p>
  
  <p>Is there a better/faster way of creating/updating the products? Obviously I could just use SQL but I don't fancy figuring out Magento's intense EAV database structure!</p>
  
  <p>Sorry if this is a naff question, I'm not sure how best to word it!</p>