# addAll with { wrapWithDirectory: true } is very slow

**URL:** <https://discuss.ipfs.tech/t/addall-with-wrapwithdirectory-true-is-very-slow/13340>\
**Category:** js-ipfs\
**Created:** [February 1, 2022, 11:02am UTC](https://discuss.ipfs.tech/t/addall-with-wrapwithdirectory-true-is-very-slow/13340 "2022-02-01T11:02:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![watanabe1113](https://avatars.discourse-cdn.com/v4/letter/w/97f17d/32.png) [@watanabe1113](https://discuss.ipfs.tech/u/watanabe1113)\
**Post date:** [February 1, 2022, 11:02am UTC](https://discuss.ipfs.tech/t/addall-with-wrapwithdirectory-true-is-very-slow/13340/1 "2022-02-01T11:02:24Z")

</div>

> const sources = files.map((file) =\> ({ path: `${file.index}${extension}`, content: file.buffer }));  
> for await (const result of ipfs.addAll(sources, { wrapWithDirectory: true })) {  
> Logger.log(`Uploaded: ${result.path}`);  
> if (result.path === “”) {  
> rootCid = result.cid.toString();  
> }  
> }

> const sources = files.map((file) =\> ({ path: `root/${file.index}${extension}`, content: file.buffer }));  
> for await (const result of ipfs.addAll(sources)) {  
> Logger.log(`Uploaded: ${result.path}`);  
> if (result.path === “root”) {  
> rootCid = result.cid.toString();  
> }  
> }

The rootCid will be the same for both of the above codes, but { wrapWithDirectory: true } is very slower. Why is this?
