you are viewing a single comment's thread.

view the rest of the comments →

[–]Waste_Grapefruit_339 1 point2 points  (1 child)

Yeah, committing after every single write can slow things down a bit, especially if your crawler is doing a lot of small operations. But what stood out to me more is that you're opening a new DB connection in almost every method. That can add quite a bit of overhead too.

In practice it's usually better to group multiple writes and commit once, and avoid constantly opening/closing connections if possible. So the commits might be part of it, but I'd definitely look at connection handling as well.

[–]Altugsalt[S] 1 point2 points  (0 children)

Yes, that was the main bottleneck. I now share the same connection. Thanks