[xsl] The time to execute a function is 625 times greater than the sum of the times to execute the statements in the function

Subject: [xsl] The time to execute a function is 625 times greater than the sum of the times to execute the statements in the function
From: "Roger L Costello costello@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 1 Aug 2020 19:03:29 -0000
Hi Folks,

I am having great difficulty determining why my XSLT neural network program
runs so slow. I am currently focusing on the f:train function. The Saxon
profile tool reports the gross total time for one call to the f:train function
is 5,460.326 ms.

To see how much time each statement in f:train takes, Michael
M|ller-Hillebrand suggested that I put each statement into its own function.
Great idea! I did so. I ran the Saxon profile tool on the modified f:train and
you can see below the gross total time required for each statement (each
statement is now in its own function). I summed their times and it came to a
total of 8.742 ms. So, the f:train function should take 8.742 ms but instead
it takes 5,460.326 ms. How can it possibly be that the time to execute the
f:train function is 625 times greater than the sum of the times to execute the
statements in the function? Any suggestions?

/Roger

f:count-inputs-list						0.016
f:create-inputs							0.039
f:count-targets-list						0.004
f:create-targets							0.520
f:create-hidden-inputs						0.060
f:create-hidden-outputs						0.058
f:create-final-inputs						0.054
f:create-final-outputs						0.008
f:compute-output-errors					0.025
f:compute-hidden-layer-errors					2.612
f:compute-Ek_times_Ok					0.030
f:compute-One_minus_Ok					0.017
f:compute-updated-layer-values				0.003
f:compute-output-transposed					0.003
f:compute-weight-changes					0.003
f:compute-learning-rate-multiplied-by-weight-changes		0.100
f:compute-updated-who					0.034
f:compute-Ek_times_Ok-v2					0.006
f:compute-One_minus_Ok-v2					0.008
f:compute-updated-layer-values-v2				0.006
f:compute-output-transposed-v2				0.004
f:compute-weight-changes-v2					0.004
f:compute-learning-rate-multiplied-by-weight-changes-v2	0.060
f:compute-updated-wih						0.027
f:compute-neural-network-with-new-wih			4.959
f:compute-neural-network-with-new-wih-and-new-who		0.085
Total Time: 							8.742

Current Thread