This repository has been archived by the owner on Apr 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* perf: concurrent file import Adds two new options: `fileImportConcurrency` This controls the number of files that are imported concurrently. You may wish to set this high if you are importing lots of small files. `blockWriteConcurrency` This controls how many blocks from each file we write to disk at the same time. Setting this high when writing large files will significantly increase import speed, though having it high when `fileImportConcurrency` is also high can swamp the process. It also: 1. Flattens module options because validating deep objects was clunky and the separation of access to config sub objects within this module isn't very good 1. Replaces `superstruct` and `deep-extend` with `merge-options` which is better suited for merging options and is smaller 1. Replaces `async-iterator-*` modules with the more zeitgeisty `it-*` namespace Supersedes #38, sort of. No batching but atomicity guarantees are maintained and performance gains are broadly similar with the right tuning.
- Loading branch information
1 parent
b5e5b5a
commit 68ac8cc
Showing
22 changed files
with
124 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,33 +38,34 @@ | |
"homepage": "https://github.com/ipfs/js-ipfs-unixfs-importer#readme", | ||
"devDependencies": { | ||
"aegir": "^20.0.0", | ||
"async-iterator-buffer-stream": "^1.0.0", | ||
"async-iterator-last": "^1.0.0", | ||
"chai": "^4.2.0", | ||
"cids": "~0.7.1", | ||
"deep-extend": "~0.6.0", | ||
"detect-node": "^2.0.4", | ||
"dirty-chai": "^2.0.1", | ||
"ipfs-unixfs-exporter": "^0.39.0", | ||
"ipld": "^0.25.0", | ||
"ipld-in-memory": "^3.0.0", | ||
"it-buffer-stream": "^1.0.0", | ||
"it-last": "^1.0.0", | ||
"multihashes": "~0.4.14", | ||
"nyc": "^14.0.0", | ||
"sinon": "^7.1.0" | ||
}, | ||
"dependencies": { | ||
"async-iterator-all": "^1.0.0", | ||
"async-iterator-batch": "~0.0.1", | ||
"async-iterator-first": "^1.0.0", | ||
"bl": "^4.0.0", | ||
"deep-extend": "~0.6.0", | ||
"err-code": "^2.0.0", | ||
"hamt-sharding": "~0.0.2", | ||
"ipfs-unixfs": "^0.2.0", | ||
"ipld-dag-pb": "^0.18.0", | ||
"it-all": "^1.0.1", | ||
"it-batch": "^1.0.3", | ||
"it-first": "^1.0.1", | ||
"it-parallel-batch": "1.0.2", | ||
"merge-options": "^2.0.0", | ||
"multicodec": "~0.5.1", | ||
"multihashing-async": "^0.8.0", | ||
"rabin-wasm": "~0.0.8", | ||
"superstruct": "^0.8.2" | ||
"rabin-wasm": "~0.0.8" | ||
}, | ||
"contributors": [ | ||
"Alan Shaw <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
'use strict' | ||
|
||
const batch = require('async-iterator-batch') | ||
const all = require('it-all') | ||
|
||
module.exports = async function * (source, reduce) { | ||
const roots = [] | ||
|
||
for await (const chunk of batch(source, Infinity)) { | ||
roots.push(await reduce(chunk)) | ||
} | ||
|
||
yield roots[0] | ||
yield await reduce(await all(source)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.