crystal-community / icr

Interactive console for Crystal programming language
MIT License
505 stars 40 forks source link

Add --no-debug flag to improve speed #52

Closed faustinoaq closed 7 years ago

faustinoaq commented 7 years ago

Avoiding debugging info with --no-debug flag, improves compilation speed.

>>> time crystal hi.cr --no-debug
Hi ICR!

real    0m2.068s
user    0m2.327s
sys     0m0.300s
>>> time crystal hi.cr
Hi ICR!

real    0m2.270s
user    0m2.650s
sys     0m0.320s

Is about 200 ms faster with --no-debug flag

faustinoaq commented 7 years ago

@greyblake Why Is Travis failing?

faustinoaq commented 7 years ago

I think that some ms faster is good for an interactive console like ICR. :sweat_smile:

faustinoaq commented 7 years ago

@veelenga @hugoabonizio @greyblake ping :sweat_smile:

veelenga commented 7 years ago

LGTM :)

I think we can merge this. I will try to fix Travis build in a separate PR.

hugoabonizio commented 7 years ago

Same error here. The process hangs on 100% CPU and then dies. Probably related to crystal-lang/crystal#4719.

$ crystal --version
Crystal 0.23.1 [e2a1389] (2017-07-13) LLVM 3.8.1
$ make test
/usr/bin/crystal build --release -o bin/icr src/icr/cli.cr 
crystal: /var/cache/omnibus/src/llvm/llvm-3.8.1.src/lib/CodeGen/LexicalScopes.cpp:160: llvm::LexicalScope* llvm::LexicalScopes::getOrCreateRegularScope(const llvm::DILocalScope*): Assertion `cast<DISubprogram>(Scope)->describes(MF->getFunction())' failed.
/usr/bin/crystal: linha 102:  4359 Abortado                (imagem do núcleo gravada) "$INSTALL_DIR/embedded/bin/crystal" "$@"
Makefile:6: recipe for target 'build' failed
make: *** [build] Error 134

You need to add --no-debug flag to make build too.

 build:
-       $(CRYSTAL_BIN) build --release -o bin/icr src/icr/cli.cr $(CRFLAGS)
+       $(CRYSTAL_BIN) build --release --no-debug -o bin/icr src/icr/cli.cr $(CRFLAGS)
faustinoaq commented 7 years ago

You need to add --no-debug flag to make build too.

Done :+1:

hugoabonizio commented 7 years ago

@faustinoaq thank you! :smile:

greyblake commented 7 years ago

I am here. Looks like you solved it. Nice job! :+1: