通过浏览器更新SVN
简单脚本实现通过浏览器更新SVN。 1234567header("Cache-Control:no-cache,must-revalidate"); $handle = popen('export LC_CTYPE=en_US.UTF-8 && /usr/bin/svn up --username user_test --password pass_test...
View Article[转]How to write benchmarks in Go
This post continues a series on the testing package I started a few weeks back. You can read the previous article on writing table driven tests here. You can find the code mentioned below in the...
View Article[转]The Go scheduler
One of the big features for Go 1.1 is the new scheduler, contributed by Dmitry Vyukov. The new scheduler has given a dramatic increase in performance for parallel Go programs and with nothing better to...
View Article[转]GC学习笔记
这是我公司同事的GC学习笔记,写得蛮详细的,由浅入深,循序渐进,让人一看就懂,特转到这里。 一、GC特性以及各种GC的选择 1、垃圾回收器的特性 2、对垃圾回收器的选择 2.1 连续 VS. 并行 2.2 并发 VS. stop-the-world 2.3 压缩 VS. 不压缩 VS. 复制 二、GC性能指标 三、分代回收 四、J2SE 5.0的HotSpot JVM上的GC学习 –...
View ArticleGolang 使用心得-正确关闭channel
相信很多同学都是因为Golang有相当简单的并发模型才转过来的。Golang的并发模型主要由三部分构成:Goroutine、Channel和Select。 其中Channel是Goroutine之间通信的桥梁,简单优雅的解决了并行开发中的同步问题。 但是初学者(比如我)通常会遇到 send on closed...
View Article[转]How does the Go runtime work?
(This answer is for the Go compiler from golang.org. It is not about gccgo.) The Go runtime is a Go package, which appears (in the documentation, the build process, the things it exports) to be like...
View Article分享自己用Golang写的一个Web bench 工具
最近一直在学习Golang,业余时间开了个Web bench 工具awb,awb是another web bench的缩写,基本功能已完成,兼容ab的参数。 初步测试并发性比ab要好一些。感觉Golang除了在服务端开发方面有很大的优势以外,在写各类工具方面也是挺方便顺手的。估计未来会有很多写的运维工具使用Golang 编写。...
View ArticleGolang多版本共存方案
如果你是一个狂热的Golang爱好者,也许你会同时使用两个或两个以上的Golang版本。那么这时候怎么实现呢? 这里提供一个Russ cox的方案。这个方案是在Google Group里看到的,但是我现在已经找不到具体是哪个链接了。 12345#file:/usr/bin/go1.4 #!/bin/bash export GOROOT=$HOME/go1.4 export...
View Article[转]Inside NGINX: How We Designed for Performance & Scale
NGINX leads the pack in web performance, and it’s all due to the way the software is designed. Whereas many web servers and application servers use a simple threaded or process-based architecture,...
View ArticleGolang中空字符表示
空字符(Null character)又称结束符,缩写NUL,是一个数值为0的控制字符。在C语言中空字符用来表示字符串的结束。 在C语言中也可以直接插入空字符: 12345#include <stdio.h> int main(void) { puts("hello\0world"); } 但是在Go中,类似的代码是不行的: 123456package main import...
View Article