Skip to content

Commit f01ade4

Browse files
Buffered output (#116)
* BufferedOutputRange: Part 1, candidate struct. * buffered-output: Do not use LockingTextWriter in unit test unless version is 2.078+ (Bug LockingTextWriter bug) * Use BufferedOutputRange in: tsv-select, tsv-filter, tsv-sample, number-lines, tsv-append, tsv-uniq, csv2tsv, tsv-join
1 parent e8f1d60 commit f01ade4

13 files changed

Lines changed: 506 additions & 121 deletions

File tree

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ matrix:
2727
language: d
2828
d: ldc-1.2.0
2929
env: DUBTEST=1 MAKETEST=1
30+
if: fork = true
3031
- os: osx
3132
osx_image: xcode9
3233
language: d
3334
d: ldc
3435
env: DUBTEST=1 MAKETEST=1 APPLTO=off
36+
if: fork = true
3537
# - os: osx
3638
# osx_image: xcode9
3739
# language: d
@@ -46,10 +48,12 @@ matrix:
4648
language: d
4749
d: ldc
4850
env: DUBTEST=1 MAKETEST=1 APPLTO=full
51+
if: fork = true
4952
- os: linux
5053
language: d
5154
d: ldc
5255
env: APPLTO=thin ALLLTO=default
56+
if: fork = true
5357
- os: linux
5458
language: d
5559
d: ldc

common/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ _Visit the eBay TSV utilities [main page](../README.md)_
44

55
This directory contains utility functions shared by multiple TSV utility tools. A few that may be of more general interest:
66
* **InputFieldReordering** - A class that creates a reordered subset of fields from an input line. Used to operate on a subset of fields in the order specified on the command line. *File: tsvutils.d*.
7+
* **BufferedOutputRange** - An OutputRange with an internal buffer used to buffer output.
8+
Intended for use with stdout, it is a significant performance benefit. *File: tsvutils.d*.
79
* **quantile** - Calculates a cummulative probability for values in a data set. Supports the same interpolation methods as the quantile function in R and many other statistical packages. *File: tsv_numerics.d*.
810
* **rangeMedian** - Finds the median in a range. Implements via the faster of `std.algorithm.topN` or `std.algorithm.sort` depending on the Phobos version. *File: tsv_numerics.d*.
911
* **formatNumber** - An alternate print format for numbers, especially useful when doubles are being used to represent integer and float values. *File: tsv_numerics.d*.

common/makefile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
include ../makedefs.mk
22

3+
unittest_utils_srcs ?= $(CURDIR)/src/unittest_utils.d
4+
imports ?= -I$(CURDIR)/src
5+
36
release: ;
47
debug: ;
58
codecov: ;
@@ -19,10 +22,10 @@ test: unittest
1922
.PHONY: unittest
2023
unittest:
2124
@echo '---> Running $(notdir $(basename $(CURDIR))) unit tests'
22-
$(DCOMPILER) $(common_srcs) $(unittest_flags) $(CURDIR)/src/tsvutil.d
23-
$(DCOMPILER) $(common_srcs) $(unittest_flags) $(CURDIR)/src/getopt_inorder.d
24-
$(DCOMPILER) $(common_srcs) $(unittest_flags) $(CURDIR)/src/tsv_numerics.d
25-
$(DCOMPILER) $(common_srcs) $(unittest_flags) $(CURDIR)/src/tsvutils_version.d
25+
$(DCOMPILER) $(imports) $(unittest_utils_srcs) $(unittest_flags) $(CURDIR)/src/tsvutil.d
26+
$(DCOMPILER) $(imports) $(unittest_utils_srcs) $(unittest_flags) $(CURDIR)/src/getopt_inorder.d
27+
$(DCOMPILER) $(imports) $(unittest_utils_srcs) $(unittest_flags) $(CURDIR)/src/tsv_numerics.d
28+
$(DCOMPILER) $(imports) $(unittest_utils_srcs) $(unittest_flags) $(CURDIR)/src/tsvutils_version.d
2629
@echo '---> Unit tests completed successfully.'
2730

2831
test-debug: ;
@@ -36,9 +39,10 @@ test-codecov: unittest-codecov
3639
unittest-codecov:
3740
@echo '---> Running $(notdir $(basename $(CURDIR))) unit tests with code coverage.'
3841
-rm ./*.lst
39-
$(DCOMPILER) $(common_srcs) $(unittest_codecov_flags) $(CURDIR)/src/tsvutil.d
40-
$(DCOMPILER) $(common_srcs) $(unittest_codecov_flags) $(CURDIR)/src/getopt_inorder.d
41-
$(DCOMPILER) $(common_srcs) $(unittest_codecov_flags) $(CURDIR)/src/tsv_numerics.d
42+
$(DCOMPILER) $(imports) $(unittest_utils_srcs) $(unittest_codecov_flags) $(CURDIR)/src/tsvutil.d
43+
$(DCOMPILER) $(imports) $(unittest_utils_srcs) $(unittest_codecov_flags) $(CURDIR)/src/getopt_inorder.d
44+
$(DCOMPILER) $(imports) $(unittest_utils_srcs) $(unittest_codecov_flags) $(CURDIR)/src/tsv_numerics.d
45+
$(DCOMPILER) $(imports) $(unittest_utils_srcs) $(unittest_codecov_flags) $(CURDIR)/src/tsvutils_version.d
4246
-rm ./__main.lst
4347
@echo '---> Unit tests completed successfully (code coverage on).'
4448

0 commit comments

Comments
 (0)