Граф коммитов

11 Коммитов

Автор SHA1 Сообщение Дата
xichengliudui faf4628b02 Use the import () way
Signed-off-by: xichengliudui <liuduidui@beyondcent.com>
2019-02-12 13:26:59 -05:00
Sugu Sougoumarane f556698dfb perf: Optimize byte operations
Issue #2849

It turns out that the lion's share of the time was consumed
by byte-by-byte operations. There were two factors:
1. Calling panic in a function somehow makes it more expensive.
2. Calling a function through an interface also adds up.

This PR makes spot improvements to address two cases:
1. The tokenizer was calling bytes.Buffer.WriteByte for every byte
   of the input query.
2. The EncodeSQL function in sqltypes.Value was calling
   a wrapper (that had a panic), which in turn called
   buffer.WriteByte.

I've now written a bytes2.Buffer package that implements a subset
of bytes.Buffer, but more efficiently.

Resulting improvements:

VTGate New:
BenchmarkWithNormalizer-4            300           5694660 ns/op
VTGate Old:
BenchmarkWithNormalizer-4            100          10927765 ns/op

VTTablet New:
BenchmarkExecuteVarBinary-4          300           4751125 ns/op
VTTablet Old:
BenchmarkExecuteVarBinary-4          100          14888528 ns/op

These numbers can further be improved as mentioned in the issue.
But the work to get to the next level is more involved.
2017-06-27 15:35:41 -07:00
Alain Jobart 39eeaecca0 Removing 2 unused libraries. 2017-03-23 12:52:14 -07:00
Anthony Yeh a91d8823ad Add or fix package comments for reusable packages. 2014-09-24 14:35:23 -07:00
Sugu Sougoumarane 064d69300d go vet cleanup 2013-12-24 15:24:45 -08:00
Ryszard Szopa c34450c6f7 Run go fmt after the initial code.google.com -> github import. 2013-07-19 18:34:43 -07:00
Ryszard Szopa 0d046a5984 Replace code.google.com with github.com/youtube/vitess. 2013-07-18 18:18:20 -07:00
Alain Jobart dc08f7958f Fixing tabletserver unit test to pass.
LGTM from Sugu.
2012-08-17 11:23:59 -07:00
Ric Szopa 02115e7048 Change the license notice to be shorter and refer to the license file. 2012-06-07 11:55:06 -07:00
Sugu Sougoumarane d2aaa44e35 perf bug fix: Reinitialze chunked buffer on reset so previous memory gets garbage collected. 2012-05-04 17:02:58 -07:00
Sugu Sougoumarane e71dcfe7c8 optimization stagte2: chunked writer for bson 2012-04-25 13:40:45 -07:00