Skip to content

Commit

Permalink
Optimize the compiler options when using DMD.
Browse files Browse the repository at this point in the history
  • Loading branch information
jondegenhardt committed May 9, 2016
1 parent 9f6cc05 commit 9f3a56e
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion BUILD_COMMANDS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build commands

Using the make system is preferred if make runs on your system. Simply running `make` from the top-level will build the release executables. However, if `make` isn't available, the individual build commands are easy enough to run manually. The commands below are the same issued by the make system. Replace ${DCOMPILER} with the compiler being used, e.g. `dmd` or `ldc2`.
Using the make system is preferred if make runs on your system. Simply running `make` from the top-level will build the release executables. However, if `make` isn't available, the individual build commands are easy enough to run manually. The commands below are the same issued by the make system. Replace ${DCOMPILER} with the compiler being used, e.g. `dmd` or `ldc2`. If using `dmd`, performance can be improved further by adding the `-inline` switch to the compiler line.

## number-lines

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Sometimes you have a CSV file. This program does what you expect: convert CSV da
$ csv2tsv data.csv > data.tsv
```

See the [csv2tsv reference](#csv2tsv-program) section for details.
CSV files come in different formats. See the [csv2tsv reference](#csv2tsv-program) for details of how this tool operates and the format variations handled.

### number-lines

Expand Down
2 changes: 1 addition & 1 deletion csv2tsv/dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"buildTypes": {
"debug": { "buildOptions": ["debugMode", "optimize"] },
"release": { "buildOptions": ["releaseMode", "optimize"], "dflags": ["-boundscheck=off"] },
"release": { "buildOptions": ["releaseMode", "optimize", "inline"], "dflags": ["-boundscheck=off"] },
"unittest" : { "buildOptions": ["unittests"] }
}
}
2 changes: 1 addition & 1 deletion dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
],
"buildTypes": {
"debug": { "buildOptions": ["debugMode", "optimize"] },
"release": { "buildOptions": ["releaseMode", "optimize"], "dflags": ["-boundscheck=off"] }
"release": { "buildOptions": ["releaseMode", "optimize", "inline"], "dflags": ["-boundscheck=off"] }
}
}
7 changes: 6 additions & 1 deletion makedefs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ objdir = obj
bindir = bin
testsdir = tests

release_flags_base = -release -O -boundscheck=off
ifeq ($(DCOMPILER),dmd)
release_flags_base = -release -O -boundscheck=off -inline
endif

debug_flags = -od$(objdir) $(DFLAGS)
release_flags = -release -O -boundscheck=off -od$(objdir) $(DFLAGS)
release_flags = $(release_flags_base) -od$(objdir) $(DFLAGS)
unittest_flags = $(DFLAGS) -unittest -main -run
2 changes: 1 addition & 1 deletion number-lines/dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
],
"buildTypes": {
"debug": { "buildOptions": ["debugMode", "optimize"] },
"release": { "buildOptions": ["releaseMode", "optimize"], "dflags": ["-boundscheck=off"] }
"release": { "buildOptions": ["releaseMode", "optimize", "inline"], "dflags": ["-boundscheck=off"] }
}
}
2 changes: 1 addition & 1 deletion tsv-filter/dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
],
"buildTypes": {
"debug": { "buildOptions": ["debugMode", "optimize"] },
"release": { "buildOptions": ["releaseMode", "optimize"], "dflags": ["-boundscheck=off"] }
"release": { "buildOptions": ["releaseMode", "optimize", "inline"], "dflags": ["-boundscheck=off"] }
}
}
2 changes: 1 addition & 1 deletion tsv-join/dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
],
"buildTypes": {
"debug": { "buildOptions": ["debugMode", "optimize"] },
"release": { "buildOptions": ["releaseMode", "optimize"], "dflags": ["-boundscheck=off"] }
"release": { "buildOptions": ["releaseMode", "optimize", "inline"], "dflags": ["-boundscheck=off"] }
}
}
2 changes: 1 addition & 1 deletion tsv-select/dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
],
"buildTypes": {
"debug": { "buildOptions": ["debugMode", "optimize"] },
"release": { "buildOptions": ["releaseMode", "optimize"], "dflags": ["-boundscheck=off"] }
"release": { "buildOptions": ["releaseMode", "optimize", "inline"], "dflags": ["-boundscheck=off"] }
}
}
2 changes: 1 addition & 1 deletion tsv-uniq/dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
],
"buildTypes": {
"debug": { "buildOptions": ["debugMode", "optimize"] },
"release": { "buildOptions": ["releaseMode", "optimize"], "dflags": ["-boundscheck=off"] }
"release": { "buildOptions": ["releaseMode", "optimize", "inline"], "dflags": ["-boundscheck=off"] }
}
}

0 comments on commit 9f3a56e

Please sign in to comment.