This overhead can then stack up significantly in an application where there are many calls between JavaScript to native code. While native dependencies can be very powerful for heavy compute tasks, they come with a non-negligible overhead when the runtime must deviate from JavaScript land into native dependency land. One of the key optimisations for Autocannon is that everything is built within the JavaScript domain, meaning there are no native dependencies. It is believed that the only route to optimise Autocannon further is working within the underlying networking stack, within the OS. Autocannon itself is built on a custom HTTP/S client, which is primarily where these optimisations exist. The reason for this is many choice decisions in the implementation of Autocannon for optimisation. While it is built on Node.js, It has been observed to be faster than wrk, a benchmarking tool built with C. If you’re interested in Node.js, you may want to read the following paragraphs to understand how this speed is achieved, otherwise, feel free to skip to the next section.Īs previously mentioned, Autocannon is fast. Cross-Platform I wanted to investigate Golang’s ability to deliver cross-platform tools.Reduced Feature Set: There is no need to enable HTTPS support out of the box for a simple thought experiment, so that entire functionality can be scrapped, and many of the features around controlling the flow of requests in Autocannon aren’t needed - we just want to run as fast as possible.Simple to Use (Command Line) I have never really needed the programmable interface of Autocannon, so to keep it simple, I decided to build this for command line usage only.Speed I primarily wanted to compare speed between Node.js and Golang.Hitting all of these features for a personal investigation in my spare time would be impossible, so I focused on the following key goals: It is simple to use, understand and extend. It is a cross-platform tool that can be run via the command line or using a programmable interface. The repo for this experiment is available here.Īutocannon is a fast HTTP/S 1.1 benchmarking tool written with Node.js, intending to be familiar for those who have already used wrk or wrk2. To do this, I rewrote software I previously worked on and help to maintain: Autocannon. Recently I took some time to reinvent the wheel to understand Golang on a deeper level.
0 Comments
Leave a Reply. |