diff options
author | Fabricio Voznika <fvoznika@google.com> | 2019-04-23 16:24:51 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-04-23 16:26:10 -0700 |
commit | db334f7154a1d4beedd8bd418a88c3f043ebe173 (patch) | |
tree | 7660076088bd6a52b6b75674f62a2491c1fb55ab /pkg/p9/transport_test.go | |
parent | 908edee04f92055a8c53a63d1b8d57ffe56aa682 (diff) |
Remove reflection from 9P serving path
p9.messageByType was taking 7% of p9.recv before, spending time
with reflection and map lookup. Now it's reduced to 1%.
PiperOrigin-RevId: 244947313
Change-Id: I42813f920557b7656f8b29157eb32acd79e11fa5
Diffstat (limited to 'pkg/p9/transport_test.go')
-rw-r--r-- | pkg/p9/transport_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/p9/transport_test.go b/pkg/p9/transport_test.go index 3352a5205..b7b7825bd 100644 --- a/pkg/p9/transport_test.go +++ b/pkg/p9/transport_test.go @@ -180,5 +180,5 @@ func TestSendClosed(t *testing.T) { } func init() { - register(&badDecode{}) + register(MsgTypeBadDecode, func() message { return &badDecode{} }) } |