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

Make logger faster #57

Open
fengmk2 opened this issue Aug 27, 2016 · 8 comments
Open

Make logger faster #57

fengmk2 opened this issue Aug 27, 2016 · 8 comments

Comments

@fengmk2
Copy link
Member

fengmk2 commented Aug 27, 2016

https://mcollina.github.io/the-cost-of-logging/

@popomore
Copy link
Member

#31

@fengmk2 fengmk2 mentioned this issue Aug 30, 2016
@popomore popomore modified the milestones: 1.0.0, 1.x Jan 13, 2017
@fengmk2
Copy link
Member Author

fengmk2 commented Aug 2, 2017

https://mcollina.github.io/the-cost-of-logging/#41

Secret Sauce(s)

  • Avoid JSON.stringify
  • Date.now() vs new Date().toISOString()
  • %FlattenString (flatstr)
  • fast-safe-stringify
  • quick-format, instead of util.format

@fengmk2
Copy link
Member Author

fengmk2 commented Aug 2, 2017

@fengmk2
Copy link
Member Author

fengmk2 commented Aug 2, 2017

参考 https://github.com/pinojs/pino#benchmarks 来做基准测试

@fengmk2
Copy link
Member Author

fengmk2 commented Aug 4, 2017

https://github.com/fengmk2/pino/tree/egg-logger-benchmark 增加 egg-logger 测试

@fengmk2
Copy link
Member Author

fengmk2 commented Aug 4, 2017

util.format 有性能问题 https://npm.taobao.org/package/quick-format

@hello2dj
Copy link

#653 关闭了,我就来这里了,为啥我们用的会是file而不是fileBuffer的形式呢,是因为,文档里好像没有提到buffer这个配置参数,我也是找了半天才看到的

@popomore
Copy link
Member

默认是 buffer 啊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants