- Enable the DScanner check
In the .dscanner.ini
, set the immutable check to enable
:
could_be_immutable_check="enabled"
- Generate a file with all Dscanner warnings
> ldc -O5 -release -boundscheck=off walkBack.d && ./walkBack | |
walkBack.foreach = 3 secs, 772 ms, 463 μs, and 6 hnsecs | |
walkBack.while = 4 secs, 191 ms, 417 μs, and 8 hnsecs |
In the .dscanner.ini
, set the immutable check to enable
:
could_be_immutable_check="enabled"
> dmd -release -O test.d && ./test | |
extremum.before = 54 secs, 12 ms, 347 μs, and 9 hnsecs | |
extremum.after = 29 secs, 521 ms, 896 μs, and 5 hnsecs | |
> ldc -release -O3 test.d && ./test | |
extremum.before = 13 secs, 186 ms, 176 μs, and 4 hnsecs | |
extremum.after = 2 secs, 241 ms, 454 μs, and 9 hnsecs |
#!/usr/bin/env rdmd | |
import std.algorithm, std.array, std.conv, std.mmfile, std.range, std.stdio, std.bigint; | |
void main(string[] args) | |
{ | |
if (args.length < 2) | |
{ | |
writeln("No input file given."); | |
return; |
#!/usr/bin/env dub | |
/++ dub.sdl: | |
name "filter" | |
dependency "inifiled" version="~>1.0.1" | |
dependency "dscanner" version="~>0.4.0" | |
+/ | |
import analysis.config; | |
import dparse.lexer : StringCache; | |
import dsymbol.modulecache : ModuleCache; |
DMD=bin/dmd2/linux/bin64/dmd | |
DMD_VERSION=2.074.0 | |
LDC=bin/ldc2-$(LDC_VERSION)-linux-$(PLATFORM)/bin/ldc2 | |
LDC_VERSION=1.2.0 | |
DFLAGS=-g | |
PLATFORM=x86_64 | |
################################################################################ | |
# Auto-bootstrap DMD & LDC for outdated Debian/Ubuntu | |
################################################################################ |
module | bare import time |
---|---|
std.regex | 1.04s |
std.net.curl | 0.29s |
std.zip | 0.19s |
std.path | 0.15s |
std.socket | 0.15s |
std.file | 0.14s |
std.mmfile | 0.14s |
std.datetime | 0.14s |