Testing and Comparing 5 Rest Api Clients

While I was working on a performance test of my folaris server, I wanted to find out how well it performs. The performance obviously depends on the available network bandwidth and CPU power. I was happy to see it performs well without using a lot of memory and processor time. First I tested with Powershell/Invoke-RestMethod on localhost interface, I got an average 606 calls per second. Then I tried F# script, I got a miserable .5 call per second. I realized that I have to know my REST API clients first.

What and how did I test

I tested 7 different REST API clients against a local/loop folaris server and a local/network interface.

The server was warmed up before the tests. This is because folaris uses a pool of 25 runspaces to execute Powershell scripts, with enough hits it will have all 25 runspaces created.

The REST API Clients tested

For details, check out the source code

  1. Powershell/Invoke-RestMethod: dotnet Http Client
  2. Powershell/RestSharp: load RestSharp dll which uses dotnet Http Client
  3. Python/Requests: a popular Python HTTP client module
  4. F# Data Http: a popular F# package
  5. Groovy/JVM Rest client
  6. Golang Rest client
  7. Node js Rest client

Result from the tests run on a Windows 10 computer

The numbers may be different on a different computer, but the comparison will be similar.

The numbers are for average hits per second
Client localhost/loopbacklocal network interface
Powershell RestSharp 697 664
Golang 3 653
Powershell Invoke-RestMethod 606 590
Node js 350 435
Python requests.5 310
F# Data Http .5 267
Groovy/JVM 35 35