Skip to content

Instantly share code, notes, and snippets.

View gonzalop's full-sized avatar

Gonzalo Paniagua Javier gonzalop

View GitHub Profile
@gonzalop
gonzalop / a_intro.md
Last active January 19, 2026 16:18
(mosquitto server) Throughput test of github.com/gonzalop/mq vs Paho v3 and Paho v5

Below is the analysis and the actual output of running the throughput test in https://github.com/gonzalop/mq, using examples/throughput/multiple_different_args.sh against a local mosquitto MQTT server running on bare metal.

Note that Paho v3 lacks features and checks present in v5 clients, so it's not really comparing apples to apples, but it's a good reference.

The analysis is what Gemini thought of the output from both the client side and the server side perspectives.

+ } else if isVerne {
+ // VerneMQ configuration
+ // Our custom image uses a wrapper script start_vernemq
+ cmd := []string{"start_vernemq", "--port", port}
+ // Parse mosquitto config to extract limits
+ lines := strings.Split(configContent, "\n")
+ for _, line := range lines {
+ line = strings.TrimSpace(line)
+ if strings.HasPrefix(line, "max_packet_size") {
+ var size int

Performance Optimization Report - Phase 2

1. Objective

The goal was to achieve an additional 5% performance improvement in the dns library's end-to-end throughput, building upon previous optimizations.

2. Optimizations Implemented

A. Zero-Allocation Unpacking for Empty Sections

Location: msg.go (unpackQuestions, unpackRRs)

@gonzalop
gonzalop / PERFORMANCE_REPORT.md
Last active January 17, 2026 05:33
Attempt to use Gemini to improve the performance in the hot path for https://codeberg.org/miekg/dns

Performance Optimization Report - Incremental Unpacking

This report details the performance gains achieved by implementing incremental unpacking in the dns library. The optimizations focus on the server's hot path where a message is often partially unpacked for filtering before being fully unpacked by a handler.

System Information

  • OS: Linux
  • Arch: amd64
  • CPU: AMD Ryzen AI 9 365 w/ Radeon 880M

1. Micro-Benchmarks (Incremental Unpacking)

@gonzalop
gonzalop / a_test_with_vernemq_throughput_test.md
Last active January 18, 2026 03:04
(VerneMQ) Throughput test of github.com/gonzalop/mq vs Paho v3 and Paho v5 Go MQTT libraries

Below is the analysis and the actual output of running the throughput test in https://github.com/gonzalop/mq, using examples/throughput/multiple_different_args.sh against a local VerneMQ MQTT server running in a podman conrtainer like:

podman run --replace -p 1883:1883 -e "DOCKER_VERNEMQ_ACCEPT_EULA=yes" -e "DOCKER_VERNEMQ_ALLOW_ANONYMOUS=on" --name vernemq1 -d vernemq/vernemq

and then another run using --network host.

Note that Paho v3 lacks features and checks present in v5 clients, so it's not really comparing apples to apples, but it's a good reference.

The analysis is what Gemini thought of the output from the client perspective.

@gonzalop
gonzalop / throughput_test.md
Last active January 17, 2026 03:59
(Mochi server) Throughput test of github.com/gonzalop/mq vs Paho v3 and Paho v5 Go MQTT libraries

Below is the analysis and the actual output of running the throughput test in https://github.com/gonzalop/mq, using examples/throughput/multiple_different_args.sh against a local Mochi MQTT server running on bare metal.

Note that Paho v3 lacks features and checks present in v5 clients, so it's not really comparing apples to apples, but it's a good reference.

The analysis is what Gemini thought of the output.

I really ❤️ the memory use + GC runs of mq, and the performance is not to shabby either.