Tagged articles
41 articles
Page 1 of 1
Code Wrench
Code Wrench
Jan 29, 2026 · Fundamentals

Mastering Go’s unsafe Package: 5 Real‑World Cases for Zero‑Copy and High‑Performance Tricks

This article walks through five production‑grade Go unsafe techniques—including zero‑copy string conversion, deep struct copying, lock‑free queues, memory‑mapped files, and custom serialization—explaining core concepts, providing benchmark results, and offering a detailed safety checklist to avoid common pitfalls.

GoZero Copyunsafe
0 likes · 20 min read
Mastering Go’s unsafe Package: 5 Real‑World Cases for Zero‑Copy and High‑Performance Tricks
DevOps Coach
DevOps Coach
Jan 14, 2026 · Information Security

What the First Linux Kernel Rust CVE Reveals About Memory Safety

The article explains CVE‑2025‑68260, the first Rust‑based vulnerability in the Linux kernel, detailing the race condition in the rust_binder driver, why the bug proves Rust’s safety promises, and how its limited impact contrasts with countless C‑related kernel CVEs.

CVELinux kernelMemory Safety
0 likes · 7 min read
What the First Linux Kernel Rust CVE Reveals About Memory Safety
php Courses
php Courses
Jun 20, 2025 · Backend Development

Boost Go Performance: Reduce GC Pressure and Achieve Zero‑Copy

This article explains how Go's concurrent mark‑sweep garbage collector can become a bottleneck in high‑performance scenarios and provides practical techniques—such as using sync.Pool, avoiding unnecessary pointers, pre‑allocating memory, and applying zero‑copy and unsafe tricks—to dramatically lower GC overhead and improve overall program speed.

GoJSONZero Copy
0 likes · 8 min read
Boost Go Performance: Reduce GC Pressure and Achieve Zero‑Copy
BirdNest Tech Talk
BirdNest Tech Talk
Aug 13, 2024 · Backend Development

Why Go 1.22’s []byte(str) Conversion Beats Unsafe: Benchmarks and Deep Dive

The article investigates Go 1.22’s claim that simple type casting []byte(str) can replace unsafe‑based string‑to‑byte conversions, presents four implementation variants, runs detailed benchmarks on macOS M2 and Linux amd64, analyses compiler inlining and escape behavior, and explains the hidden pitfalls of capacity and mutability in the k8s shortcut.

GoZero Copybenchmark
0 likes · 16 min read
Why Go 1.22’s []byte(str) Conversion Beats Unsafe: Benchmarks and Deep Dive
Radish, Keep Going!
Radish, Keep Going!
Jul 25, 2024 · Backend Development

How to Slash Go GC Overhead on Large Heaps: Techniques and Code

This article examines why Go's garbage collector can become a CPU bottleneck with large heaps, demonstrates the performance impact with benchmark programs, and presents practical strategies—such as using pointer‑free allocations, mmap‑backed memory, and string interning—to dramatically reduce GC pause times.

Garbage CollectionGoLarge heap
0 likes · 13 min read
How to Slash Go GC Overhead on Large Heaps: Techniques and Code
macrozheng
macrozheng
Jul 19, 2024 · Backend Development

Master Java Obfuscation: 5 Crazy Tricks to Write Unreadable Code

This article reveals five advanced Java tricks—using Unicode escapes in comments, over‑complicating simple logic with bitwise shifts, tampering with Boolean.TRUE via reflection, forcing both branches of an if‑else to run, and leveraging the Unsafe class for low‑level memory manipulation—to deliberately make code hard to understand.

ReflectionUnicodebitwise
0 likes · 12 min read
Master Java Obfuscation: 5 Crazy Tricks to Write Unreadable Code
Python Programming Learning Circle
Python Programming Learning Circle
Jul 15, 2024 · Fundamentals

Understanding NumPy Array Memory Layout and Accelerating Image Resizing with Unsafe Python Techniques

This article explains how NumPy stride differences caused a 100× slowdown when resizing images from a pygame Surface, demonstrates how to reinterpret the underlying memory layout using ctypes to achieve a 100× speedup with OpenCV, and discusses the safety implications of such low‑level Python tricks.

NumPyOpenCVPython
0 likes · 19 min read
Understanding NumPy Array Memory Layout and Accelerating Image Resizing with Unsafe Python Techniques
Ops Development & AI Practice
Ops Development & AI Practice
Apr 26, 2024 · Backend Development

Mastering Go's unsafe Package: When and How to Use It Safely

This article explains Go's unsafe package, covering its core concepts—Pointer, Sizeof, and Offsetof—provides practical code examples, outlines suitable scenarios such as system calls and performance tuning, and highlights the associated risks and best‑practice precautions.

GoMemorySystems Programming
0 likes · 5 min read
Mastering Go's unsafe Package: When and How to Use It Safely
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Oct 5, 2023 · Backend Development

Mastering Java Unsafe: Low-Level Memory Tricks and Atomic Operations

This article introduces Java's sun.misc.Unsafe class, explains its memory, CAS, thread, class, and object manipulation APIs, shows how to obtain an Unsafe instance, and provides practical code examples for low‑level operations such as field offsets, compare‑and‑swap, object allocation, and custom atomic counters.

atomic operationsconcurrencyjava
0 likes · 9 min read
Mastering Java Unsafe: Low-Level Memory Tricks and Atomic Operations
Cognitive Technology Team
Cognitive Technology Team
Aug 6, 2023 · Fundamentals

Common Pitfalls When Using Go Slices and How to Avoid Them

This article explains three typical pitfalls of Go slices—ignoring the slice returned by append, unintentionally sharing the underlying array which can cause memory leaks, and the value‑copy behavior of for‑range loops—while also showing how to inspect slice internals using unsafe pointers.

BackendGoappend
0 likes · 5 min read
Common Pitfalls When Using Go Slices and How to Avoid Them
21CTO
21CTO
Mar 31, 2023 · Backend Development

Boost Go Performance: 6 Proven Techniques for Faster, Leaner Apps

This article presents six practical Go performance optimizations—including GOMAXPROCS tuning for Kubernetes, struct field ordering, garbage‑collection limits, zero‑copy unsafe conversions, jsoniter usage, and sync.Pool pooling—that together can dramatically lower CPU, memory, and latency in production services.

Garbage CollectionGoKubernetes
0 likes · 9 min read
Boost Go Performance: 6 Proven Techniques for Faster, Leaner Apps
Alibaba Cloud Developer
Alibaba Cloud Developer
Dec 29, 2022 · Fundamentals

How to Achieve Zero‑Copy String Construction Across JDK Versions

This article explains the internal differences of Java's String implementation from JDK 8 to JDK 9+, demonstrates how to use sun.misc.Unsafe and trusted MethodHandles.Lookup to build zero‑copy String objects, and provides practical code examples for high‑performance string handling.

MethodHandlesStringZeroCopy
0 likes · 12 min read
How to Achieve Zero‑Copy String Construction Across JDK Versions
21CTO
21CTO
Dec 19, 2022 · Fundamentals

What Should Rust Prioritize in 2023? Governance, Compiler Rewrite, and More

The article outlines Rust's 2023 priorities, emphasizing governance and leadership challenges, a potential compiler rewrite, strengthening Cargo, advancing async and unsafe programming, and fostering innovation while avoiding stagnation, all aimed at sustaining the language's reliability and performance.

AsyncProgramming Languagecargo
0 likes · 7 min read
What Should Rust Prioritize in 2023? Governance, Compiler Rewrite, and More
Laravel Tech Community
Laravel Tech Community
Dec 12, 2022 · Fundamentals

Go 1.20 Release Candidate Highlights: New Slice‑to‑Array Conversion, Unsafe Package Functions, and Comparable Types

Go 1.20 RC1 introduces experimental RISC‑V/FreeBSD support, expands slice‑to‑array conversion, adds three new unsafe package functions, updates comparable type constraints, and changes struct value comparison order, while being the final version compatible with macOS 10.13/10.14, with download details provided.

ComparableProgramming LanguageRISC-V
0 likes · 4 min read
Go 1.20 Release Candidate Highlights: New Slice‑to‑Array Conversion, Unsafe Package Functions, and Comparable Types
macrozheng
macrozheng
Sep 6, 2022 · Backend Development

How to Write Java Code That Even Your Colleagues Can’t Understand

Explore a series of unconventional Java tricks—from Unicode escape hacks and bitwise tricks to reflection-based Boolean tampering and Unsafe memory manipulation—that let you deliberately obfuscate code, making it hard for teammates to read, modify, or even predict its behavior.

Reflectionbitwisecode obfuscation
0 likes · 14 min read
How to Write Java Code That Even Your Colleagues Can’t Understand
Senior Brother's Insights
Senior Brother's Insights
Jul 21, 2022 · Backend Development

Mastering Java CAS: How AtomicInteger Achieves Lock‑Free Concurrency

This article explains the fundamentals of Compare‑And‑Swap (CAS), its implementation in Java through the Unsafe class, demonstrates AtomicInteger's lock‑free operations, and discusses CAS drawbacks such as spin‑wait overhead, single‑variable limitation, and the ABA problem with mitigation strategies.

ABA problemAtomicIntegerCAS
0 likes · 15 min read
Mastering Java CAS: How AtomicInteger Achieves Lock‑Free Concurrency
ITPUB
ITPUB
Jun 30, 2022 · Backend Development

Master Go Performance: Layered Optimization Strategies for Faster Code

This article presents a layered approach to Go performance optimization, covering reasonable code practices, deliberate algorithmic and structural improvements, risky low‑level tweaks, and practical profiling techniques such as pprof, flame graphs, and trace, while providing concrete examples and actionable guidance.

GoProfilingSlice Capacity
0 likes · 17 min read
Master Go Performance: Layered Optimization Strategies for Faster Code
Code Ape Tech Column
Code Ape Tech Column
Jun 1, 2022 · Fundamentals

Understanding sun.misc.Unsafe: Construction, Core Functions, and Practical Use Cases

This article explains the purpose, construction, and key functionalities of Java's sun.misc.Unsafe class, covering memory management, object allocation, class definition, offset handling, array operations, thread scheduling, CAS, and memory fences, while also showing how to obtain an Unsafe instance via reflection.

Memory ManagementReflectionconcurrency
0 likes · 11 min read
Understanding sun.misc.Unsafe: Construction, Core Functions, and Practical Use Cases
Zhuanzhuan Tech
Zhuanzhuan Tech
Mar 28, 2022 · Backend Development

Understanding Java's sun.misc.Unsafe: Construction, Core Functions, and Usage

This article explains the purpose, construction, and most important capabilities of Java's sun.misc.Unsafe class—including memory management, object instantiation, class loading, offset handling, array operations, thread scheduling, CAS, and memory fences—while providing code examples and practical guidance for developers.

Memory Managementjavalow‑level programming
0 likes · 12 min read
Understanding Java's sun.misc.Unsafe: Construction, Core Functions, and Usage
Top Architect
Top Architect
Jan 1, 2022 · Backend Development

Understanding ThreadLocalRandom and Unsafe in Java: Performance, Implementation, and Pitfalls

This article examines Java's Random performance limitations, explains how ThreadLocalRandom leverages the Unsafe class for per‑thread seed management, analyzes the underlying native methods, discusses safety concerns and memory layout, and shares practical code examples and insights for high‑concurrency applications.

JDKThreadLocalRandomconcurrency
0 likes · 10 min read
Understanding ThreadLocalRandom and Unsafe in Java: Performance, Implementation, and Pitfalls
MaGe Linux Operations
MaGe Linux Operations
Aug 18, 2021 · Backend Development

What’s New in Go 1.17? Performance Boosts, ARM Support, and Unsafe Enhancements

Go 1.17, now officially released, brings roughly a 5% performance uplift, a 2% reduction in amd64 binary size, adds native Windows ARM64 support, introduces pruned module graphs to streamline dependencies, and expands unsafe package capabilities with slice‑to‑array pointer conversion, unsafe.Add, and unsafe.Slice.

ARM supportGo 1.17language features
0 likes · 3 min read
What’s New in Go 1.17? Performance Boosts, ARM Support, and Unsafe Enhancements
Programmer DD
Programmer DD
Jul 23, 2021 · Backend Development

Why ThreadLocalRandom Beats Random in Java: Deep Dive into Unsafe and Memory

This article explores the performance drawbacks of java.util.Random in high‑concurrency scenarios, explains how ThreadLocalRandom leverages Unsafe for per‑thread seeds, examines native getLong/putLong operations, and discusses memory layout nuances such as compressed oops and potential pitfalls.

ThreadLocalRandomconcurrencyjava
0 likes · 10 min read
Why ThreadLocalRandom Beats Random in Java: Deep Dive into Unsafe and Memory
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Sep 22, 2020 · Backend Development

Understanding AtomicInteger, CAS, and Lock‑Free Concurrency in Java

This article explains how Java's AtomicInteger and related atomic classes provide lock‑free thread‑safe operations to replace non‑atomic constructs like i++, detailing their inheritance, underlying Unsafe mechanisms, CAS implementation, memory barriers, optimistic locking, the ABA problem, and practical code examples for increment, decrement, and custom CAS‑based locks.

AtomicIntegerCASOptimisticLocking
0 likes · 15 min read
Understanding AtomicInteger, CAS, and Lock‑Free Concurrency in Java
Programmer DD
Programmer DD
Apr 21, 2020 · Backend Development

Unlocking Java’s Unsafe: How CAS Powers High‑Performance Concurrency

This article explains Java's Unsafe class, its low‑level memory operations, how Compare‑and‑Swap (CAS) is implemented via Unsafe, and how AtomicInteger leverages CAS for lock‑free thread safety while also covering the ABA problem and its mitigation.

AtomicIntegerCASconcurrency
0 likes · 9 min read
Unlocking Java’s Unsafe: How CAS Powers High‑Performance Concurrency
JavaEdge
JavaEdge
Jan 4, 2020 · Backend Development

Mastering Java’s Unsafe park/unpark and AQS: Build Custom Locks with LockSupport

This article explains how Java’s Unsafe class provides low‑level park and unpark methods, how the LockSupport utility wraps them for easier use, and demonstrates building a simple exclusive lock with AbstractQueuedSynchronizer, covering state handling, blocking mechanisms, and thread‑queue management.

AQSCustomLockLockSupport
0 likes · 7 min read
Mastering Java’s Unsafe park/unpark and AQS: Build Custom Locks with LockSupport
Qunar Tech Salon
Qunar Tech Salon
Apr 9, 2019 · Fundamentals

Understanding Java Object Memory Layout and the Oop‑Klass Model

This article explains the JVM Oop‑Klass model, details how Java objects are represented in heap memory, shows how to calculate their size using source code analysis, HSDB, Instrumentation, Unsafe, and third‑party tools, and provides practical examples and code snippets.

HSDBJVMObject Size
0 likes · 15 min read
Understanding Java Object Memory Layout and the Oop‑Klass Model
Meituan Technology Team
Meituan Technology Team
Feb 14, 2019 · Fundamentals

Understanding Java sun.misc.Unsafe: API, Usage, and Applications

The article explains Java’s sun.misc.Unsafe class, detailing how to safely obtain its singleton instance, describing its low‑level memory, CAS, thread, class, and object operations, and outlining common high‑performance use cases while warning about the significant risks of misuse.

Memory Managementconcurrencyjava
0 likes · 19 min read
Understanding Java sun.misc.Unsafe: API, Usage, and Applications
Hujiang Technology
Hujiang Technology
Oct 29, 2018 · Backend Development

Implementing a Custom Java AQS Lock from Scratch

This tutorial walks through building a simple Java lock using AbstractQueuedSynchronizer (AQS), starting with a basic MyLock class, adding thread parking with Unsafe, creating a FIFO thread container, and refining lock and unlock methods to achieve correct synchronization and avoid lock starvation.

AQSLockconcurrency
0 likes · 15 min read
Implementing a Custom Java AQS Lock from Scratch