I found importing posts was very slow. I could only import 1000 posts before having a time out.
I took a look closely to wordpress code and discovered that adding this line could give a hude optimization:
wp_defer_term_counting( true );
wp_defer_comment_counting( true );
Put that in your function file for example. But then, don't forget to remove it, or add this after you are done(just to be sure):
wp_defer_term_counting( false );
wp_defer_comment_counting( false );
I hope it will help someone!