Light Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Latest commit

History

History
104 lines (80 loc) * 5.47 KB

CONTRIBUTING.md

File metadata and controls

104 lines (80 loc) * 5.47 KB

Dai Ma Gui Fan

  • Yao Qiu Zun Xun PEP-8 Dan Bu Qiang Zhi Yao Qiu Dan Xing 80 Ge Zi Fu Yi Nei ,Yuan Yin Jian https://lkml.org/lkml/2020/5/29/1038
  • Ri Zhi Ying Shu Chu Dao stderr Huo Wen Jian , Bing Yun Xu Tong Guo Pei Zhi /Xuan Xiang Guan Bi Huo Zhong Ding Xiang
  • Suo You Shu Ru Shu Chu Du Ying Gai Tong Guo Jie Kou Wan Cheng ,Bu Ying print Ping Mu ,Bu Ying Chan Sheng Wen Dang Zhong Mei You Ti Dao De Fu Zuo Yong
  • Bu Ying Gei Yong Hu Liang Xi ,Ren He Ke Neng You Fu Zuo Yong De Cao Zuo Du Ying You Yong Hu Ming Que Xu Ke
  • Jin Liang Bao Chi Jian Rong Xing ,Bu Ying Sui Yi break Ta Ren De Dai Ma

commitGui Fan

Yi Ge Ti Jiao Shuo Ming Ying Dang Bao Han 3Ge Bu Fen :Biao Ti (Bi Xie ,Bao Han Mo Kuai He Zhu Ti ),Zheng Wen (Ke Xuan )He Wei Zhu (Ke Xuan ),San Ge Bu Fen Jian Fen Bie Yong Yi Ge Kong Xing Fen Ge ,Ru Xia Suo Shi :

module: subject

body

footer

Biao Ti

Biao Ti De Ge Shi Wei Mo Kuai Ming Cheng : Zhu Ti ,Mo Wei Bu Jia Biao Dian Fu Hao . Qi Zhong ,Mo Kuai Ming Cheng Wei pyWen Jian Lu Jing ,Zhu Ti Ying Gai Shi Yi Ju Jian Yao De Hua ,Shuo Ming Ben Ci Ti Jiao Zuo Liao Shi Yao .

Zheng Wen

Zheng Wen Shi Ke Xuan Bu Fen . Dang Ti Jiao She Ji De Nei Rong Bi Jiao Fu Za Shi ,Ke Yi Zai Zheng Wen Bu Fen Xiang Xi Miao Shu Ben Ci Ti Jiao "Shi Shi Yao "He "Wei Shi Yao "De Wen Ti . Xie Zheng Wen Shi ,Qing Zhu Yi Yi Xia Wen Ti :

  • Du Zhe Wei Bi Zhun Que Jie Jue De Wen Ti Shi Shi Yao . Ji Shi Wen Ti Zai issue tracker Zhong Yi Jing Xie Ming ,Ye Ying Ba Wen Ti Zai Miao Shu Yi Bian ,Bing Ke Yi Zai Wei Zhu Bu Fen Yin Yong Dui Ying Wen Ti Bian Hao
  • Ru Guo Ni Zuo Liao Guan Jian Xing De Jue Ce ,Bi Ru Xuan Ze Liao Jie Jue Fang An AEr Fei B,Qing Xie Xia Ni Zuo Ci Xuan Ze De Yuan Yin
  • Ru Guo Pan Ding Ti Jiao Dai Ma De Zheng Que Xing ,Xu Yao Yi Lai Mou Xie Xin Xi (Li Ru Gen Ju Jiao Yi Suo De Mou Ye Wu Gui Ze Bian Geng Gong Gao Xiu Gai Suan Fa ,Ze Zhe Ge Gong Gao Nei Rong Jiu Shi Guan Jian Xin Xi ),Zhe Xie Xin Xi You Mei You Xie Ru Dai Ma Zhu Shi Zhong ,Na Yao Ying Gai Zai Zhe Li Xie Ming
  • Ru Guo Ben Ci Ti Jiao Hui Dai Lai Mou Xie Fu Zuo Yong (Bi Ru Xiu Zheng Mou BUG,Dan Hui Shi Nei Cun Zhan Yong Sheng Gao Yi Bei ),Qing Wu Bi Ming Que Xie Chu

Wei Zhu

Wei Zhu Shi Ke Xuan Bu Fen . Zai Wei Zhu Bu Fen ,Biao Ji Yu Ci Ci commit Xiang Guan De issue id, Shi Yong Yi Xia Biao Zhi :

  • fixes: #XXX Jie Jue Liao XXX Suo Ti Ji De Wen Ti
  • see also: #XXX Ben Ci Ti Jiao Yu XXX You Guan

Ti Jiao Shuo Ming Shi Li

https://github.com/golang/go/commit/be64a19d99918c843f8555aad580221207ea35bc

">cmd/compile, cmd/link, runtime: make defers low-cost through inline code and extra funcdata

Generate inline code at defer time to save the args of defer calls to unique
(autotmp) stack slots, and generate inline code at exit time to check which defer
calls were made and make the associated function/method/interface calls. We
remember that a particular defer statement was reached by storing in the deferBits
variable (always stored on the stack). At exit time, we check the bits of the
deferBits variable to determine which defer function calls to make (in reverse
order). These low-cost defers are only used for functions where no defers
appear in loops. In addition, we don't do these low-cost defers if there are too
many defer statements or too many exits in a function (to limit code increase).

When a function uses open-coded defers, we produce extra
FUNCDATA_OpenCodedDeferInfo information that specifies the number of defers, and
for each defer, the stack slots where the closure and associated args have been
stored. The funcdata also includes the location of the deferBits variable.
Therefore, for panics, we can use this funcdata to determine exactly which defers
are active, and call the appropriate functions/methods/closures with the correct
arguments for each active defer.

In order to unwind the stack correctly after a recover(), we need to add an extra
code segment to functions with open-coded defers that simply calls deferreturn()
and returns. This segment is not reachable by the normal function, but is returned
to by the runtime during recovery. We set the liveness information of this
deferreturn() to be the same as the liveness at the first function call during the
last defer exit code (so all return values and all stack slots needed by the defer
calls will be live).

I needed to increase the stackguard constant from 880 to 896, because of a small
amount of new code in deferreturn().

The -N flag disables open-coded defers. '-d defer' prints out the kind of defer
being used at each defer statement (heap-allocated, stack-allocated, or
open-coded).

Cost of defer statement [ go test -run NONE -bench BenchmarkDefer$ runtime ]
With normal (stack-allocated) defers only: 35.4 ns/op
With open-coded defers: 5.6 ns/op
Cost of function call alone (remove defer keyword): 4.4 ns/op

Text size increase (including funcdata) for go binary without/with open-coded defers: 0.09%

The average size increase (including funcdata) for only the functions that use
open-coded defers is 1.1%.

The cost of a panic followed by a recover got noticeably slower, since panic
processing now requires a scan of the stack for open-coded defer frames. This scan
is required, even if no frames are using open-coded defers:

Cost of panic and recover [ go test -run NONE -bench BenchmarkPanicRecover runtime ]
Without open-coded defers: 62.0 ns/op
With open-coded defers: 255 ns/op

A CGO Go-to-C-to-Go benchmark got noticeably faster because of open-coded defers:

CGO Go-to-C-to-Go benchmark [cd misc/cgo/test; go test -run NONE -bench BenchmarkCGoCallback ]
Without open-coded defers: 443 ns/op
With open-coded defers: 347 ns/op

Updates #14939 (defer performance)
Updates #34481 (design doc)

Change-Id: I63b1a60d1ebf28126f55ee9fd7ecffe9cb23d1ff
Reviewed-on: https://go-review.googlesource.com/c/go/+/202340
Reviewed-by: Austin Clements