Don't spawn a separate thread if there is only one input file#34
Don't spawn a separate thread if there is only one input file#34jhurliman wants to merge 2 commits intospotify:masterfrom
Conversation
src/main.cxx
Outdated
There was a problem hiding this comment.
A better location for this comment might be up by the #ifdef _WIN32 directive. It could also be that use_threads is false because the user is processing one file on a system which does, in fact, support threads.
|
The current patch properly handles the case where the system supports threads but only one file is being processed (tested on OSX Lion with a single input file), but that's a good point about combining the #ifdef _WIN32 statements together. I'll submit a new pull request when I get a moment. |
|
I took another look at this patch and I didn't see another more obvious place for the use_threads variable. Putting it any earlier in the file means the count variable won't be initialized, breaking |
|
Oh, I meant just for the comment, not the variable itself. (So it should be a trivial modification..?) |
|
Bumping this patch for consideration. |
|
Thanks, @jhurliman! We're accepting this patch and it will be merged in. |
|
Just checking on the status of this |
This patch changes the logic in main.cxx (for platforms where echoprint-codegen can spawn multiple threads) to only spawn threads when more than one file is being fingerprinted. This results in a significant speedup for a common use case where echoprint-codegen is ran once per input file.