docs: add warning to ExtensionBasedMapper regarding performance

Closes #333
This commit is contained in:
Ruben Taelman 2020-11-23 13:41:55 +01:00 committed by Joachim Van Herwegen
parent f23073b87f
commit 1438fd8106

View File

@ -36,6 +36,11 @@ export interface ResourcePath {
* a new extension will be appended (with a `$` in front of it). * a new extension will be appended (with a `$` in front of it).
* E.g. if the path is `input.ttl` with content-type `text/plain`, the path would actually be `input.ttl$.txt`. * E.g. if the path is `input.ttl` with content-type `text/plain`, the path would actually be `input.ttl$.txt`.
* This new extension is stripped again when generating an identifier. * This new extension is stripped again when generating an identifier.
*
* Warning: Since this mapper iterates over all files in the requested directory,
* it can experience performance issues over directories with a huge number of files (10.000+).
* For typical directory structures, the performance of this mapper should be sufficient.
* @see https://github.com/solid/community-server/issues/333
*/ */
export class ExtensionBasedMapper implements FileIdentifierMapper { export class ExtensionBasedMapper implements FileIdentifierMapper {
protected readonly logger = getLoggerFor(this); protected readonly logger = getLoggerFor(this);