exiftool performance benchmark

Started by Phil Harvey, April 16, 2010, 11:25:53 AM

Previous topic - Next topic

BogdanH

Quote from: Phil Harvey on October 24, 2010, 12:32:31 PM
...
But if you are doing this when extracting information you will need some way to tell that each command has finished, so I will write a "[ready]" message to stdout after processing is done for each command.)
-I assume "[ready]" will only be sent, if ExifTool is in -stayOpen "mode".
Anyway, I'm very curious on how much impact that feature will have :)

Bogdan

Phil Harvey

Quote from: BogdanH on October 29, 2010, 12:46:52 PM
-I assume "[ready]" will only be sent, if ExifTool is in -stayOpen "mode".

Yes. Only if -stay_open is used.

I changed a few details: The option is now -stay_open (with an underline), and the ready message is now "{ready}" (with curly brackets).

Quote
Anyway, I'm very curious on how much impact that feature will have :)

I plan to release this tomorrow so you will see then how much it speeds things up.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

#17
I've released 8.36 with the -stay_open option.  Already there are 2 bugs discovered by a user.  These will be fixed in the next release:

1) -stay_open false only works for all lowercase "false".

2) Comments in the ARGFILE aren't ignored as they should be when -stay_open is used.

- Phil

Edit:  And another thing I will change in the next release:  ExifTool currently prints the documentation page if nothing was done, but this doesn't make any sense if a -stay_open argfile was parsed (could be the application was quit before any exiftool commands were needed).  So I will disable the help page in this case.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

etcetera

Testing -stay_open, looks mostly fine to me...

Notes on usage:

1. Fire up exiftool: (todo.arg is an empty but existing file)
exiftool -stay_open True -@ todo.arg

2. writing a bunch of commands to a 2nd file called "todoparams.arg", and then writing this to the todo.arg:
   -@
   todoparams.arg
   filename.ext
   -execute

(make sure there's a <nl> after -execute!)
This means I can keep building new arg-file content to todoparams.arg, and then just adding those 4 lines to the original todo.arg

3. In the end I then add
   -stay_open
   false


to the todo.arg file, and I'm done...

Works for me. A wish could be a way to clear the initial file completely between new commands, such that it need not grow and/or leave a trace of all commands issued. If I clear the initial todo.arg file now, it seems to loose track of the current EOF-position of the file. I think the last checked file position should be reset to filesize after any cheking/reading of new arguments... (but not a big issue!)

-etc



Phil Harvey

Quote from: etcetera on October 31, 2010, 07:38:11 AM
A wish could be a way to clear the initial file completely between new commands, such that it need not grow and/or leave a trace of all commands issued.


Thanks for this suggestion.  I did think about this already.  You can always avoid the file growing by using a pipe, but I understand that this may not be possible or convenient for some applications.

I couldn't figure out how to reset the file length because there are race conditions which would make it too easy to miss commands this way. (ie. if you reset the file and write exactly the same commands again before exiftool reads anything, then it would have no way to tell that you actually wrote anything.)

But I have just come up with a mechanism to allow you to switch input ARGFILEs by writing the following to the currently open ARGFILE:

    -stay_open
    True
    -@
    NEWARGFILE


This will allow you to effectively reset the argfile by switching to a new one whenever you want.  ExifTool version 8.37 (just released) has this new feature.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

etcetera


MOL

#21
Is there a way to access an ARGFILE which has been created in memory from within EXIFTOOL? Just wondering.

Phil Harvey

Quote from: MOL on October 31, 2010, 05:58:18 PM
Is there a way to access an ARGFILE which has been created in memory from within EXIFTOOL? Just wondering.

There is no way to share memory directly, but going through a pipe avoids creating an ARGFILE:  Execute the exiftool command with -@ - and your standard output piped to exiftool's standard input, then print the contents of your memory to stdout.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Mart

is the -recurse option shoud be also considered as "no Perl startup time penalty"?

Phil Harvey

Quote from: Mart on November 09, 2010, 07:20:59 AM
is the -recurse option shoud be also considered as "no Perl startup time penalty"?

The -recurse option processes all subdirectories as part of the same command, so there is no additional overhead for processing subdirectories (or additional files and/or directories specified on the same command line for that matter).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Christian Etter

A M A Z I N G

To see this new option...

Looking forward to publishing another benchmark soon.

I was already suspecting that it would be difficult to pipe more than one file into stdin due to a lack of file separators, so the missing of Unicode support in this case is something we need to accept.

Christian


jean

Hello

* I create an empty file named todo.arg
* i open an msdos box and i enter
     exiftool -stay_open True @ todo.arg
* i open another msdos box and i create (in the same folder) a file named test.arg
* i enter in test.arg:
-EXIF:All
c:\exif\test.jpg
-execute

(there is a new line after -execute)
* i copy test.arg on todo.arg
In the first msdos box the EXIF infos are displayed :-)
the last line is <ready>

* i reopen test.arg and i change -EXIF:All with -IPTC:All
* i copy test.arg on todo.arg
and... nothing's happening. (IPTC infos exist in the file)

Please help

jean

I found a solution (it's perhaps the 'normal' behaviour, sorry)
I added the second file after the first one.
It worked, the todo.arg was read but the two first chars were mangled.
eg:

-EXIF:All
c:\test\exif.jpg
-execute

OK

then i add

-IPTC:All
c:\test\iptc.jpg
-execute

File not found: PTC:All


Phil Harvey

Instead of copying test.arg onto todo.arg, do this:

type test.arg >> todo.arg

This adds the lines to todo.arg.  Exiftool continues reading from the last position in the file, so it won't work if you replace lines that it has already read.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

jean

I can use 'type' from a commandline but i don't think it's possible from a program