Tagged articles

CGO

23 articles · Page 1 of 1
TonyBai
TonyBai
Mar 17, 2026 · Fundamentals

Why Go’s regexp Is Slower Than Python – The Safety Trade‑offs Behind the Design

The article dissects why Go’s standard regexp package lags behind Python and other languages, tracing the slowdown to a pure‑Go implementation that avoids CGO, the choice of a Thompson‑NFA engine for safety, heavy UTF‑8 rune decoding, memory‑intensive NFA simulation, and shows how community projects like coregex reclaim performance while preserving Go’s safety guarantees.

CGOGoSIMD
0 likes · 13 min read
Why Go’s regexp Is Slower Than Python – The Safety Trade‑offs Behind the Design
TonyBai
TonyBai
Jan 21, 2026 · Artificial Intelligence

When Go Meets GPU: A Hands‑On Guide to Unlocking Thousand‑Fold Compute with CUDA

This article walks Go developers through the fundamentals of GPU architecture and CUDA, demonstrates a complete CGO‑based matrix‑multiplication project, offers performance‑tuning tips such as minimizing PCIe transfers and leveraging shared memory, and presents a PureGo alternative for seamless Go‑GPU integration.

CGOCUDAGPU computing
0 likes · 17 min read
When Go Meets GPU: A Hands‑On Guide to Unlocking Thousand‑Fold Compute with CUDA
Code Wrench
Code Wrench
Dec 12, 2025 · Backend Development

Master CGO: Deep Dive into Go‑C Interoperability, Performance & Interview Secrets

This article provides a comprehensive, low‑level explanation of Go’s CGO bridge, covering its purpose, performance overhead, scheduler interaction, pointer safety rules, memory‑management guidelines, common use‑cases, scenarios to avoid, optimization techniques, and a collection of high‑frequency interview questions with model answers.

CGOGoInteroperability
0 likes · 8 min read
Master CGO: Deep Dive into Go‑C Interoperability, Performance & Interview Secrets
php Courses
php Courses
Jun 25, 2025 · Backend Development

Master CGO: Seamlessly Integrate C Libraries into Go Projects

This comprehensive guide explains CGO fundamentals, demonstrates basic and advanced usage with practical code examples, covers type conversion, calling C standard libraries, handling external C files, callbacks, struct passing, memory‑management best practices, real‑world scenarios, limitations, and alternative approaches for Go developers.

C integrationCGOGo
0 likes · 9 min read
Master CGO: Seamlessly Integrate C Libraries into Go Projects
FunTester
FunTester
Jan 10, 2025 · Backend Development

Seamlessly Call Go Functions from Java Using JNI: A Step‑by‑Step Guide

Learn how to integrate Go and Java by compiling Go code into a shared library, exposing functions via cgo and JNI, and invoking them from Java with detailed setup, code examples, handling of primitive and complex data types, and full build‑and‑run instructions.

CGOGoInteroperability
0 likes · 12 min read
Seamlessly Call Go Functions from Java Using JNI: A Step‑by‑Step Guide
Linux Kernel Journey
Linux Kernel Journey
Nov 30, 2024 · Fundamentals

How a SIGPIPE Signal Crashed Our Service and the Fix We Applied

During a gray‑release, a Go‑Rust service repeatedly crashed when a dependent process was hot‑upgraded; the root cause was an unhandled SIGPIPE signal generated by the kernel on a broken TCP connection, which terminated the process without a core dump, and the article explains the kernel mechanics and the solution of ignoring SIGPIPE.

CGOGoLinux signals
0 likes · 16 min read
How a SIGPIPE Signal Crashed Our Service and the Fix We Applied
IT Services Circle
IT Services Circle
May 25, 2024 · Backend Development

Calling Go Functions from C: Implementation Steps and Underlying Mechanism

This article explains how to call Go functions from C within the same process, covering the three‑step implementation, compilation into a shared library, the C invocation code, and a detailed walkthrough of the cgo and Go runtime mechanisms that make cross‑language calls possible.

CGOCross-languageInteroperability
0 likes · 13 min read
Calling Go Functions from C: Implementation Steps and Underlying Mechanism
Shopee Tech Team
Shopee Tech Team
Jun 2, 2022 · Backend Development

Applying GPU Technology for High‑Throughput Image Rendering in Shopee Off‑Platform Ads

The Shopee Off‑Platform Ads team built a GPU‑accelerated Creative Rendering System that uses a four‑layer architecture, CGO‑bridged C/C++ kernels, and template caching to process billions of product images daily, achieving roughly ten‑fold speedup, half the cost, and far reduced rack space while handling high concurrency.

AdvertisingCGOCUDA
0 likes · 23 min read
Applying GPU Technology for High‑Throughput Image Rendering in Shopee Off‑Platform Ads
Sohu Tech Products
Sohu Tech Products
Apr 13, 2022 · Backend Development

Understanding Go Memory Leaks and Using pprof for Profiling

This article explains why Go programs can still exhibit memory growth despite automatic garbage collection, describes how to identify and diagnose such issues with the built‑in pprof tool, and details the underlying sampling mechanism, memory fragmentation, and cgo‑related allocations.

CGOGCGo
0 likes · 9 min read
Understanding Go Memory Leaks and Using pprof for Profiling
Tencent Cloud Developer
Tencent Cloud Developer
Aug 30, 2021 · Backend Development

Troubleshooting Golang Memory Leaks: A Production Case Study

The case study walks through debugging a Go production service that regularly spiked to over 6 GB of resident memory, revealing that unbuffered channel leaks, mis‑configured HTTP client timeouts, and ultimately a cgo‑based image‑processing library spawning unmanaged threads caused the leaks, and outlines a systematic troubleshooting workflow.

CGOGoroutinedebugging
0 likes · 12 min read
Troubleshooting Golang Memory Leaks: A Production Case Study
Tencent Cloud Developer
Tencent Cloud Developer
Aug 23, 2021 · Backend Development

Performance Optimization Techniques for Go Standard Library

The article surveys a range of Go standard‑library performance tricks—from using sync.Pool and zero‑copy string/byte conversions to reducing lock contention, leveraging go:linkname, caching call‑frame data, optimizing cgo calls, employing custom epoll, SIMD, and occasional JIT—while urging profiling‑first, readability‑preserving optimizations.

CGOGosync.Pool
0 likes · 17 min read
Performance Optimization Techniques for Go Standard Library
dbaplus Community
dbaplus Community
Jun 13, 2018 · Databases

How to Build a PostgreSQL FDW with Go: From Theory to Practice

This article explains the history and architecture of PostgreSQL's Foreign Data Wrapper (FDW), details the required database objects and callback functions, and provides a step‑by‑step guide for implementing an FDW in Go using cgo, including code examples, build instructions, and performance considerations.

CGODatabase ExtensionFDW
0 likes · 26 min read
How to Build a PostgreSQL FDW with Go: From Theory to Practice