I implemented two algorithms in Java.
To compare their effectiveness, I call each function 1000 times and compare the execution time (using System.currentTimeMillis()
).
It needs 2500 ms to execute the first one and 1300 ms for the second one.
With these results, I thought have a significative difference (in term of execution time) in JavaCard.
But if I load 2 applets on a JavaCard, which correspond to the functions described, the first one takes 2000 ms and the second one 1750 ms...
How explain that in Java, it looks almost 2 times faster, but not in JavaCard ? I paid attention that I don't write in EEPROM but in RAM so it can't be the source of the problem.
Do you have any argument to explain this phenomenon ? Thank you in advance.