Writing Tests in Go: Unit Tests, Examples, and Benchmarks
Unit Testing
Basic Srtucture
Test functions must begin with Test and accept a single parameter t *testing.T. Use assertion methods from *testing.T to verify results. Execute tests using the go test command.
Example Implementation
package calculator
import "testing"
func Greet() string {
return "Welcome, user"
}
func T ...
Posted on Tue, 22 Sep 2026 16:07:14 +0000 by D
Performance Benchmark: Elasticsearch vs Easysearch
Virtual Machine Specifications
Using Alibaba Cloud instance type: ecs.u1-c1m4.4xlarge, PL2: Single disk IOPS performance limit 100,000 (applicable cloud disk capacity range: 461GiB - 64TiB)
vCPU
Memory (GiB)
Disk (GB)
Bandwidth (Gbit/s)
Quantity
16
64
500
5000
24
Easysearch Configuration
7-node cluster, version: 1.9.0
Instance Name ...
Posted on Sat, 15 Aug 2026 16:02:11 +0000 by Archangel915
Performance Testing with Pytest: A Practical Guide
Introduction
Pytest is primarily known for unit testing, but it also supports performance and benchmark testing through the pytest-benchmark plugin. This article demonstrates how to set up and execute performance tests using this powerful combination.
Prerequisites
Ensure you have Python installed along with pytest and the pytest-benchmark plug ...
Posted on Sat, 18 Jul 2026 16:42:42 +0000 by noisyscanner
Performance Benchmark of C++ Input Methods for Competitive Programming
We evaluated the performance of various C++ input methods by processing 1,000,000 randomly generated integers (within INT32 range) on an Intel Core i5-12400 system running Windows 11.
Tested Input Methods
Standard scanf
Standard cin
Custom fast read
Bitwise optimized fast read
fread + bitwise optimized read
cin with sync disabled
cin with sync ...
Posted on Wed, 03 Jun 2026 17:50:53 +0000 by smellicus
MySQL Performance Stress Testing Tool: mysqlslap
Overview
The mysqlslap tool is a built-in MySQL benchmark utility that has been available since version 5.1.4. It simulates multiple concurrent clients accessing MySQL to execute stress tests, providing detailed performance reports on SQL execution. The tool is particularly useful for comparing different storage engines (such as MyISAM, InnoDB) ...
Posted on Sun, 17 May 2026 06:30:42 +0000 by ranbla
Choosing and Optimizing Packet Transmission Protocols Based on Performance Benchmarks
Choosing and Optimizing Packet Transmission Protocols Based on Performance Benchmarks
Scenario: In a local network, multiple machines capture packets via their network interfaces and need to synchronize these packets to a single machine.
Original Approach: Use tcpdump -w to write packets into files, then periodically use rsync to transfer them. ...
Posted on Fri, 15 May 2026 17:54:37 +0000 by TPerez