Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exiftool-vendored v15.11.0 seems to be reading tags from ICC profile files much slower #15

Closed
rubiesonthesky opened this issue Feb 23, 2022 · 3 comments

Comments

@rubiesonthesky
Copy link

Describe the bug

I have test setup for reading 13 icc profile files from disk and using exiftool-vendored to read their tags and return metadata.ICC_Profile.ProfileDescription. After updating to 15.11.0, my test setup fails because it goes over default mocha time limit (2000ms). When setting really big timeout, this test takes to complete 7783ms. While I think there are a lot thinks to optimize in the actual code, it was finishing close to 2000 ms (eg. 1895ms) with version 15.10.1, this newer version takes a lot more time to do it.

I timed the function in the real app (running under ts-node) and the result is same.

  • 15.11.0 : 7837 ms
  • 15.10.1 : 1918 ms

I suspect something in the batch-cluster library changed and could be the problem? I did not see anything else really changing between these too versions.

Actually, I did not some testing and overriding batch-cluster to be version 8 produces same result with 15.11.0 than with 15.10.1. -> test does not fail.

To Reproduce

So I have some code like this

  export async function getProfilesFromFolder(dir: string) {
    const files = await promises.readdir(dir);
    const profileFiles = files.map(async file => await exifToolEngine.getProfileNameFromFile(path.resolve(dir, file)));
    return Promise.all(profileFiles);
  }

  async getProfileNameFromFile(filePath: string) {
    const metadata = await this.exifTool.read(filePath, ["-j", "-g"]);
    return Promise.resolve({file: filePath, name: metadata?.ICC_Profile?.ProfileDescription});
  }

And them my mocha test is something like this

    it('get default profiles', async function () {
      const profiles = await getProfilesFromFolder(profileDir());
      assert.equal(profiles?.length, 13);
    });

Expected behavior

I did not expect the function to be this much slower.

Environment (please complete the following information):

  • OS and version: Mac OS X 12.12
  • Node.JS version tested on v16.13.1 and v16.14.0
@mceachen
Copy link
Member

Thanks for reporting. I'll try to reproduce this on my mac today.

@mceachen mceachen transferred this issue from photostructure/exiftool-vendored.js Feb 23, 2022
@mceachen mceachen changed the title v15.11.0 seems to be reading tags from ICC profile files much slower exiftool-vendored v15.11.0 seems to be reading tags from ICC profile files much slower Feb 23, 2022
@mceachen
Copy link
Member

mceachen commented Feb 24, 2022

I just released batch-cluster v10.1.1 which should resolve this issue.

@rubiesonthesky
Copy link
Author

Thank you for very quick fix! Can confirm that this fixed the issue :)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants