Hi, The attached patch modifies the ~org-babel-tangle~ function to avoid a quadratic behavior in the number of blocks tangled to a single file. Tangling an org buffer with 200 blocks to 5 different files yields a 25 % speedup. * lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Group collected blocks by tangled file name. (org-babel-tangle): Avoid quadratic behavior in number of blocks. -- Sébastien Miquel