Looping the each item in the Item collection is querying the database.
So if there is 50000 items to be inserted on your SharePoint list, your code will call the DB query 50000 times. Its process intense and overhead on SQL server.
In such scenario consider to use the ProcessBatchUpdate method of SPWeb class and also ContentIterator API.