系统仿真学报 ›› 2025, Vol. 37 ›› Issue (7): 1865-1878.doi: 10.16182/j.issn1004731x.joss.25-0084

• 特约论文 • 上一篇    

面向异构实时仿真的FastDDS高性能优化方法研究

刘聪平1, 宋威2,3, 方建2,3, 刘飞1   

  1. 1.华南理工大学 软件学院,广东 广州 510006
    2.中国电子科技集团公司第二十八研究所,江苏 南京 210095
    3.中国电子科技集团公司信息系统需求实验室,江苏 南京 210095
  • 收稿日期:2025-01-24 修回日期:2025-03-03 出版日期:2025-07-18 发布日期:2025-07-30
  • 通讯作者: 刘飞
  • 第一作者简介:刘聪平(1999-),男,硕士生,研究方向为分布式仿真。
  • 基金资助:
    基础科研计划(JCKY2023206A023)

Research on High-performance Optimization Methods for FastDDS in Heterogeneous Real-time Simulation

Liu Congping1, Song Wei2,3, Fang Jian2,3, Liu Fei1   

  1. 1.School of Software Engineering, South China University of Technology, Guangzhou 510006, China
    2.The 28th Research Institute of China Electronics Technology Group Corporation, Nanjing 210095, China
    3.The Information System Requirements Laboratory of China Electronics Technology Group Corporation, Nanjing 210095, China
  • Received:2025-01-24 Revised:2025-03-03 Online:2025-07-18 Published:2025-07-30
  • Contact: Liu Fei

摘要:

FastDDS在高频数据流场景下存在一定的局限,主要表现为锁竞争、上下文切换带来的性能开销影响仿真效果,以及在强实时性需求下多节点的配置复杂性影响实验效率。本文提出了一种基于批处理可扩展循环队列(BSCQ)的性能优化方法。该方法采用无锁算法替代传统的互斥锁机制,减少锁竞争和死锁问题,结合批处理技术改善数据局部性,提升缓存命中率和内存利用率,有效降低数据传输延迟并提高系统吞吐量。引入冒险指针技术,保障批处理内存管理的安全性,避免内存泄漏风险。实验结果表明:优化方案在小消息和高并发场景中表现出显著优势,其吞吐量和延迟指标均优于现有的基线方案。此外,该方法不依赖于第三方软件环境,具有较强的通用性和移植性,可与硬件优化或其他高性能协议相结合,进一步提升系统性能。

关键词: 异构实时仿真, 数据分发服务, 无锁算法, 批处理, 冒险指针

Abstract:

FastDDS faces limitations under high-frequency data streams, such as lock contention, performance overhead from frequent context switching, and configuration complexity of multiple nodes under strict real-time constraints, which affect the experimental efficiency. This paper proposed a performance optimization method based on a batch-scalable circular queue (BSCQ). The approach replaced the traditional mutex mechanism with a lock-free algorithm to reduce lock contention and avoid deadlocks, while batch processing improved data locality, cache hit rates, and memory utilization, effectively reducing data transmission delay and improving system throughput.Hazard pointers were introduced to ensure safe memory management during batch processingand eliminate memory leak risks. Experimental results show that the optimized scheme shows significant advantages in small message and high concurrency scenarios, and its throughput and latency metrics are better than the existing baseline scheme. In addition, this method does not rely on the third-party software environment, has strong versatility and portability, and can be combined with hardware optimization or other high-performance protocols to further improve the system's performance.

Key words: heterogeneous real-time simulation? data distribution service(DDS), lock-free algorithm, batch processing, hazard pointer

中图分类号: