ç§ã®å人ã®Aras
ã¯æè¿ ãC ++ãCïŒãUnity Burstã³ã³ãã€ã©ãªã©ãããŸããŸãªèšèªã§åãã¬ã€ãã¬ãŒãµãŒãäœæããŸããã ãã¡ãããCïŒãC ++ãããé
ããšäºæ³ããã®ã¯èªç¶ã§ãããMonoã.NET Coreãããéåžžã«é
ãããšã¯èå³æ·±ãããã«æããŸããã
圌ã®å
¬éããã
ææšã¯è²§åŒ±ã§ããïŒ
- CïŒïŒ.NET CoreïŒïŒMac 17.5 Mray / sã
- CïŒïŒUnityãMonoïŒïŒMac 4.6 Mray / sã
- CïŒïŒUnityãIL2CPPïŒïŒMac 17.1 Mray / s
äœãèµ·ãã£ãŠããã®ãã確èªããæ¹åã§ããå Žæãææžåããããšã«ããŸããã
ãã®ãã³ãããŒã¯ãšãã®åé¡ã®èª¿æ»ã®çµæãæ¹åãå¯èœãª3ã€ã®é åãèŠã€ãããŸããã
- æåã«ãããã©ã«ãã®Monoèšå®ãæ¹åããå¿
èŠããããŸãããŠãŒã¶ãŒã¯éåžžãèšå®ãæ§æããªãããã§ãã
- 第äºã«ãMonoã®LLVMã³ãŒãæé©åããã¯ãšã³ãã«äžçãç©æ¥µçã«å°å
¥ããå¿
èŠããããŸã
- 第äžã«ãããã€ãã®Monoãã©ã¡ãŒã¿ãŒã®ãã¥ãŒãã³ã°ãæ¹åããŸããã
ãã®ãã¹ãã®åºæºç¹ã¯ããã·ã³ã§å®è¡ããã
ã¬ã€ãã¬ãŒãµãŒã®çµæã§ãããããŒããŠã§ã¢ãç°ãªããããæ°å€ãæ¯èŒããããšã¯ã§ããŸããã
ç§ã®èªå®
ã®iMac for .NET Coreã§ã®çµæã¯æ¬¡ã®ãšããã§ãã
äœæ¥ç°å¢ | çµæãMRay /ç§ |
---|
.NET Core 2.1.4ã dotnet run debug build | 3.6 |
.NET Core 2.1.4ãªãªãŒã¹ãã«ãdotnet run -c Release | 21.7 |
mono Maths.exe ã mono Maths.exe | 6.6 |
LLVMããã³float32ãåããããã©ã¢ã | 15.5 |
ãã®åé¡ãç 究ããéçšã§ãããã€ãã®åé¡ãçºèŠããŸãããä¿®æ£åŸã次ã®çµæãåŸãããŸããã
äœæ¥ç°å¢ | çµæãMRay /ç§ |
---|
LLVMããã³float32ãåããã¢ã | 15.5 |
LLVMãfloat32ãåºå®ã€ã³ã©ã€ã³ãåããé«åºŠãªMono | 29.6 |
å
šäœåïŒ
åã«LLVMãšfloat32ãé©çšããã ãã§ãæµ®åå°æ°ç¹ã³ãŒãã®ããã©ãŒãã³ã¹ãã»ãŒ2.3ååäžãããããšãã§ããŸãã ãããŠããããã®å®éšã®çµæãšããŠMonoã«è¿œå ãããã¥ãŒãã³ã°åŸãæšæºã®Monoã«æ¯ã¹ãŠçç£æ§ã4.4ååäžãããããšãã§ããŸããMonoã®å°æ¥ã®ããŒãžã§ã³ã®ãããã®ãã©ã¡ãŒã¿ãŒã¯ããã©ã«ãã®ãã©ã¡ãŒã¿ãŒã«ãªããŸãã
ãã®èšäºã§ã¯ã調æ»çµæã«ã€ããŠèª¬æããŸãã
32ãããããã³64ãããã®ãããŒã
Arasã¯ãèšç®ã®äž»èŠéšåã«32ãããã®æµ®åå°æ°ç¹æ°ã䜿çšããŸãïŒCïŒã§ã¯
float
åã.NETã§ã¯
System.Single
åïŒã Monoã§ã¯ããã£ãšåã«ãã¹ãç¯ããŸããããã¹ãŠã®32ãããæµ®åå°æ°ç¹èšç®ã¯64ããããšããŠå®è¡ãããããŒã¿ã¯ãŸã 32ãããé åã«ä¿åãããŠããŸããã
ä»æ¥ãç§ã®èšæ¶ã¯ä»¥åã»ã©é®®æã§ã¯ãªãããªããã®ãããªæ±ºå®ãããã®ããæ£ç¢ºã«æãåºãããšãã§ããŸããã
ç§ã¯ãããåœæã®ãã¬ã³ããã¢ã€ãã¢ã«åœ±é¿ããããšããèããããŸããã
ãã®åŸããããŒãã³ã³ãã¥ãŒãã£ã³ã°ã®ç²ŸåºŠãåäžããŸããã ããšãã°ãIntel x87ããã»ããµã¯ããªãã©ã³ãã2åã®å Žåã§ããæµ®åå°æ°ç¹ã®èšç®ã«80ããã粟床ã䜿çšããããããŠãŒã¶ãŒã¯ããæ£ç¢ºãªçµæãåŸãããšãã§ããŸããã
åœæã以åã®ãããžã§ã¯ãã®1ã€ã§ããGnumericã¹ãã¬ããã·ãŒãã§ã¯ãçµ±èšé¢æ°ãExcelãããå¹ççã«å®è£
ãããŠãããšããèããé¢é£ããŠããŸããã ãããã£ãŠãå€ãã®ã³ãã¥ããã£ã¯ã粟床ãé«ããããæ£ç¢ºãªçµæã䜿çšã§ãããšããèããååã«åãå
¥ããŠããŸãã
Monoéçºã®åæ段éã§ã¯ããã¹ãŠã®ãã©ãããã©ãŒã ã§å®è¡ãããæ°åŠæŒç®ã®ã»ãšãã©ã¯ãå
¥åã§2åããåãåãããšãã§ããŸããã§ããã 32ãããããŒãžã§ã³ãC99ãPosixãããã³ISOã«è¿œå ãããŸããããåœæã¯æ¥çå
šäœã§åºãå©çšã§ããŸããã§ããïŒããšãã°ã
sinf
ã¯
sin
ã®floatããŒãžã§ã³ã
fabsf
ã¯
fabsf
ã®ããŒãžã§ã³ãªã©ïŒã
ã€ãŸãã2000幎代åæã¯æ¥œèŠ³çãªæ代ã§ããã
ã¢ããªã±ãŒã·ã§ã³ã¯èšç®æéã®å¢å ã«å€§ããªä»£åãæã£ãŠããŸããããMonoã¯äž»ã«HTTPããŒãžãšäžéšã®ãµãŒããŒããã»ã¹ãæäŸãããã¹ã¯ãããLinuxã¢ããªã±ãŒã·ã§ã³ã«äœ¿çšãããŠãããããæµ®åå°æ°ç¹é床ã¯æ¥åžžçã«çºçããåé¡ã§ã¯ãããŸããã§ããã äžéšã®ç§åŠçãã³ãããŒã¯ã§ã®ã¿é¡èã«ãªãã2003幎ã«ã¯.NETã§éçºãããããšã¯ã»ãšãã©ãããŸããã§ããã
ä»æ¥ãã²ãŒã ã3Dã¢ããªã±ãŒã·ã§ã³ãç»ååŠçãVRãARãæ©æ¢°åŠç¿ã«ãããæµ®åå°æ°ç¹æŒç®ãããäžè¬çãªã¿ã€ãã®ããŒã¿ã«ãªããŸããã ãã©ãã«ã¯åç¬ã§ã¯çºçãããäŸå€ããããŸããã Floatã¯ãã»ãã®2ã3ã®å Žæã§ã³ãŒãã§äœ¿çšãããŠãããã¬ã³ããªãŒãªããŒã¿åã§ã¯ãªããªããŸããã 圌ãã¯éªåŽ©ã«å€ãããããããé ãå Žæã¯ãããŸããã ãããã®å€ããããããããã®é
åžãæ¢ããããšã¯ã§ããŸããã
ã¯ãŒã¯ã¹ããŒã¹ãã©ã°float32
ãããã£ãŠãæ°å¹Žåã«ãä»ã®ãã¹ãŠã®å Žåãšåæ§ã«ã32ãããæäœã䜿çšããŠ32ããããããŒãæäœãå®è¡ããããã®ãµããŒããè¿œå ããããšã«ããŸããã ã¯ãŒã¯ã¹ããŒã¹ã®ãã®æ©èœããfloat32ããšåŒã³ãŸããã Monoã§ã¯ãäœæ¥ç°å¢ã§ãªãã·ã§ã³
--O=float32
è¿œå ããããšã§æå¹ã«ãªããXamarinã¢ããªã±ãŒã·ã§ã³ã§ã¯ããã®ãã©ã¡ãŒã¿ãŒã¯ãããžã§ã¯ãèšå®ã§å€æŽãããŸãã
åºæ¬çã«ã¢ãã€ã«ããã€ã¹ã¯ãŸã 匷åã§ã¯ãªãããããã®æ°ãããã©ã°ã¯ã¢ãã€ã«ãŠãŒã¶ãŒã«å¥œè©ã§ããã粟床ãäžãããããéãããŒã¿ãåŠçããæ¹ãæãŸããããã§ãã ã¢ãã€ã«ãŠãŒã¶ãŒã¯ãLLVMæé©åã³ã³ãã€ã©ãšfloat32ãã©ã°ãåæã«ãªã³ã«ããããšããå§ãããŸãã
ãã®ãã©ã°ã¯æ°å¹Žéå®è£
ãããŠããŸããããŠãŒã¶ãŒã®äžå¿«ãªé©ããé¿ããããã«ããã®ãã©ã°ãããã©ã«ãã«ããŸããã§ããã ããããæšæºã®64ãããã®åäœãåå ã§é©ããçããã±ãŒã¹ã«ééãå§ã
ãŸãããUnityãŠãŒã¶ãŒãæåºãããã®
ãã°ã¬ããŒããåç
§ããŠãã ããã
ããã§
float32
ã§Mono
float32
ã䜿çš
float32
ãé²è¡ç¶æ³ã¯
https://github.com/mono/mono/mono/issues/6985ã§è¿œè·¡ã§ã
ãŸã ã
ãããŸã§ã®éãå人ã®Arasã®ãããžã§ã¯ãã«æ»ããŸããã 圌ã¯.NET Coreã«è¿œå ãããæ°ããAPIã䜿çšããŸããã .NET Coreã¯åžžã«32ãããã®æµ®åå°æ°ç¹æŒç®ã32ãããã®æµ®åå°æ°ç¹æŒç®ãšããŠå®è¡ããŠããŸãããã
System.Math
APIã¯ããã»ã¹å
ã§
float
ãã
double
ãžã®å€æãåŒãç¶ãå®è¡ããŸãã ããšãã°ãfloatå€ã®æ£åŒŠé¢æ°ãèšç®ããå¿
èŠãããå Žåãå¯äžã®ãªãã·ã§ã³ã¯
Math.Sin (double)
ãåŒã³åºãããšã§ãããfloatããdoubleã«å€æããå¿
èŠããããŸãã
ãããä¿®æ£ããããã«ãå粟床浮åå°æ°ç¹æŒç®ãå«ãæ°ããã¿ã€ãã®
System.MathF
ã.NET Coreã«è¿œå ãããŸãããããã®
[System.MathF]
ãMonoã«ç§»æ€ããã ãã§ãã
64ããããã32ããããããŒããžã®ç§»è¡ã«ãããããã©ãŒãã³ã¹ã倧å¹
ã«åäžããŸããããã¯æ¬¡ã®è¡šããããããŸãã
äœæ¥ç°å¢ãšãªãã·ã§ã³ | Mrays /ç§ |
---|
System.Mathãåããã¢ã | 6.6 |
System.Mathãš-O=float32 | 8.1 |
System.MathFãåããã¢ã | 6.5 |
System.MathFããã³-O=float32 | 8.2 |
ã€ãŸãããã®ãã¹ãã§
float32
ã䜿çšãããšããã©ãŒãã³ã¹ãæ¬åœã«åäžããMathFã®å¹æã¯ã»ãšãã©ãããŸããã
LLVMã»ããã¢ãã
ãã®èª¿æ»ã®éçšã§ãFast JIT Monoã³ã³ãã€ã©ãŒã¯
float32
ãµããŒãããŠããŸããããã®ãµããŒããLLVMããã¯ãšã³ãã«è¿œå ããŠããªãããšã
float32
ã ã€ãŸããLLVMãåããMonoã¯ãfloatããdoubleãžã®ã³ã¹ãã®ãããå€æããŸã å®è¡ããŠããŸããã
ãã®ãããZoltanã¯LLVMã³ãŒãçæãšã³ãžã³ã«
float32
ãµããŒããè¿œå ããŸããã
ãããã圌ã¯ãç§ãã¡ã®ã€ã³ã©ã€ããŒãLLVMã«äœ¿çšããããã®ãšåããã¥ãŒãªã¹ãã£ãã¯ãFast JITã«äœ¿çšããããšã«æ°ä»ããŸããã Fast JITã䜿çšããå ŽåãJITé床ãšå®è¡é床ã®ãã©ã³ã¹ãåãå¿
èŠããããããåã蟌ã¿ã³ãŒãã®éãå¶éããŠJITãšã³ãžã³ã®äœæ¥éãåæžããŸããã
ããããMonoã§LLVMã䜿çšããããšã«æ±ºããå Žåã¯ãã³ãŒããå¯èœãªéãé«éã«ããããšãããããããã«å¿ããŠèšå®ãå€æŽããŸããã çŸåšããã®ãã©ã¡ãŒã¿ãŒã¯
MONO_INLINELIMIT
ç°å¢
MONO_INLINELIMIT
ã䜿çšããŠå€æŽã§ããŸãããå®éã«ã¯ããã©ã«ãå€ã«æžã蟌ãå¿
èŠããããŸãã
å€æŽãããLLVMèšå®ã§ã®çµæã¯æ¬¡ã®ãšããã§ãã
äœæ¥ç°å¢ãšãªãã·ã§ã³ | Mrays /ç§ |
---|
System.Mathã§ã¢ãã©ã«--llvm -O=float32 | 16.0 |
System.Mathã®ã¢ãã©ã«--llvm -O=float32 ãå®æ°ãã¥ãŒãªã¹ãã£ã㯠| 29.1 |
System.MathFã--llvm -O=float32 Mono --llvm -O=float32 ãå®æ°ãã¥ãŒãªã¹ãã£ã㯠| 29.6 |
次ã®ã¹ããã
ãããã®ãã¹ãŠã®æ¹åãè¡ãã®ã«å°ãã®åªåãå¿
èŠã§ããã ãããã®å€æŽã¯ãSlackã§ã®å®æçãªè°è«ã«ãã£ãŠå°ãããŸããã
System.MathF
ãMonoã«ç§»æ€ããããã«ãããå€æ¹ã«ãªããšãæéãäœãããšããã§ããŸããã
Arasã¬ã€ãã¬ãŒãµãŒã³ãŒãã¯ãèªçµŠèªè¶³ã§ãããå®éã®ã¢ããªã±ãŒã·ã§ã³ã§ãããåæãã³ãããŒã¯ã§ã¯ãªãã£ããããç 究ã®çæ³çãªå¯Ÿè±¡ãšãªããŸããã çæãããã€ããªã³ãŒããç 究ããããã«äœ¿çšã§ããä»ã®åæ§ã®ãœãããŠã§ã¢ãèŠã€ããæé©ãªããŒã¿ãLLVMã«éä¿¡ããŠããã®äœæ¥ã®æé©ãªããã©ãŒãã³ã¹ã確ä¿ããå¿
èŠããããŸãã
ãŸããLLVMãæŽæ°ããæ°ããè¿œå ãããæé©åã䜿çšããããšãæ€èšããŠããŸãã
å¥æ³š
äœåãªç²ŸåºŠã«ã¯çŽ æŽãããå¯äœçšããããŸãã ããšãã°ãGodotãšã³ãžã³ã®ããŒã«ãªã¯ãšã¹ããèªãã§ãã³ã³ãã€ã«æã«æµ®åå°æ°ç¹æŒç®ã®ç²ŸåºŠãã«ã¹ã¿ãã€ãºå¯èœã«ãããã©ããã«ã€ããŠæŽ»çºãªè°è«ãããããšãããããŸããïŒ
https://github.com/godotengine/godot/pull/17134 ïŒã
ã²ãŒã ã«ã¯32ãããã®æµ®åå°æ°ç¹æŒç®ã§ååã ãšä¿¡ããŠããã®ã§ããªãããã誰ãã«å¿
èŠãªã®ããšJuanã«å°ããŸããã
ãã¢ã³ã¯ãäžè¬çãªå ŽåããããŒãã¯ããŸãæ©èœãããšèª¬æããŸããããã²ãŒã ã®äžå¿ãããé¢ããããããšãã°ã²ãŒã ã®äžå¿ãã100ããã¡ãŒãã«ç§»åãããšãèšç®ãšã©ãŒãèç©ãå§ããèå³æ·±ãã°ã©ãã£ãã¯ã®äžå
·åã«ã€ãªããå¯èœæ§ããããŸãã ãã®åé¡ã®åœ±é¿ã軜æžããããã«ããŸããŸãªæŠç¥ã䜿çšã§ããŸããããã®ãã¡ã®1ã€ã¯ç²ŸåºŠãé«ããŠäœæ¥ããããšã§ããããã®ããã«ããã©ãŒãã³ã¹ã«å¯ŸããŠæ¯æãå¿
èŠããããŸãã
äŒè©±ã®çŽåŸãTwitterãã£ãŒãã§ããã®åé¡ãå®èšŒããæçš¿ãèŠãŸããïŒ
http :
//pharr.org/matt/blog/2018/03/02/rendering-in-camera-space.htmlåé¡ã¯ä»¥äžã®ç»åã«ç€ºãããŠããŸãã ããã§ã¯ã pbrt-v3-scenes **
ããã±ãŒãžã®ã¹ããŒãã«ãŒã¢ãã«ã瀺ããŸã ã ã«ã¡ã©ãšã·ãŒã³ã®äž¡æ¹ãåç¹ã«è¿ãããã¹ãŠãçŽ æŽãããèŠããŸãã**
ïŒ æ£®åº·ä¿ã® èè
ãïŒæ¬¡ã«ãåç¹ããxxãyyãzzã§ã«ã¡ã©ãšã·ãŒã³ã200,000ãŠããã移åããŸãã ãã·ã³ã®ã¢ãã«ãéåžžã«æçåãããŠããããšãããããŸãã ããã¯ã粟床ã®æµ®åå°æ°ç¹æ°ãäžè¶³ããŠããããã§ãã
ããã«5Ã5Ã5åãåç¹ãã100äžåäœç§»åãããšãã¢ãã«ã¯åŽ©å£ãå§ããŸãã ãã·ã³ã¯ãããããããŠæããããããèªäœã®éåžžã«ç²éãªãã¯ã»ã«è¿äŒŒã«å€ãããŸãã ïŒãã¢ãã¯è³ªåãããŸããïŒMinecraftã¯ããã¹ãŠãåç¹ããéåžžã«é ãã«ã¬ã³ããªã³ã°ãããŠãããšããçç±ã ãã§ãç«æ¹äœã§ããïŒïŒ**
ïŒ åœŒã®çŸããã¢ãã«ã§ç§ãã¡ãããããšã«ã€ããŠã 森康æ ã«è¬çœªã ãŸããïŒ