Commit Graph

17 Commits

Author SHA1 Message Date
8a8affba81 Optimizations for StdWriter
Avoids allocations and copying by using a buffer pool for intermediate
writes.

```
benchmark            old ns/op     new ns/op     delta
BenchmarkWrite-8     996           175           -82.43%

benchmark            old MB/s     new MB/s     speedup
BenchmarkWrite-8     4414.48      25069.46     5.68x

benchmark            old allocs     new allocs     delta
BenchmarkWrite-8     2              0              -100.00%

benchmark            old bytes     new bytes     delta
BenchmarkWrite-8     4616          0             -100.00%
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 2f3b6022858aab2d70e380d126e6dcec227c0d38
Component: engine
2016-03-25 22:14:27 -04:00
84d241709b Make stdcopy.stdWriter goroutine safe.
Stop using global variables as prefixes to inject the writer header.
That can cause issues when two writers set the length of the buffer in
the same header concurrently.

Stop Writing to the internal buffer twice for each write. This could
mess up with the ordering information is written.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 443a5c20216b5331b1bb57796140c0178ca44b7d
Component: engine
2016-02-26 16:51:18 -05:00
f62b97e499 Fix some typos in comments and strings
Most of them were found and fixed by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Upstream-commit: 2eee613326fb59fd168849618d14a9054a40f9f5
Component: engine
2016-02-22 20:27:15 +01:00
99b625a04e Added test coverage to StdCopy closes #11584
Some corner cases and error conditions are covered while reading
and writing

Signed-off-by: Federico Gimenez <fgimenez@coit.es>
Upstream-commit: 2368d2366594267307d9429d3d83e1829018674e
Component: engine
2015-09-25 11:15:45 +02:00
7bd0a812b0 Add StdCopy happy path test: both reading and writing
Signed-off-by: Sergey Evstifeev <sergey.evstifeev@gmail.com>
Upstream-commit: 6335c90d4a0536bf625ec6e77b4a0040f877d133
Component: engine
2015-09-23 17:27:32 +02:00
e0aff7f6e3 Added tests for StdWriter.Write.
The tests added cover the case when the Writer field returns and error
and, related to that, when the number of written bytes is less than 0.

Signed-off-by: Federico Gimenez <fgimenez@coit.es>
Upstream-commit: 3efe5ff22e7bf3264f653c7f7772c64771210afe
Component: engine
2015-09-22 09:05:22 +02:00
5e176c5f47 fix golint warnings/errors on pkg/system and pkg/stdcopy
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 7e420ad8502089e66ce0ade92bf70574f894f287
Component: engine
2015-08-13 18:47:13 +08:00
2c6e673ce7 typofix - https://github.com/vlajos/misspell_fixer
Signed-off-by: Veres Lajos <vlajos@gmail.com>
Upstream-commit: 514623272398574c8fd7ef3fe42c5b2ae161349a
Component: engine
2015-08-07 23:25:49 +01:00
decc5d5340 Fix Typo in stdcopy.go
Signed-off-by: Yu Chengxia <yuchengxia@huawei.com>
Upstream-commit: 16be453e0f3827278427f33bbec110e0fabbc17f
Component: engine
2015-06-24 15:00:14 +08:00
17684bee7e Add some stdcopy_test (coverage)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 2ed4ed50be3a0379d83b9267f62c4c7f665b849f
Component: engine
2015-04-20 22:58:22 +02:00
34cad7f622 correct pkg/stdcopy NewStdWriter function comments
pkg/stdcopy NewStdWriter function has wrong doc comment,
utils is not correct, it should be stdcopy

Signed-off-by: Deshi Xiao <xiaods@gmail.com>
Upstream-commit: a715b0e31beabed9ac5702af2ede619b4232cbdb
Component: engine
2015-04-13 17:21:27 +08:00
e5b36a723c Replace aliased imports of logrus, fixes #11762
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 6f4d847046cb4e072de61d042c0266190d73a8c9
Component: engine
2015-03-26 23:22:04 +01:00
5506a9a27c Remove subdirectories MAINTAINERS files
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 89bdaa35e04b74b7c6528783e0f7b8154b2a3d31
Component: engine
2015-03-06 18:21:51 -08:00
2d56e3cbc6 Use logrus everywhere for logging
Fixed #8761

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 7c62cee51edc91634046b4faa6c6f1841cd53ec1
Component: engine
2014-10-24 15:03:06 -07:00
995ea10dab Benchmark for StdWriter.Write
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 55cac6c9421702ca1e42b3e3f92266e865a5c769
Component: engine
2014-09-17 19:24:07 +04:00
1aa081f9b0 stdcopy: improve perf by avoiding buffer growth
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 277aa9c67415b9b76ab17daea583b51f8560a6a5
Component: engine
2014-09-17 18:06:17 +03:00
ba4bc005be move stdcopy to pkg/stdcopy
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 1f03e60c2a96a92acae0e4d2fd604ab2c6d55473
Component: engine
2014-09-17 18:06:17 +03:00