Skip to content

Instantly share code, notes, and snippets.

View abdulrahmanAlotaibi's full-sized avatar
🎨
Programming

Abdulrahman Alotaibi abdulrahmanAlotaibi

🎨
Programming
  • Riyadh, KSA
  • 14:48 (UTC -12:00)
View GitHub Profile
@abdulrahmanAlotaibi
abdulrahmanAlotaibi / numeric_vs_uuid
Created September 17, 2022 09:50 — forked from jgaskins/numeric_vs_uuid
Comparing numeric vs UUID in Postgres. Rehearsal benchmarks are thrown out. Only the second run is kept. Insertions are done all in one query to minimize the impact of I/O. This is harder to do with retrieval, but the ids are randomized in each one to minimize the effects of caching inside the database.
Inserting
user system total real
Numeric 0.070000 0.010000 0.080000 ( 0.586738)
UUID 0.070000 0.020000 0.090000 ( 3.101085)
Retrieving by id
user system total real
Numeric 0.810000 0.980000 1.790000 ( 6.831551)
UUID 0.830000 0.990000 1.820000 ( 6.981944)
@miclle
miclle / timestamp.go
Created July 9, 2020 02:55
golang timestamp type
package timestamp
import (
"database/sql/driver"
"fmt"
"strings"
"time"
"github.com/araddon/dateparse"
"github.com/globalsign/mgo/bson"
@alexellis
alexellis / kubernetes-ingress-example.yaml
Created June 21, 2020 12:50
kubernetes-ingress-example.yaml
# From my webinar for Sysdig - Exploring Kubernetes 1.18
# Create A KinD or k3s cluster with no IngressController
# Run `arkade install ingress-nginx` to add IngressNginx to the cluster as your IngressController
# Save and apply all the Kubernetes YAML files below
# Forward the IngressController
# kubectl port-forward ingress-nginx-controller 8080:80
@grantjenks
grantjenks / bottlebench.py
Last active October 28, 2021 18:00
Server-side I/O Performance in Python
"""Server-side I/O Performance in Python
Based on the article and discussion at:
https://www.toptal.com/back-end/server-side-io-performance-node-php-java-go
The code was posted at:
https://peabody.io/post/server-env-benchmarks/
@begriffs
begriffs / uuid-insert-profile.md
Last active March 24, 2023 13:01
Profiling insertion of UUIDs with btree and hash indices

Is this a fair benchmark?

  • I'm comparing the speed of inserting UUIDs into columns which are indexed with btree vs hash
  • Want to ensure that I'm measuring both insert queries at their best performance
  • Profiled each of them to check whether there is interference by server misconfiguration

Flame graph results

Both were sampled with perf record -F 99 -u postgres -g --call-graph dwarf -- sleep 180

@hopbit
hopbit / intellij-idea-shortcuts.md
Last active April 25, 2024 08:32
IntelliJ IDEA Keyboard Shortcuts Cheatsheet

Modes

distraction mode
fullscreen mode
autoscroll from/to source
termial settings -> don't override shortcuts presentation asist

Editing

.
├── books
│   ├── handlers.go
│   └── models.go
├── config
│   └── db.go
└── main.go