Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
at main 972 B view raw
1<!doctype html> 2<html lang="en"> 3 <head> 4 <meta charset="UTF-8" /> 5 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 6 <title>1000 Reads Complex</title> 7 <script> 8 window.process = { env: { NODE_ENV: 'development' } }; 9 </script> 10 </head> 11 12 <body> 13 <div id="root"></div> 14 <script type="module"> 15 import urqlClient from './urqlClient.js'; 16 import * as bench from '/bench.js'; 17 import { makeEntries } from './makeEntries.js'; 18 import { makeAuthor } from './entities.js'; 19 import { getAllAuthors, addAuthors } from './benchmarks.js'; 20 21 // create authors to be added/written 22 const thousandAuthors = makeEntries(1000, makeAuthor); 23 24 const benchmark = async () => { 25 await addAuthors(thousandAuthors); 26 // measure how long read takes 27 bench.start(); 28 await getAllAuthors(); 29 bench.stop(); 30 }; 31 32 benchmark(); 33 </script> 34 </body> 35</html>