golang php mysql性能_golang vs dlang vs nodejs vs php 性能对比较量

在单核1G内存的Hyper-V虚拟机上,对比了Go 1.5.1, DLang(LDC 0.15.0), Node.js 4.2.2 和 PHP 5.6.14 的HTTP服务器性能。通过ApacheBench测试工具,以并发1000请求进行10000次请求测试。结果显示,DLang的性能最佳,其次是Go,然后是PHP,最差的是Node.js。" 134259410,7337247,框架设计与性能优化:原理、算法与实战,"['架构设计', 'Java', 'Python', '大数据', '算法']
摘要由CSDN通过智能技术生成

这是我本机开的一个单核1G内存的Hyper-V虚拟机,首先我们使用的语言和框架版本给大家看一下:

root@kerisy:/home/zoujiaqing# go version

go version go1.5.1 linux/amd64

root@kerisy:/home/zoujiaqing# ldc2 --version

LDC - the LLVM D compiler (0.15.0):

based on DMD v2.066.1 and LLVM 3.5.0

Default target: x86_64-pc-linux-gnu

Host CPU: core-avx2

http://dlang.org - http://wiki.dlang.org/LDC

Registered Targets:

aarch64    - AArch64 (little endian)

aarch64_be - AArch64 (big endian)

arm        - ARM

arm64      - AArch64 (little endian)

arm64_be   - AArch64 (big endian)

armeb      - ARM (big endian)

cpp        - C++ backend

hexagon    - Hexagon

mips       - Mips

mips64     - Mips64 [experimental]

mips64el   - Mips64el [experimental]

mipsel     - Mipsel

msp430     - MSP430 [experimental]

nvptx      - NVIDIA PTX 32-bit

nvptx64    - NVIDIA PTX 64-bit

ppc32      - PowerPC 32

ppc64      - PowerPC 64

ppc64le    - PowerPC 64 LE

r600       - AMD GPUs HD2XXX-HD6XXX

sparc      - Sparc

sparcv9    - Sparc V9

systemz    - SystemZ

thumb      - Thumb

thumbeb    - Thumb (big endian)

x86        - 32-bit X86: Pentium-Pro and above

x86-64     - 64-bit X86: EM64T and AMD64

xcore      - XCore

root@kerisy:/home/zoujiaqing# nodejs

nodejs

root@kerisy:/home/zoujiaqing# nodejs --version

v4.2.2

root@kerisy:/home/zoujiaqing# php --version

PHP 5.6.14-1 (cli)

Copyright (c) 1997-2015 The PHP Group

Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies

可以看到对应的版本:

golang: 1.5.1

dlang(ldc2): 2.066.1

nodejs: 4.2.2

php: 4.6.14

golang代码:

package main

import (

"io"

"net/http"

"log"

)

func HelloServer(w http.ResponseWriter, req *http.Request) {

io.WriteString(w, "hello, world!\n")

}

func main() {

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值