Haskell Thrift library 300x slower than C++ in performance test

前端 未结 5 1697
我在风中等你
我在风中等你 2021-01-30 05:04

I\'m building an application which contains two components - server written in Haskell, and client written in Qt (C++). I\'m using thrift to communicate them, and I wonder why i

5条回答
  •  误落风尘
    2021-01-30 06:03

    I don't see any reference to buffering in the Haskell server. In C++, if you don't buffer, you incur one system call for every vector/list element. I suspect the same thing is happening in the Haskell server.

    I don't see a buffered transport in Haskell directly. As an experiment, you may want to change both the client and server to use a framed transport. Haskell does have a framed transport, and it is buffered. Note that this will change the wire layout.

    As a separate experiment, you may want to turn -off- buffering for C++ and see if the performance numbers are comparable.

提交回复
热议问题