asm.js x emscripten: The foundation of the next level Web gamesNoritada Shimizu
Game requires high performance to its run times. asm.js brings Web browsers high performance JavaScript processing and allows us to build heavy games on the top of Web browsers. In this talk, we can see 1 )the background of asm.js 2) asm.js details and 3) overview of emscripten, a compiler which emits asm.js formatted JavaScript code from C/C++.
asm.js の詳細と emscripten の簡単な使い方について解説します。
Event : Visual Studio Users Community Japan #1
Date : 2019/09/14
ソフトウェア/サービス開発において最も後回しにされるものの代表が「パフォーマンスの向上」です。C#/.NET の最大の武器は開発生産性ですが、C# 7.0 以降はパフォーマンス向上のための機能追加が多数行われています。いくつかのポイントを押さえることで実装時からより高速なコードを書くことができるようになります。
このドキュメントでは、そんなポイントとなる箇所をふんだんにお届けします。
11. MAGNET PATTERN
sprayチームが名づけたデザインパターン 参考:
基本的な考え方は先のOverlappable型クラスと同じ
ただしMagnet Patternでは、暗黙の型変換を利用して暗黙のパラメータリストを除いている
spray | Blog » The Magnet Pattern
trait OverlapMagnet{
type Result
def value:Result
}
object OverlapMagnet{
implicit class IntOverlapMagnet(i:Int) extends OverlapMagnet{
type Result = Int
def value = i * i
}
implicit class StringOverlapMagnet(s:String) extends OverlapMagnet{
type Result = String
def value = s.foldLeft(""){(l,r) => l + r + r}
}
}
def overlap(magnet:OverlapMagnet):magnet.Result = magnet.value