This is a creation in
Article, where the information may have evolved or changed.
Performance optimization is an eternal topic, and many times when we are doing performance optimization, often based on the intuition on the code, all can think of optimization has been optimized again, good over any small optimization point, the result of the logic of the entire code becomes extremely complex, and
Some of the characteristics and advantages of the process I will not say, many articles on the Internet are very thorough.
The
process can be understood as a purely user-state thread, which is switched through collaboration rather than preemption. With respect to the process or thread, all operations of the coprocessor can be done in the user state, creating and switching the consumption lower. Developers can use the synchronous code writing method to achieve the effect and
This is a creation in
Article, where the information may have evolved or changed.
Editor's note: This is Yang Wuming on February 27 in the Gopher Beijing party speech based on the finishing. Reprint please indicate from the highly available architecture public number "archnotes".
Yang Wuming, chief architect of Panda TV, has served as the head of PC online gaming technology architectur
Connection: http://www.oschina.net/question/29420_138135 See a blog post about Golang and PHP performance comparison, here to reply.The results of this test are clearly misleading. 1,php The Opcache is not turned on, read the disk file every time. and compile php for opcode. Performance naturally will be poor, open opcache try it. 2, Php+redis must be extended
This is a creation in
Article, where the information may have evolved or changed.
Golang provides us with a very convenient performance testing tool pprof, which makes it easy to monitor the running efficiency of the GO program with Pprof. This article describes how to use PPROF to perform performance testing on the Go program and use Qcachegrind to view the outp
/opBenchmarkUnMarshalCodecJsonWithBufio-4 500000 3417 ns/opBenchmarkUnMarshalJsonparser-4 2000000 877 ns/opFrom the above results can be seen:
Easyjson both serialization and deserialization are optimal, serialization is 1 time times higher and deserialization is 3 times times higher
Jsoniter performance is also very good, close to Easyjson, the key is no pre-compilation process, 100% compatible nat
This is a creation in
Article, where the information may have evolved or changed.
Connection: http://www.oschina.net/question/29420_138135
See a blog post about Golang and PHP performance comparison, here to reply.The results of this test are clearly misleading.
1,php The Opcache is not turned on, read the disk file every time. and compile php for opcode. Performance
, the JVM will have a more than normal partition when calculating the memory footprint of the heap internal partitions (perm, new, old). In the worst case scenario, a zone occupies more than one page size. However, subsequent JVM versions are also adjusting this strategy.
In general, it is not recommended to adjust the page size too large, 4-64m, is acceptable (default is 4M). To set this value reasonably, you should do a benchmark on your system.To t
This is a created
article in which the information may have evolved or changed.
Golang Performance Test package is located under the Net/http package of Pprof, the relevant introduction can refer to the specific official documents
The Golang performance test is particularly easy to use, with the introduction of the
Golang Map is a convenient operation for Golang Key-valuePackage Mainimport ("FMT" "Math/rand" "Time" _ "StrConv") var x = Make (Map[int]int, 100000001)//var x = Make (map[string] String, 100000001) Func main () {ttime: = time. Now (). Unixnano ()//x: = Make (Map[int]int, 100000001)//x: = [100000001]int{}fmt.Printf ("Len x%d \ n", Len (x)) for I: = 1;i Summarize:1, test results make (Map[int]int, 1.0,000,00
, sqlstmt)return } //CREATE INDEX, index and no index performance difference is huge, is not a magnitude, interested can be removed try_, Err = db. Exec ("CREATE INDEX Inx_c_code on BC (C_code);") ifErr! =Nil {fmt. Println ("CREATE INDEX Error->%q:%s\n", err, sqlstmt)return } //Write 10M recordStart: =Time . Now (). Unix () TX, err:=db. Begin ()ifErr! =Nil {fmt. Println ("%q", Err)} stmt, err:= Tx. Prepare ("INSERT into BC (B_code, C_co
This is a creation in
Article, where the information may have evolved or changed.
Go official should be more recommended to use ChanHttps://github.com/golang/go/wiki/MutexOrChannel
The following code is used to test performance-not to make sure that the idea is correct.
PackageMainImport("FMT" "Sync" "Time")typeOpstruct{KeyintValint}varLock sync. MutexvarM1Map[int]intvarM2Map[int]intvarMaxint=50000fu
Why analyze the performance of GOB serialization formats
I made it up. A one-way synchronization software (Https://gitee.com/rocket049/mysync), mixed RPC and HTTP server functions, the use of RPC control functions, HTTP data upload. Recently, I intentionally simplified its construction, the HTTP upload function is also implemented in the RPC way. But I worry about the performance degradation, because the us
This is a creation in
Article, where the information may have evolved or changed.
Performance comparison
Insert 10 million records to compare memory usage size and insertion time.
Test machine configuration
Intel (R) Core (TM) i3-4000m CPU @2.40ghz 2.40GHz
12.0GB Memory
Front-facing conditions
Go, avoid the memory copy when expanding capacity, the size of the initialization volume is 13333333. Make (map[int]int,13333333)
Java, avoid memory copy when e
This is a creation in
Article, where the information may have evolved or changed.
> article is mainly for reference * * Rain SCAR Academy (subscription number) * * and other netizens blog and then according to their own understanding of the collation. # # string and []byte mutual conversion in the process of writing a program often encounter string and []byte conversion, but this conversion is a cost, string and []byte does not share the underlying memory space, so each conversion is accompanied
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.