Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

完成现有系统瓶颈分析issue #7

Open
Tracked by #3
Claireliu0912 opened this issue Mar 28, 2023 · 2 comments
Open
Tracked by #3

完成现有系统瓶颈分析issue #7

Claireliu0912 opened this issue Mar 28, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Claireliu0912
Copy link
Collaborator

Claireliu0912 commented Mar 28, 2023

Function of this feature

对现有系统的瓶颈进行分析。

Analysis

  • 同步功能不完备:对仿真可能造成影响的信息没有实现同步,如天气、场景灯光、车门的开关等。
  • 并发访问的成本较高:使用悲观锁进行并发控制,后续尝试使用乐观锁提升多线程的访问效率。
  • 服务器端帧率过低:仿真世界信息的计算和渲染负担较大,暂时没有好的想法解决。
@Claireliu0912 Claireliu0912 added the enhancement New feature or request label Mar 28, 2023
@Claireliu0912 Claireliu0912 changed the title 完成现有分布式Carla server复现issue 完成现有系统测试issue Mar 28, 2023
@Claireliu0912 Claireliu0912 changed the title 完成现有系统测试issue 完成现有系统瓶颈分析issue Mar 28, 2023
@johnzjq johnzjq added this to the Warmup milestone Apr 4, 2023
@Kururinnpa
Copy link
Collaborator

Kururinnpa commented May 2, 2023

image
update_status函数用时分析
image
image
update_actors函数用时分析的一部分

分析上图中用时占比最多的部分,首先是tick函数,每个线程执行过程中95%的时间都在执行它。其次是update_actors,在这个函数中get_actors和spawn_actor的占比又超过70%,但考虑到整个函数的用时,这其中的两个函数实际占比不超过2%。上述三个函数均为carla自带的api。
最后是lock.acquire,涉及线程的互斥。

可以看出第一个为最主要的瓶颈。
image
image
分析源码可看出World.tick最终调用的是Simulator.tick,函数中SendTickCue与rpc通信有关,SynchronizeFrame负责同步,同时调用TrafficManager中的tick。也就是说tick负责完成rpc通信相关的问题。
lock.acquire用时与线程获得锁的机制相关,通过修改互斥机制可以减少该部分用时。

@johnzjq
Copy link

johnzjq commented May 16, 2023

@Kururinnpa 需要分析server端性能

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants