diff options
author | Nicolas Lacasse <nlacasse@google.com> | 2019-02-08 15:53:16 -0800 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-02-08 15:54:15 -0800 |
commit | f17692d8074787d058dc33cc95587b15dba3b161 (patch) | |
tree | 7707a44413166b801637e497d04d25aae1b2ab96 /pkg/tcpip | |
parent | e884168e1ea5cd8be4d50c85a4ad4fbcdaca1e5c (diff) |
Add fs.AsyncWithContext and call it in fs/gofer/inodeOperations.Release.
fs/gofer/inodeOperations.Release does some asynchronous work. Previously it
was calling fs.Async with an anonymous function, which caused the function to
be allocated on the heap. Because Release is relatively hot, this results in a
lot of small allocations and increased GC pressure, noticeable in perf profiles.
This CL adds a new function, AsyncWithContext, which is just like Async, but
passes a context to the async function. It avoids the need for an extra
anonymous function in fs/gofer/inodeOperations.Release. The Async function
itself still requires a single anonymous function.
PiperOrigin-RevId: 233141763
Change-Id: I1dce4a883a7be9a8a5b884db01e654655f16d19c
Diffstat (limited to 'pkg/tcpip')
0 files changed, 0 insertions, 0 deletions