Skip to content

Instantly share code, notes, and snippets.

View caesaneer's full-sized avatar

Dan Casler caesaneer

View GitHub Profile
@caesaneer
caesaneer / entry.go
Last active April 16, 2020 09:25
Go Goroutines vs Node.js Cluster & Worker Threads - Part 1 - Go Code
package main
import (
"fmt"
"net/http"
"runtime"
)
func ok(w http.ResponseWriter, req *http.Request) {
@caesaneer
caesaneer / gist:2810c9fbcfdc2c5bd6804c966f2d80db
Created August 14, 2019 22:14
Go Goroutines vs Node.js Cluster & Worker Threads - Part 1 - Go Code
package main
import (
"fmt"
"net/http"
"runtime"
)
func ok(w http.ResponseWriter, req *http.Request) {
fmt.Fprintf(w, "OK")
package ktor.benchmark
/* ktlint-disable no-wildcard-imports */
import io.ktor.application.*
import io.ktor.response.*
import io.ktor.request.*
import io.ktor.routing.*
import io.ktor.http.*
import io.ktor.locations.*
// ════════════════════════════════════════════════════════════════════════════════════════════════╡
const { parentPort, workerData } = require('worker_threads')
const crypto = require('crypto')
const util = require('util')
const fs = require('fs')
// ════════════════════════════════════════════════════════════════════════════════════════════════╡
const asyncFs = util.promisify(fs.readFile)
package main
import (
"crypto/sha256"
"fmt"
"io/ioutil"
"net/http"
"strconv"
"github.com/labstack/echo"
// ════════════════════════════════════════════════════════════════════════════════════════════════╡
const Hapi = require('hapi')
const Inert = require('inert')
const chalk = require('chalk')
const path = require('path')
// ════════════════════════════════════════════════════════════════════════════════════════════════╡
// Set path to production build
{
"presets": [
"env",
"react",
"stage-2"
],
"plugins": [
"transform-react-jsx-source"
]
}
const path = require('path')
const webpack = require('webpack')
const HtmlWebPackPlugin = require('html-webpack-plugin')
const ErrorOverlayPlugin = require('error-overlay-webpack-plugin')
module.exports = {
devtool: 'cheap-module-source-map',
mode: 'development',
entry: {
index: './src/index.js',