mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[jit] Reclaim some binary size. (#68038)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/68038 Replace const std::function& to c10::function_ref because the former uses type erasure and adds 5-10 KB size overhead and adds another level of indirection to call the underlying functions. In contrast a non-owning c10::function_ref will just compile down to a raw function pointer which should be much smaller. ghstack-source-id: 146670523 Test Plan: eyes Reviewed By: iseeyuan, mrshenli Differential Revision: D32264619 fbshipit-source-id: 558538fd882b8e1f4e72c4fd5e9d36d05f301e1e
This commit is contained in:
committed by
Facebook GitHub Bot
parent
dd1121435b
commit
0408449244
@ -307,7 +307,7 @@ struct SchemaParser {
|
||||
int begin,
|
||||
int sep,
|
||||
int end,
|
||||
const std::function<void()>& callback) {
|
||||
c10::function_ref<void()> callback) {
|
||||
auto r = L.cur().range;
|
||||
if (begin != TK_NOTHING)
|
||||
L.expect(begin);
|
||||
|
Reference in New Issue
Block a user