Code Monkey home page Code Monkey logo

tsuru's Introduction

Tsuru Code Sample

http://www.tsurucapital.com/en/code-sample.html

Idea

  1. Read pcap file, skipping the pcap global header.
  2. Incrementally read the packet. From packet header, get the length of the packet (for offset)
  3. Peek inside payload, check if this payload is a UDP packet or not via UDP header length and offset.
  4. Consume quote market data and save in records.
  5. Process next packet...

Optimization ideas

  1. Can try async/await to push quote market data into list (and then we can sort using timestamp or order given)

Unlikely to improve performance in this case. The parsing and cons'ing quote market data to a list are unlikely to be sequantial. Need to sort (by packet time) if there is no reorder flag given.

  1. Can try rank-select bit-string?(But it seems it is skeptical to improve much because we did not have a complex enum data type that requires a lot of memory allocation.)

We can use the offset to mark the endOfMessage offset. But the data getter is sequantial (a lot of getLazyByteString in my code). Thus some sort of lazy parsing or async/await is needed. Which seems like a lot of unnecessary work is done.


ZhengyanPeh Oct 1 2019

tsuru's People

Contributors

zypeh avatar

Watchers

 avatar Cheah Jer Fei avatar

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.