Skip to content

Instantly share code, notes, and snippets.

View practice-golang's full-sized avatar
🤡
Gimme Gophermoji!!

Gopher Kid practice-golang

🤡
Gimme Gophermoji!!
View GitHub Profile
@practice-golang
practice-golang / run-million.go
Last active February 18, 2023 12:17
Check performances of each list types
/*
# AMD Ryzen 5 3600
# Source:
# https://www.datascienceland.com/blog/performance-between-python-r-julia-and-go-which-one-is-better-29
# https://uptrace.dev/blog/golang-memory-arena.html
$ .\run-million.exe
Time - Array: 273.6928ms
Time - Sized Slice: 266.0026ms
Time - Empty Slice: 329.5113ms
@practice-golang
practice-golang / 00_README.md
Created December 25, 2021 00:28 — forked from reagent/00_README.md
Custom HTTP Routing in Go

Custom HTTP Routing in Go

Basic Routing

Responding to requests via simple route matching is built in to Go's net/http standard library package. Just register the path prefixes and callbacks you want invoked and then call the ListenAndServe to have the default request handler invoked on each request. For example:

package main

import (