æéã§ããŒã¿ãã«ãª64ãããããã·ã¥é¢æ°ãããããå£ããå質ã¯ãŸãšãã§ãã
ã¯ããäžè»ãã女æ§ã«ããã®ãããªäœãã èªãã§ïŒ
è±èªçã¯ãã¡ã ã
èªè ãå¿ èŠãªæå°éã®ç¥èãææããããããããè£ããšä»®å®ããŠãæå·åã¢ããªã±ãŒã·ã§ã³ã®ããããã£ãšèŠä»¶ã®è©³çŽ°ãªãªã¹ããšãšãã«ããã·ã¥é¢æ°ã®å®çŸ©ãçç¥ããŸã ã ãŸããç¹ã«æèšãããŠããªãéãã以äžã§ã¯éæå·åïŒæå·åçã«æ°žç¶çã§ãªãïŒããã·ã¥é¢æ°ãæå³ããããšã«åæããŸãã
ããã·ã¥ã¯å€§éã®ã¢ã«ãŽãªãºã ã§äœ¿çšãããã»ãšãã©ã®å Žåãç¹å®ã®æäœã¬ãã«ã®ããã·ã¥å質ãç¶æããªãããæãå¹ççãªïŒé«éã®ïŒããŒã¿åŠçãå¿ èŠã§ãã ããã«ããå質ãã¯ããŸã第äžã«ããœãŒã¹ããŒã¿ã«å¯Ÿããçµæã®ãæ¡ä»¶ä»ãã©ã³ãã æ§ãïŒç¢ºçïŒãæå³ããŸãã ãããŸãã«ãè¿œå ã®èŠä»¶ãäœæãããŸãïŒè¡çªãŸãã¯äžå¯éæ§ã®æå³çãªçæã«å¯Ÿããæµæã
ãã¬ãŒã³ããŒã·ã§ã³ã®èª¿åã®ããã«ãããã·ã¥é¢æ°ã®ãå質ãã®æŠå¿µãšæ®ãã®èŠä»¶ãããå°ã詳ããå®çŸ©ããå¿ èŠããããŸãã
- åºæ¬çãªå質ãšéªåŽ©ã®åœ±é¿ ïŒãœãŒã¹ããŒã¿ã®ä»»æã®ã»ããã®1ã€ä»¥äžã®ä»»æã®ããããå€æŽãããšãçµæã®åããããÂœã®ç¢ºçã§å€æŽãããŸãã
- äžå¯éæ§ïŒæåã®éåã®åŸ©å ã«å¯Ÿããèæ§ïŒïŒããã·ã¥çµæãããœãŒã¹ããŒã¿ãŸãã¯åã ã®ããããååŸã§ããªãã
- ç¹å®ã®çµæã®éžæã«å¯Ÿããèæ§ïŒç¬¬1çš®ã®è¡çªãŸãã¯ç¬¬2ã®éåã®æ€çŽ¢ã«å¯Ÿããèæ§ïŒïŒç¹å®ã®çµæãŸãã¯ãã®äžéšãååŸããããã®åæããŒã¿ã»ããã®æ€çŽ¢/éžæã®è€éãïŒåæããŒã¿ã»ãããæ¢ç¥ã®å Žåãå«ãïŒã
- ã¡ãã»ãŒãžã®éžæã«å¯ŸããæµæïŒç¬¬2çš®ã®è¡çªã«å¯ŸããæµæïŒïŒåãçµæãŸãã¯éèŠãªéšåã®äžèŽãäžãã2ã€ã®ç°ãªãããŒã¿ã»ããã®æ€çŽ¢/éžæã®è€éãã
蚌æ ã®åŒçšããã®ä»ã®èšç®ãçç¥ãããšã次ã®ããã«è¿°ã¹ãããšãã§ããŸãã
- ããã©ãŒãã³ã¹ã確ä¿ããªããããã¹ãŠã®ãã€ã³ããé©åã«å®è¡ããããšã¯ããªãé£ããã¿ã¹ã¯ã§ããããã®ãœãªã¥ãŒã·ã§ã³ã¯åªããæå·åããã·ã¥é¢æ°ãæäŸããŸãã ããããä»ã®ãšãããããè¡ããŸããã
- åºæ¬çãªå質ã確ä¿ããã«ã¯ãååãªæ°ã®ALUæäœãå¿ èŠã§ãã ç°¡åã«èšãã°ãå質ã¯åžžã«é床ãšççŸããŸãã
- ALUæŒç®ã®ããã深床ããã倧ããããã深床ã§å®æ§çãªçµæãåŸãã«ã¯ãããã·ã³ã°ã®æ°ãè€æ°åã«å¢ããå¿ èŠããããããåºæ¬çãªALUæŒç®ãå¿ èŠã§ãã
- äžè¬ã«ã é«éããã·ã¥é¢æ°ã®äœæã«ã¯ãçµæã®é床ãå質ãããã深床ã®éã§ãã©ã³ã¹ã®åãã劥åç¹ãéæããããšãå«ãŸããŸãã
ãããã£ãŠã t1haã¯å質ãšé床ã®åŠ¥åã®çµæãšããŠç»å ŽãããšèšããŸãããææ°ã®ããã»ããµã®æ©èœãšããã§ã«èŠã€ãã£ãŠããäŸåé¢ä¿ã®æ··åãšåæ£ã®æ¹æ³ïŒç®è¡è«çã®çµã¿åããïŒïŒã¢ãã©ã³ã·ã§å¹æïŒãèæ ®ããŠããŸãã
t1haã®åºæ¬ããŒãžã§ã³ã¯ãããã·ã¥ããŒãã«ããã®ä»ã®é¢é£ã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããããã®ïŒæãïŒé«éãªããã·ã¥é¢æ°ã§ãã ãããã£ãŠã t1haã®åºæ¬ããŒãžã§ã³ã¯64ãããã®ãªãã«ãšã³ãã£ã¢ã³ã¢ãŒããã¯ãã£ã«çŠç¹ãåœãŠãŠããã64ãããã®ã·ãŒãå€ãååŸããŠãããŒã®é·ããšã·ãŒãã®å¢å¹ ãå«ã64ãããã®çµæãçæããŸãã t1ha㯠ããŒãå ¥åïŒãŒããµã€ãºããŒãšãŒãã·ãŒãïŒã«å¯ŸããŠ0ãè¿ãããã«æå³çã«èšèšãããŠããããšã«æ³šæããŠãã ãã ã
64ãããæäœ ïŒç§»æ€æ§ãéžæããââã«é床ãšå質ãæäŸããã®ã¯64ãããæäœã§ããããšã説æãã䟡å€ããããŸãã å®éãç®è¡æŒç®ã®åŠçèœåãåºãã»ã©ãéªåŽ©å¹æã倧ãããªããããŒã¿ã®æ··åãåäžããŸãã ãã¡ãããä»ã®ãã¹ãŠãåãã§ããããŒã¿ã®åŠçã¯ã4ããã8ãã€ãé«éã§ããäžæ¹ãå€ãã®ææ°ã®ããã»ããµã§ãã€ãã£ãã«å©çšå¯èœãª64ãããæäœã§ãããå€ããå°ãªãã32ãããã«å€æã§ããŸãã SIMDæäœãå«ãä»ã®ãã¹ãŠã®ãªãã·ã§ã³ã¯ããéãã€ãã£ãããã©ãããã©ãŒã ã§ã®ç§»æ€æ§ãé床ãç ç²ã«ããŸãã
64ãããã®çµæ ïŒå€ãã®å Žåãããã·ã¥ããŒãã«ãäœæããã«ã¯ãå¹ ãå°ããããçµæã§ååã§ãã 32ãããã§ãååãããå ŽåããããŸãã ãã ãã64ãããæäœã䜿çšããå Žåã64ãããã®çµæã¯å®éã«ããèªäœã§ååŸãããŸãã åæã«ãããªãé«å質ã®64ãããããã·ã¥ã®çµæã«ãããäžå¹³çã®æ¯èŒãè¿ éã«å®è¡ããå¹³çã®ããã«æ£ç¢ºã«æ¯èŒããããšãã§ããŸãã
äžèšã®æ¯èŒã®çœ®æã®ãéæ³ãã¯ãç解ã§ãããéèŠããªãå ŽåããããŸãããŸãã¯ãããŒã¿ã®å±ææ§ã®ã¿ã«ãã£ãŠé床ã1æ¡äžããããšãã§ããŸãã CPUãã£ãã·ã¥ã®ãªãŒãã³ã°ãå°ãªãã ç°¡åã«èšãã°ãããã·ã¥ããŒãã«æ§é ãæ§ç¯ããŠãèšç®ãããããã·ã¥å€ã䞊ã¹ãŠïŒãã£ãã·ã¥ã©ã€ã³ã«è©°ããŠïŒé 眮ããããšãã§ããŸãã ããã»ããµã¯ãããã·ã¥å€ãäžèŽããå Žåã«ã®ã¿ãå®éã®ããŒã¿ãååŸããå¿ èŠããããŸããã ãã®å Žåã t1haããã®64ãããã«ããã究極ã®çµæãåŸãããšãã§ããŸãã ããã«ã128ãããã§ã¯ã²ã€ã³ãåŸãããªããªãã64ãããããã®ååŸã¯åžžã«å¯èœã«ãªããŸãã
HighwayHashãšã®æ¯èŒ ïŒç§ã¯ãã®Google瀟å¡ã®éå ¬åŒãããžã§ã¯ãã«å¯ŸããŠäºéã®æ 床ãæã£ãŠããŸãã
- æåïŒäžæ¹ã§ãè¯ãã³ãŒããšåªããæè¡çå®è£ ã äžæ¹ã HighwayHash㯠ãæå·åŒ·åºŠã匷ããšèŠãªãããŸãïŒå°ãªããšãSipHashã«çããïŒã HighwayHashã®äžã«ã¯ãçµæãæªããªãããšã瀺åããå€ãã®æäœããããŸãã ãã ããããã«äŸåãã蚌æ ã¯ãããŸããã äžèšã®ãæ°žç¶æ§ãã®èšŒæã¯ãçµ±èšçãã¹ãã®çµæã«åž°çããŸãããããããåçŸããèœåã¯ãããŸããïŒã©ããããããç§ã¯èªåèªèº«ãäžå¿ èŠã«ããããšããã§ããŸãã ïŒã
- 第äºã«ïŒHighwayHashã¯ãAVX2ãŸãã¯SSE41ãæèŒããx86_64ã§ã®ã¿é«éã§ãã AES-NIãŸãã¯SHAã¢ã¯ã»ã©ã¬ãŒã·ã§ã³ã䜿çšããæ¹ãç°¡åã§ã¯ãããŸãããïŒ
ãã¹ãŠãããŸãããã°ãt1haã»ããã«ã¯ïŒäž»ã«çµæã®å¹ ã«é¢ããŠïŒè¿œå ãªãã·ã§ã³ããããE2Kçšã«æé©åãããŸãã ãã®ãããã¯ã«ã€ããŠã¯ã HighwayHashãšã®æ¯èŒãéããããšæããŸãã
å質
ãã¹ãŠã®é¢ã§ããã·ã¥é¢æ°ã®å質ãæšå®ããããšã¯éåžžã«å°é£ã§ãã åæçãªæ¹æ³ã§è¡ã£ãããããŸããŸãªçµ±èšãã¹ããå®æœãããã§ããŸãã æ®å¿µãªãããåæçã¢ãããŒãã¯ãå質ãšé床ã®ãã¬ãŒããªãã§ããã·ã¥é¢æ°ãè©äŸ¡ããã«ã¯å¹æçã§ã¯ãããŸããã ããã«ããã®ãããªæ©èœã®æ¯èŒåæè©äŸ¡ã¯äž»èŠ³çãªåŸåããããŸãã
ããã©ããããçµ±èšçæ€å®ã®å Žåãéæãªå®éçæšå®å€ãååŸããã®ã¯ç°¡åã§ãã åæã«ã SMHasherãªã©ã®å®è©ã®ãããã¹ãããã±ãŒãžããããŸãã t1haã®å Žåãçµæã¯åçŽã§ããt1haã®ãã¹ãŠã®ããªã¢ã³ãã¯ãã³ã¡ã³ããªãã§ãã¹ãŠã®ãã¹ãã«åæ ŒããŸãã äžæ¹ãt1haã«ã¯ãã¿ãŒã²ããã¢ããªã±ãŒã·ã§ã³ïŒããã·ã¥ããŒãã«ã®æ§ç¯ïŒã«å¿ èŠãªããããã£ä»¥å€ã®ããããã£ããããšæ³å®ããªãã§ãã ããã
ãã¹ãŠã®t1haããªã¢ã³ãã¬ãã«ã§ã®è¡çªã®æ°ã¯ãèªçæ¥ã®ãã©ããã¯ã¹ã«å¯Ÿå¿ããŸãã ããå³å¯ãªå®åŒåã§ã¯ãè¡çªã®ç¢ºçt1haã¯ã察å¿ããããã深床ã®ã©ã³ãã ãªé¢æ£å€ã®äžèŽã®ç¢ºçã«å¯Ÿå¿ããŸãã
ã»ãŒãã¹ãŠã®é«å質ããã·ã¥é¢æ°ã®è¡çªã®åæ§ã®ç¢ºçã ããããããã¯æ£ç¢ºã«ç¢ºçã§ãããããç¹å®ã®ããŒã¿ã»ããã§ã¯ãè¡çªã®ãªãã©ã«æ°ã¯ç°ãªãå ŽåããããŸãã
ãã®èšäºã®æåã®çºè¡åŸã Yves Ortonã¯t1ha1()
æåã®ã¬ãã«ã®ããŒãžã§ã³ãå³å¯ãªéªåŽ©ã®åºæºãåžžã«æºãããŠããªãããšãçºèŠããŸããã ãã®æ¬ ç¹ã¯ã t1ha1()
ã¿ãŒã²ããã¢ããªã±ãŒã·ã§ã³ã§ã¯ç¡èŠã§ããå®çšçãªèŠ³ç¹ããã¯èŠããŸããã ããã«ããããããããã®æ¬ ç¹ã¯æ¬¡ã®ã¬ãã«ã®ããªã¢ã³ãt1ha2()
ã§é€å»ãããŸããã çŸåšã®ããŒãžã§ã³ã®ã³ã³ãã€ã©ã䜿çšããæ°ããããã»ããµã§ã¯ã t1ha2()
ãããå¹³åã§1ã¯ããã¯éããªããŸããããã®ä»ã®å Žåã¯1ã¯ããã¯é
ããªããŸãã t1ha2()
ããã«ããã·ã¥ã¹ããªãŒã ã¢ãŒããš128ãããã®çµæãæäŸããããšã¯æ³šç®ã«å€ããŸãã
èªè
ã¯ã t1haã®å質ããã³/ãŸãã¯èä¹
æ§ã®åŸ¹åºçãã€è©³çŽ°ãªåæã確ãã«è©äŸ¡ããã§ãããã ãã ãã t1haã®é©çšå¯Ÿè±¡é åã«åºã¥ããŠãããã¯äžèŠãšæãããŸãã ç°¡åã«èšãã°ãçãããŒã®å Žåãå«ããé床ãç§ãã¡ã«ãšã£ãŠããéèŠã§ããã ãããã£ãŠããã«ãã©ãŠã³ãããã·ã³ã°ã¯èæ
®ãããŸããã§ããã å°å
¥ãããt1haã®ç¯çŽ äžèŽãã 64ãããã®çµæã枬å®ããŠçæããŸã-çµ±èšç以å€ã®æ¹æ³ã§èŠã€ãã£ã劥åç¹ã枬å®ããããšã¯ã»ãšãã©ç¡æå³ã§ããããããã®çµæã¯åçŽã«è¯å¥œã§ãã
ãã³ãããŒã¯
ã æé ããšãããã¬ãŒãºã®ã¿ã€ãã«ã«ååšããããšã説æãã䟡å€ããããŸãã å®éããã¹ãŠã®ãã©ãããã©ãŒã /ã¢ãŒããã¯ãã£ã§æçšã§ãããšåæã«æéã®ããã·ã¥é¢æ°ãååšããããšã¯ã»ãšãã©ãããŸããã ç°ãªãåœä»€ã»ããã¯ç°ãªãããã»ããµã§å©çšã§ããåæ§ã®åœä»€ã¯ç°ãªãå¹çã§å®è¡ãããŸãã æããã«ãã æ®éçãªæéã® ãé¢æ°ã¯ãã»ãšãã©ã®å Žåãäœæã§ããŸããã ããããå°ãªããšãæãäžè¬çãªãã©ãããã©ãŒã ïŒx86_64ïŒã§ãããŒã¿ãã«ã§ãããšåæã«æéã®é¢æ°ã«ãæéãã䜿çšããããšã¯èš±å®¹ã§ããããã«æãããŸãã
ãããžã§ã¯ãã®ãœãŒã¹ã³ãŒãã«ã¯ãçµæã®æ£ç¢ºæ§ããã§ãã¯ããå®è£ ãããåãªãã·ã§ã³ã®é床ã枬å®ãããã¹ããå«ãŸããŠããŸãã åæã«ãx86ã§ã¯ãããã»ããµãŒïŒããã³ã³ã³ãã€ã©ãŒïŒã®æ©èœã«å¿ããŠãé¢æ°ã®è¿œå ãªãã·ã§ã³ã確èªã§ããããã»ããµãŒãµã€ã¯ã«ã§æž¬å®ãè¡ãããŸãã
ããã«ããããžã§ã¯ãã®Webãµã€ãã«ã¯ã Reini Urbanã®SMHasherã®ä¿®æ£ããŒãžã§ã³ãä»ããããã©ãŒãã³ã¹æž¬å®ã®çµæã瀺ãè¡šãå«ãŸããŠããŸãã ãããã£ãŠãç¹å®ã®ã³ã³ãã€ã©ã䜿çšããŠç¹å®ã®ããã»ããµã§ãã¹ãŠã®æ°å€ãããã«ãã§ãã¯ããããçµæãååŸãããã§ããŸãã
ããã§ã¯ãæãè¿ã競åä»ç€Ÿt1haã®ããã€ããšæ¯èŒã§ããŸãã
çãããŒã®ããã·ã¥ ïŒå¹³å1..31ãã€ãïŒã
å³ã®åãCycles / HashããèŠãŠãã ããïŒå€ãå°ããã»ã©è¯ãïŒ ïŒ
æ©èœ | MiB /ç§ | ãµã€ã¯ã«/ããã·ã¥ |
---|---|---|
t1ha | 12228.80 | 35.55 |
Fasthash64 | 5578.06 | 43.42 |
CityHash64 | 11041.72 | 51.77 |
xxHash64 | 11123.15 | 56.17 |
ã¡ããããã·ã¥ | 11808.92 | 46.33 |
é·ãããŒã®ããã·ã¥ ïŒ256 KbïŒã
äžå€®ã®åãMiB / SecondããèŠãŠãã ããïŒå€ã倧ããã»ã©è¯ãïŒ ïŒ
æ©èœ | MiB /ç§ | ãµã€ã¯ã«/ããã·ã¥ |
---|---|---|
t1ha | 12228.80 | 35.55 |
Farmhash64 | 12145.36 | 60.12 |
CityHash64 | 11041.72 | 51.77 |
xxHash64 | 11123.15 | 56.17 |
Spooky64 | 11820.20 | 60.39 |
t1haã®ãªãã·ã§ã³
t1haã®éçºã¯çŽç²ã«å®çšçã§ããã æåã®ãã®ãããªç®æšã¯ãããã·ã¥ããŒãã«ãæ§ç¯ããããã®é«éã§ç§»æ€æ§ãé«ããååã«é«å質ãªé¢æ°ãååŸããããšã§ããã
次ã«ãããã·ã¥é¢æ°ã®æéããŒãžã§ã³ãå¿ èŠã§ãããããã«ãããå質ã¯åçã§ãããã¿ãŒã²ãããã©ãããã©ãŒã ã«æ倧éã«é©åããŸããã ããšãã°ã t1haã®åºæ¬ããŒãžã§ã³ã¯ãªãã«ãšã³ãã£ã¢ã³ã®ãã€ãé ã§åäœããŸããããããããã°ãšã³ãã£ã¢ã³ã®ã¢ãŒããã¯ãã£ãããã©ãŒãã³ã¹ã®äžå¯é¿ãªæ倱ã䌎ãå€æãå¿ èŠãšããçç±ã§ãã ããã§ã¯ãç¹å®ã®ã¿ãŒã²ãããã©ãããã©ãŒã ã§äžèŠãªæäœãæé€ããŠã¿ãŸãããïŒ åæ§ã«ãããã«ããã€ãã®ãªãã·ã§ã³ãè¿œå ãããŸããã
- ãªãã«ãšã³ãã£ã¢ã³ãšããã°ãšã³ãã£ã¢ã³ã®äž¡æ¹ã®32ããããã©ãããã©ãŒã çšã®ç°¡æããŒãžã§ã³ã
- AES-NIåœä»€ã䜿çšããããAVXã䜿çšããªããªãã·ã§ã³ã
- AES-NIããã³AVXåœä»€ã䜿çšãã2ã€ã®ãªãã·ã§ã³ã
å°ãåŸã«ãããŸããŸãªããã深床ã®çµæãå質ãšèä¹ æ§ã®èŠä»¶ãªã©ãããŸããŸãªã¢ããªã±ãŒã·ã§ã³åãã«èšèšããããªãã·ã§ã³ãããã«å¿ èŠã§ããããšãæããã«ãªããŸããã ãã®ãããªå€æ§æ§ã¯ç§©åºã®ç¢ºç«ãå¿ èŠãšããŸããã åœåã¹ããŒã ã®å€æŽãããããããã®ãããžã¿ã«ãµãã£ãã¯ã¹ã¯é¢æ°ã®ãã¬ãã«ãã瀺ããŸãã
-
t1ha0()
ã¯ãçŸåšã®ããã»ããµã®æéãªãã·ã§ã³ã§ãã -
t1ha1()
ã¯ãt1ha1()
ã®åºæ¬çãªããŒã¿ãã«64ãããããŒãžã§ã³ã§ãã -
t1ha2()
ã¯ãå質ã«ããå°ãé¢å¿ãããããŒã¿ãã«64ãããããŒãžã§ã³ã§ãã -
t1ha3()
ã¯ãããªã³ããåä¿¡ããããã®é«éããŒã¿ãã«128ããããªãã·ã§ã³ã§ãã - ãªã©
ãã®ã¹ããŒã ã§ã¯ã t1ha0()
ã¯ãçŸåšã®ããã»ããµã®ãã©ãããã©ãŒã ãšæ©èœã«å¿ããŠãªãã€ã¬ã¯ããå®è£
ãããã£ã¹ãããã£ã§ãããšæ³å®ãããŠããŸãã ãŸãããµãã£ãã¯ã¹ã_leããšã_beãã䜿çšããŠããªãã«ãšã³ãã£ã¢ã³ãšããã°ãšã³ãã£ã¢ã³ã®ãªãã·ã§ã³ãæ瀺çã«éžæããããšãã§ããŸãã ãããã£ãŠãçŸåšãt1haãçæ¿ãã®äžã«ããã€ãã®ããã·ã¥é¢æ°ãããããã®ãã¡ããªã¯ãåœå
ã®Elbrus E2KãèŠãããšãå«ããŠè£å
ãããŸãã
çŸåšã®äžé£ã®é¢æ°ãšãã®ããããã£ã®ã¢ã€ãã¢ã¯ãçµã¿èŸŒã¿ãã¹ãïŒ make check
ïŒã®åºåããååŸã§ããŸãã ãã¹ãŠã®æ©èœããã¹ãŠã®SMHasherãã¹ãã«åæ ŒããAES-NIãªãã·ã§ã³ã®ããã©ãŒãã³ã¹ã¯ããã»ããµã¢ãã«ã«ãã£ãŠå€§ããç°ãªãããšã«æ³šæããŠãã ããã
Intel(R) Core(TM) i7-6700K CPU @ 3.00GHz Build by GNU C/C++ compiler 8.2 [...] - use RDPMC_40000001 as clock source - measure granularity and overhead: 53 cycles, 0.0188679 iteration/cycle Bench for tiny keys (7 bytes): t1ha0 : 13.14 cycle/hash, 1.877 cycle/byte, 1.598 Gb/s @3GHz t1ha1_64le : 15.14 cycle/hash, 2.163 cycle/byte, 1.387 Gb/s @3GHz t1ha2_atonce : 15.50 cycle/hash, 2.163 cycle/byte, 1.387 Gb/s @3GHz t1ha1_64be : 16.78 cycle/hash, 2.397 cycle/byte, 1.251 Gb/s @3GHz xxhash32 : 17.17 cycle/hash, 2.453 cycle/byte, 1.223 Gb/s @3GHz StadtX : 17.59 cycle/hash, 2.513 cycle/byte, 1.194 Gb/s @3GHz t1ha0_32le : 18.28 cycle/hash, 2.612 cycle/byte, 1.149 Gb/s @3GHz t1ha0_32be : 20.24 cycle/hash, 2.892 cycle/byte, 1.037 Gb/s @3GHz xxhash64 : 22.17 cycle/hash, 3.167 cycle/byte, 0.947 Gb/s @3GHz t1ha2_atonce128* : 29.93 cycle/hash, 4.277 cycle/byte, 0.701 Gb/s @3GHz t1ha2_stream* : 79.81 cycle/hash, 11.402 cycle/byte, 0.263 Gb/s @3GHz HighwayHash64_avx2 : 83.75 cycle/hash, 11.964 cycle/byte, 0.251 Gb/s @3GHz HighwayHash64_sse41 : 85.25 cycle/hash, 12.179 cycle/byte, 0.246 Gb/s @3GHz t1ha2_stream128* : 99.06 cycle/hash, 14.152 cycle/byte, 0.212 Gb/s @3GHz HighwayHash64_portable: 480.75 cycle/hash, 68.679 cycle/byte, 0.044 Gb/s @3GHz HighwayHash64_pure_c : 652.58 cycle/hash, 93.226 cycle/byte, 0.032 Gb/s @3GHz Bench for large keys (16384 bytes): t1ha0 : 1185.00 cycle/hash, 0.072 cycle/byte, 41.478 Gb/s @3GHz t1ha2_atonce : 3436.00 cycle/hash, 0.210 cycle/byte, 14.305 Gb/s @3GHz t1ha2_atonce128* : 3440.00 cycle/hash, 0.210 cycle/byte, 14.288 Gb/s @3GHz t1ha1_64le : 3449.00 cycle/hash, 0.211 cycle/byte, 14.251 Gb/s @3GHz t1ha2_stream* : 3479.00 cycle/hash, 0.212 cycle/byte, 14.128 Gb/s @3GHz t1ha2_stream128* : 3508.00 cycle/hash, 0.214 cycle/byte, 14.011 Gb/s @3GHz StadtX : 3550.00 cycle/hash, 0.217 cycle/byte, 13.846 Gb/s @3GHz xxhash64 : 4121.00 cycle/hash, 0.252 cycle/byte, 11.927 Gb/s @3GHz t1ha1_64be : 4567.00 cycle/hash, 0.279 cycle/byte, 10.762 Gb/s @3GHz HighwayHash64_avx2 : 4580.00 cycle/hash, 0.280 cycle/byte, 10.732 Gb/s @3GHz HighwayHash64_sse41 : 6412.00 cycle/hash, 0.391 cycle/byte, 7.666 Gb/s @3GHz t1ha0_32le : 7191.00 cycle/hash, 0.439 cycle/byte, 6.835 Gb/s @3GHz t1ha0_32be : 7928.00 cycle/hash, 0.484 cycle/byte, 6.200 Gb/s @3GHz xxhash32 : 8197.00 cycle/hash, 0.500 cycle/byte, 5.996 Gb/s @3GHz HighwayHash64_portable: 41895.27 cycle/hash, 2.557 cycle/byte, 1.173 Gb/s @3GHz HighwayHash64_pure_c : 53296.11 cycle/hash, 3.253 cycle/byte, 0.922 Gb/s @3GHz
å°ã詳ããèšãã°ã t1haã¯ããŒã¿ã®ãµã€ãºãšãœã«ãã£ã³ã°å€ãã匷åãããMerkle-Damgardã¹ããŒã ïŒãã¯ã€ããã€ããããŒãžã§ã³ïŒã«åŸã£ãŠæ§ç¯ãããŠããŸãã ã¡ã€ã³ã®å§çž®ã«ãŒãå ã§ã¯ã256ãããã®ç¶æ ã䜿çšãããå ¥åãããã¯ãµã€ãºã¯åãã§ãã ããã«ãåããŒã¿ãªãã©ã³ãã«å¯ŸããŠã2ã€ã®çžäºåç²æ³šå ¥ãã€ã³ããå®è£ ãããŠããŸãã å§çž®ãµã€ã¯ã«ãå®äºãããšã256ãããç¶æ ã128ãããã«å§çž®ãããŸãã
説æãããŠããã¢ã¯ã·ã§ã³ãå®è¡ããå Žåã64ãããæäœã䜿çšããããããµãŒARXïŒAdd-Rotate-XorïŒããã³MUX / MRXïŒMul-Rotate-XorïŒã§çµåãããŸãã ãããã®èšç®ã¯ãã¹ãŠããã€ãã©ã€ã³ãšx86_64å®è¡ããã€ã¹ã®äž¡æ¹ã§ãã»ãšãã©ã®æäœã®äžŠåå®è¡ãšu-opã®ã¿ã€ããããã³ã°ã®å¯èœæ§ãæäŸããããã«é 眮ãããããšãéèŠã§ãã ãã®ãããé·ãããŒã®ã»ãŒæ倧ã®ããã·ã¥é床ã§ããªãè¯ãå質ãéæãããŸãã
å§çž®ãµã€ã¯ã«ã¯ãååãªãµã€ãºã®ãããã¯ã«å¯ŸããŠã®ã¿éå§ãããããšã«æ³šæããŠãã ããã ããŒã¿ãå°ãªãå Žåãäžéã®128ãããç¶æ ã¯ããŒãµã€ãºãšãœã«ãã£ã³ã°å€ã®ã¿ã§æ§æãããŸãã
ããã«ãæ®ãã®ããŒã¿ããŒã«ã¯ã64ãããã®éšåã§128ãããç¶æ ã®ååã«äº€äºã«ããã¯ã¹ãããŸãã çµè«ãšããŠãç¶æ ã¯64ãããçµæãžã®å§çž®ãšäžç·ã«æ··åãããŸãã ããã§ã®t1haã®éèŠãªæ©èœã¯ãåºãä¹ç®ïŒ2ã€ã®64ããããã¡ã¯ã¿ãŒã®128ãããç©ïŒã«åºã¥ããããµãŒã®äœ¿çšã§ãã ããã«ãããããå°ãªãæäœã§ããªã ãå¹æã®ããé«å質ã®ããã·ã³ã°ãå®è£ ã§ããŸãã å¹ ã®åºãä¹ç®ã¯æ¯èŒçé«äŸ¡ãªæŒç®ã§ãããšããäºå®ã«ããããããããã®ãããªæŒç®ã®æ°ãå°ãªããšãt1haã¯èšé²çãªå°ãªãããã»ããµãµã€ã¯ã«ã§çãããŒãåŠçã§ããŸãã
åºãä¹ç®ãšæä»çORã«åºã¥ããŠäœ¿çšããããããµãŒã¯çæ³çã§ã¯ãªãããšã«æ³šæããŠãã ããã t1haã¯ãã¹ãŠã®SMHasherãã¹ãã«åæ Œãããšããäºå®ã«ãããããããèè ã¯éåå°æ§ã®çµæã«ã€ããŠã®èããæã£ãŠããŸãã ããã«ãããããããçµæãšããŠåŸãããå質ã¯åççã«ååã§ãããšæãããt1ha系統ã®éçºèšç»ã¯ãããå°ãè¯ããªãã·ã§ã³ãæäŸããæå³ããã§ã«åæ ããŠããŸãã
æ®ãã¯ããã«ãããŸã ã
ãæž
èŽããããšãããããŸããã ãã¹ãŠã«è¯ãã
è±èªçã¯ãã¡ã ã