Is it normal for txn.commit() to take long?

I’m running a slightly larger transaction, but not huge, in which I’m creating around 3K nodes, and then creating edges between them (about 2K edges, created using triples).
I’m splitting these operations into smaller chunks and running txn.mutate() for each chunk, which resolves reasonably fast.

But when I call txn.commit(), it takes over twenty seconds to resolve.
I was under the impression that txn.commit() was a lightweight operation… Was I mistaken ? If so, what is actually happening when commit is called ? If not, what could explain the slow response ?

I’m running this in a dockerized instance of dgraph running my macbook pro with lru_mb set to 4gb.
I’m using the nodejs client.

I’ve now increased the size of the chunks (and therefore reducing the number of mutations) which has sped up the operation significantly.