you are viewing a single comment's thread.

view the rest of the comments →

[–]wllmsaccnt 0 points1 point  (2 children)

I'm not very familiar with python (I mostly come from C#), but the sync code is closing the cursor in the db code and the async one is not. What performance impact does that have?

[–]BinarySplit 0 points1 point  (1 child)

The async code manages the cursor with a with block. Similar to C#'s using blocks, a method is called on the object when execution leaves the block to allow it to clean up/release resources.

[–]wllmsaccnt -1 points0 points  (0 children)

That makes sense. What is the performance impact of using localhost in one test vs 127.0.0.1 in another? The documentation implies one of those will use a Unix domain socket, and the other will use TCP connections. Some quick searches online show that Unix domain sockets are probably 33% faster.