Join patterns are an underexplored approach for the programming of concurrent and distributed systems. When applied to the actor model, join patterns offer the novel capability of matching combinations of messages in the mailbox of an actor. Previous work by Philipp Haller et al. in the paper "Fair Join Pattern Matching for Actors" (ECOOP 2024) explored join patterns with conditional guards in an actor-based setting with a specification of fair and deterministic matching semantics. Nevertheless, the question of time efficiency in fair join pattern matching has remained underexplored. The stateful tree-based matching algorithm of Haller et al. performs worse than an implementation that adapts the Rete algorithm to the regular version of a join pattern matching benchmark, while outperforming on a variant with heavy conditional guards, which take longer to evaluate. Nevertheless, conforming Rete to the problem of join pattern matching requires heavy manual adaptation. In this thesis, we enhance and optimize the stateful tree-based matching algorithm of Haller et al. to achieve up to tenfold performance improvements on certain benchmarks, approaching the performance of Rete on regular benchmarks while maintaining the advantages of versatility and performance with heavy guards. We also enhance the benchmark suite, adding new features and enhancing its extensibility and user-friendliness. We extend the join pattern implementation with a less ambiguous syntax as well as dynamic pattern switching. Finally, we present a new complex model use case for join patterns, showing their applicability in a microservice web architecture.


翻译:连接模式是并发与分布式系统编程中一种尚未被充分探索的方法。在参与者模型中应用时,连接模式提供了匹配参与者邮箱中消息组合的新颖能力。Philipp Haller等人在论文《参与者公平连接模式匹配》(ECOOP 2024)中,基于参与者模型探索了带条件守卫的连接模式,并规定了公平且确定性的匹配语义。然而,公平连接模式匹配的时间效率问题仍未得到充分研究。Haller等人提出的基于状态树的匹配算法,在常规连接模式匹配基准测试中表现逊于适配Rete算法的实现,但在包含高开销条件守卫(评估耗时较长)的变体测试中表现更优。尽管如此,使Rete算法适应连接模式匹配问题需要大量人工调整。本论文通过增强和优化Haller等人的基于状态树的匹配算法,在特定基准测试中实现了最高十倍的性能提升,使其在常规基准测试中接近Rete算法的性能,同时保持了对复杂守卫的通用性和性能优势。我们还改进了基准测试套件,新增了多项功能并提升了其可扩展性与用户友好性。通过引入歧义更少的语法及动态模式切换机制,扩展了连接模式的实现。最后,我们提出了连接模式在微服务Web架构中的新型复杂应用案例,展示了其实际适用性。

0
下载
关闭预览
Top
微信扫码咨询专知VIP会员