Coder Social home page Coder Social logo

Comments (4)

xywanz avatar xywanz commented on June 24, 2024

这个时间测算还是很有必要的,后面想对性能做优化的话必须要有时间相关的指标。如果能用rdtscp+绑定cpu的方法我觉得是比较合理的,而chrono本身有一微秒的开销,会导致比较大误差。不知道你那边是否能对这个功能提供支持呢😜

from ft.

liutongwei avatar liutongwei commented on June 24, 2024

之前为了简单我都直接用chrono来测算 wall clock time。

有个问题是不同的gateway支持绑定cpu吗?比如ctp底层应该是它本身来维护线程异步,如果ctp不支持绑核的话,OnRtnDepthMarketDataSendOrder之间因为上下文切换导致时延会较高。

只考虑OrderManagementSystem Strategy绑核的话,之前有看过饶大佬的tscns实现方法,具体到程序里还得改,我再熟悉熟悉:sweat_smile:

from ft.

xywanz avatar xywanz commented on June 24, 2024

api里面有自己的线程确实是个问题,绑核的话需要用taskset来操作,不够灵活。倒是可以先研究下别的方法😄

from ft.

songzhao831 avatar songzhao831 commented on June 24, 2024

其实主要是策略里的算法多线程需要绑核, 但这里框架怎么做还是需要多考虑一下。
常见的方式是: tick来后会收集tick数据, 每到一个新的tick,就要把之前的收集的数据用放到多线程(可能要多核并行,如何绑cpu)里运算, 出结果后再去下单。

from ft.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.