Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use -d:danger --gc:arc for Nim #21

Open
Benjamin-Lee opened this issue Aug 11, 2020 · 4 comments
Open

Use -d:danger --gc:arc for Nim #21

Benjamin-Lee opened this issue Aug 11, 2020 · 4 comments

Comments

@Benjamin-Lee
Copy link

At least for Nim development, the use of the -d:danger flag can dramatically improve speed if you take care when writing your code. I imagine it is likely the case that other languages here have their own optimal configurations. I might be missing it, but I can't see what flags were used during compilation. Is that documented anywhere?

@lh3
Copy link
Owner

lh3 commented Aug 11, 2020

See Makefile in individual directory.

@Benjamin-Lee
Copy link
Author

Completely missed that. Thanks!

@timotheecour
Copy link

timotheecour commented Oct 13, 2020

@lh3 or @Benjamin-Lee could we reopen this issue?

it doesn't use -d:danger:
for eg: https://github.com/lh3/biofast/blob/master/fqcnt/Makefile (ditto with https://github.com/lh3/biofast/blob/master/bedcov/Makefile)

fqcnt_nim1_klib:fqcnt_nim1_klib.nim ../lib/klib.nim
	$(NIM) c -d:release -d:nimEmulateOverflowChecks --bound_checks:off -p:../lib -o:$@ $<

we should rerun the benchmarks for nim with

$(NIM) c -d:danger -p:../lib -o:$@ $<

EDIT

running on a docker container, I get:

nim c  -d:release -d:nimEmulateOverflowChecks --bound_checks:off -o:/tmp/z01 -p:../lib bedcov_nim1_klib.nim
time /tmp/z01 biofast-data-v1/ex-rna.bed biofast-data-v1/ex-anno.bed >/dev/null

8.927s

with s/-d:release -d:nimEmulateOverflowChecks --bound_checks:off/-d:danger/ I get:
6.792s

with -d:danger --passc:-flto I get:
6.383s

with -d:danger --gc:arc I get:
5.90s

interpolating linearly, this would give:
echo 'echo 16.6 / (8.927 / 6.38) ' | nim r -
11.1 instead of 16.6 in this line of https://github.com/lh3/biofast:

bedcov_nim1_klib.nim | Nim | 16.6 | 248.4 | 26.0 | 34.1

@Benjamin-Lee
Copy link
Author

It must have completely slipped my mind when I looked at the makefile. -d:danger --gc:arc is the right way to compile the code. It's what I use every day in my bioinformatics research using Nim.

@Benjamin-Lee Benjamin-Lee changed the title What are the compiler arguments used? Use -d:danger --gc:arc for Nim Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants