我正在寫一個JBenchX方法,它使用flexiprovider計算CMSS簽名的密鑰。我想爲我的方法createKeys獲取時間,但這非常慢。沒有annnotation @Bench太快了< 1秒。你能幫助理解這裏發生了什麼嗎?JBenchX日食很慢
import de.flexiprovider.api.exceptions.NoSuchAlgorithmException;
import de.flexiprovider.api.keys.KeyPair;
import de.flexiprovider.api.keys.KeyPairGenerator;
import org.jbenchx.annotations.Bench;
import org.jbenchx.annotations.ForEachInt;
import org.jbenchx.annotations.ForEachString;
import org.jbenchx.annotations.SingleRun;
public class CMSSTest {
@Bench
public Object createKeys(@ForEachString({ "CMSSwithSHA1andWinternitzOTS_1" }) String cmss) throws NoSuchAlgorithmException {
Security.addProvider(new FlexiPQCProvider());
//byte[] signatureBytes = null;
KeyPairGenerator kpg = (CMSSKeyPairGenerator) Registry
.getKeyPairGenerator(cmss);
KeyPair keyPair = kpg.genKeyPair();
}
}
實際輸出是並且是活動的。
初始化基準框架... 在Linux上運行的Linux 最大堆= 1345847296系統基準= 11,8ns 執行1個基準測試任務.. [0] CMSSTest.createObjectArray(CMSSwithSHA1andWinternitzOTS_1)!*!** !! !****** !! ******!****!**** !! ****** !!!! *******!***** *!****!*********************************