tech
相同的负载, HTTPS数据包可能比 HTTP大10倍
相同的负载, HTTPS数据包可能比 HTTP大10倍. 缘起 最近上线了一个新服务,有一个采集接口占用的带宽比较多,这个接口很简单,我有点好奇,一个https 请求会传输多少数据, 他会比HTTP请求多多少数据? 我写了一个demo在本地测试一下 func helloHandler(w http.Respo。
tech
相同的负载, HTTPS数据包可能比 HTTP大10倍. 缘起 最近上线了一个新服务,有一个采集接口占用的带宽比较多,这个接口很简单,我有点好奇,一个https 请求会传输多少数据, 他会比HTTP请求多多少数据? 我写了一个demo在本地测试一下 func helloHandler(w http.Respo。
talk
Reflect on 2024 with 35 transformative questions to guide personal growth and set intentions for a purposeful 2025. #SelfDiscovery
tech
goroutine 的状态 切换. Goroutine 的状态 在 golang 中,我们使用 go 创建一个新的gorotine,我们都知道操作系统线程有自己的状态, 比如 在 The time in computers: how long will it take to switch the contex。
tech
HTMX 初体验. htmx 是一种全新的前端开发工具,基于现有的 HTML、CSS 和 JavaScript 技术的一种补充,而不是完全取代它们。 可以将 htmx 与其他技术和工具(如 Vue.js、React、Angular 等)结合使用,它的核心理念是“使用 HTML 作为应用程序的编程语言”, 即通。
tech
Go 1.24 introduces `testing/synctest`, enhancing concurrent testing by using virtual clocks for faster, reliable results. #Golang #Testing
tech
Go 1.24: 新的官方库 synctest. 在Go语言中,测试并发代码一直是一个具有挑战性的任务。尤其是测试一些需要跟时间相关的case的时候,传统的测试方法通常依赖于真实的系统时钟和同步机制,这会导致测试变得缓慢且容易出现不确定性。 假设我们需要测试 go-cache 的过期删除功能,我们可能会写出这。
tech
【译】“安全是我们的首要任务”--这是一句废话. 原文链接: "Security Is Our Top Priority" is BS 几年前,我被邀请去做一个关于软件安全的会议演讲。其实,我并没有真正被邀请,而是我的公司购买了一个包含演讲席位的赞助包,我回复了一封内部邮件,自愿参与了这个活动 🤣 无论如何。
tech
Previously, I wrote an article about the runtime.SetFinalizer that is used to be called when an object is cleaned up, but some issues with this function cause it to be used less frequently. https://github.com/golang/go/issues/67535 * SetFinalizer must always refer to the first word of
tech
Golang 1.24 introduces `runtime.AddCleanup`, improving upon `runtime.SetFinalizer` by allowing multiple cleanup functions and better handling of object references, thus preventing memory leaks and enabling timely cleanup. #Golang #Go1_24
tech
Go 1.24 introduces the `weak` package for managing memory more flexibly with weak pointers, preventing GC issues. Ideal for caching! 💻✨
tech
Weak 是什么? Golang 在1.24 中带来了一个新的std-lib weak。 可以为*T 创建一个安全的引用,但是不会阻止 *T 被GC 回收。 Package weak provides ways to safely reference memory weakly, that is, without preventing its reclamation. 跟 OS.ROOT 一样, weak 也是一个在其他语言中存在很久的功能,比如: * Java 的 WeakReference 和 SoftReference 是经典实现,主要用于缓存和对象池。它们能够在 JVM 检测到内存不足时自动回收。 * Python 提供了 weakref
tech
Golang 1.24 introduces `os.Root`, enhancing file safety by limiting access to specified directories. This prevents directory traversal vulnerabilities. #GoLang #osRoot