Expression Taking Too Long

I have a task which happens to be a Windows 10 in-place upgrade that is getting the following messages in the log.

RelevantMessage: expression taking too long, file ‘Action 389109.fxf’, fixlet id 389109

Unspecified action exception

The relevance statement below is takes 16282.202 ms to evaluate. Would that be the problem?

exists file “c:\programdata\Windows10-IPU\sources\install.wim” whose (sha1 of it = “603a65ba450a055fb7fad353e553701317a0c972”)

Yes, most likely.

The times reported in the debugger are going to be 80-100x slower in the native client,given normal CPU throttling. Calculating a file’s sha1 hash is an expensive operation as every byte of the file must be read.

You should avoid using sha1 in fixlet relevance if at all possible - better that the relevance just check the file’s existence, size, maybemodification time.

Then in the actionscript you could use
continue if {sha1 of file "xxx" = [whatever value]}
So the action would return Failed if the file is incorrect. This way you only evaluate while the action is running, you don’t tie up the client evaluation loop on every cycle.

Thanks Jason. I am going to change the relevance to check for the size of the file.