axios vs fetch
Date tested:
one year ago
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Test name
Executions per second
axios
17294.4 Ops/sec
fetch
20608.5 Ops/sec
Benchmark definition (click to collapse):
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
Tests:
axios
const url = "https://jsonplaceholder.typicode.com/todos"; axios.get(url) .then((response) => console.log(response.data));
fetch
const url = "https://jsonplaceholder.typicode.com/todos"; fetch(url) .then((response) => response.json()) .then((data) => console.log(data));
Open this result on MeasureThat.net