We present a source-to-source transformation framework, GOCC, that consumes lock-based pessimistic concurrency programs in the Go language and transforms them into optimistic concurrency programs that use Hardware Transactional Memory (HTM). The choice of the Go language is motivated by the fact that concurrency is a first-class citizen in Go, and it is widely used in Go programs. GOCC performs rich inter-procedural program analysis to detect and filter lock-protected regions and performs AST-level code transformation of the surrounding locks when profitable. Profitability is driven by both static analyses of critical sections and dynamic analysis via execution profiles. A custom HTM library, using perceptron, learns concurrency behavior and dynamically decides whether to use HTM in the rewritten lock/unlock points. Given the rich history of transactional memory research but its lack of adoption in any industrial setting, we believe this workflow, which ultimately produces source-code patches, is more apt for industry-scale adoption. Results on widely adopted Go libraries and applications demonstrate significant (up to 10x) and scalable performance gains resulting from our automated transformation while avoiding major performance regressions.
翻译:我们提出了一个源到源的转换框架,即GoCC,它耗用Go语言的基于锁定的悲观共解货币程序,将其转换成使用硬件交易记忆(HTM)的乐观的共通货币程序。选择Go语言的动机是,在Go方案中,conal是头等公民,在Go方案中广泛使用。GoCC进行丰富的程序间方案分析,以探测和过滤受锁定保护的区域,并在有利时对周围的锁进行AST级代码转换。在对关键部分进行静态分析和通过执行剖面进行动态分析的驱动下,利润率很高。一个定制的HTM图书馆,使用perceptron,学习货币行为,动态地决定是否在重写锁/解锁点中使用HTM。鉴于交易记忆研究的丰富历史,但在任何工业环境中都没有被采纳,我们认为,这种最终产生源代码补的工作流程更适合工业规模的采用。关于广泛采用的关键部分和动态分析的结果表明,从我们自动转换过程中避免主要性回归,从自动转换中取得显著(高达10x)和可伸缩的绩效成果。