Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

supply FastInvoker interface for reduce the function call memory cons… #1

Merged
merged 2 commits into from
Jun 27, 2016

Conversation

tupunco
Copy link
Contributor

@tupunco tupunco commented Jun 4, 2016

inject.Invoke() 实现中 reflect.ValueOf(f).Call(in) 调用会消耗大量内存, 在 长连接 的请求中会导致大量内存占用, 影响服务器性能. 现在提供一个 显式FastInvoke 接口, 对于特定的 Handler 提供一个直接 显式调用函数 的实现, 来减少内存消耗, Invoke() 执行速度上也有大概 1/3 的提升.
本次 PRinject/macaron/sockets 几个项目都做了修改和整合.

@@ -50,6 +50,20 @@ type Invoker interface {
Invoke(interface{}) ([]reflect.Value, error)
}

// FastInvoker represents an interface for fast calling functions external function.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这句注释是不是有语病?

@tupunco
Copy link
Contributor Author

tupunco commented Jun 13, 2016

注释更新了, 英语不是太好, 请见谅.

@unknwon
Copy link
Contributor

unknwon commented Jun 27, 2016

没事。。这个改动有点厉害,我需要仔细研究研究。。

@unknwon unknwon merged commit 68308a8 into go-macaron:master Jun 27, 2016
unknwon added a commit that referenced this pull request Jun 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants