32 Matching Annotations
  1. Oct 2023
  2. Sep 2023
  3. Aug 2023
    1. Inside the Apache Kafka Broker

      consumer properties => same as producer, time and batch size.

    2. Kafka Broker

      producer key properties => linger time -> linger.ms batch size -> batch.size

      these determine the throughput and latency of kafkaproducers

  4. Jul 2023
  5. Jun 2023
  6. Apr 2023
  7. Feb 2023
    1. Node.js

      js import { renderToPipeableStream } from "react-dom/server.node"; import React from "react"; import http from "http"; const App = () => ( <html> <body> <h1>Hello World</h1> <p>This is an example.</p> </body> </html> ); var didError = false; http .createServer(function (req, res) { const stream = renderToPipeableStream(<App />, { onShellReady() { res.statusCode = didError ? 500 : 200; res.setHeader("Content-type", "text/html"); res.setHeader("Cache-Control", "no-transform"); stream.pipe(res); }, onShellError(error) { res.statusCode = 500; res.send( '<!doctype html><p>Loading...</p><script src="clientrender.js"></script>', ); }, onAllReady() { }, onError(err) { didError = true; console.error(err); }, }); }) .listen(3000);

      Deno

      ```js import { renderToReadableStream } from "https://esm.run/react-dom/server"; import * as React from "https://esm.run/react";

      const App = () => ( <html> <body>

      Hello World

      This is an example.

      </body> </html> );

      const headers = { headers: { "Content-Type": "text/html", "Cache-Control": "no-transform", }, };

      Deno.serve( async (req) => { return new Response(await renderToReadableStream(<App />), headers); }, { port: 3000 }, ); ```

      Bun

      ```js import { renderToReadableStream } from "react-dom/server"; const headers = { headers: { "Content-Type": "text/html", }, };

      const App = () => ( <html> <body>

      Hello World

      This is an example.

      </body> </html> );

      Bun.serve({ port: 3000, async fetch(req) { return new Response(await renderToReadableStream(<App />), headers); }, }); ```

  8. Nov 2022
  9. Jan 2022
    1. today is a day for best effort and gentle improvement. writing a self-review for work always makes me want to unalive myself (even when I think I'm doing well???) so we're not being real ambitious outside of getting that done (well, besides all the normal work nonsense).

      Same here :) I should really start writing perf before end of the month... I procrastinate a lot on it usually, even when I know it's silly.

  10. Apr 2021
    1. Holy xxx, it takes 3.37s to calculate merely 1,000,000 reciprocal numbers. The same logic in C takes just a blink: 9ms; C# takes 19ms; Nodejs takes 26ms; Java takes 5ms! and Python takes self-doubting 3.37 SECONDS.

      But numpy takes just 2ms!

  11. Mar 2020
  12. Sep 2018
    1. var el; var i = 0; var fragment = document.createDocumentFragment(); while (i < 200) { el = document.createElement('li'); el.innerText = 'This is my list item number ' + i; fragment.appendChild(el); i++; } div.appendChild(fragment);
    1. The fastest (): while (node.lastChild) { node.removeChild(node.lastChild); } Alternatives (slower): while (node.firstChild) { node.removeChild(node.firstChild); } while (node.hasChildNodes()) { node.removeChild(node.lastChild); }
  13. Apr 2018