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

Interpereter performance is too low #12609

Open
acodervic opened this issue Oct 14, 2022 · 7 comments
Open

Interpereter performance is too low #12609

acodervic opened this issue Oct 14, 2022 · 7 comments

Comments

@acodervic
Copy link

acodervic commented Oct 14, 2022

Bug Report

Interpereter performance is too low , less then 50%-70% of native build .

target app srouce code at https://github.com/NeuraLegion/wafalyzer.

when i it running with native build , it only took 6 s . but it runing with interperter took 5 minutes !. this is unacceptable during actual debugging
the http://127.0.0.1 is my local apache2 server . it just provides a empty page .

os : ubuntu20 Linux 5.13.0-51-generic #58~20.04.1-Ubuntu SMP Tue Jun 14 11:29:12 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Crystal:Using Crystal 1.6.0 (2022-10-06)
LLVM: 10.0.0 Default target: x86_64-pc-linux-gnu

xxxx@xxxx-F117-V:~/Downloads/xxxx/wafalyzer-master/wafalyzer-master$ time /home/w/Documents/localgitserver/crystal/bin/crystal     src/cli.cr  http://127.0.0.1
Using compiled compiler at /home/xxxx/Documents/localgitserver/crystal/.build/crystal

No WAF detected

real    0m6.682s 
user    0m6.474s
sys     0m0.562s

xxxx@xxxx-F117-V:~/Downloads/xxxx/wafalyzer-master/wafalyzer-master$ time /home/xxxx/Documents/localgitserver/crystal/bin/crystal     i src/cli.cr  http://127.0.0.1
Using compiled compiler at /home/xxxx/Documents/localgitserver/crystal/.build/crystal

No WAF detected

real    4m45.937s
user    4m45.578s
sys     0m0.294s

thank for crystal team . please fix this . this is very important for every developer !

@asterite
Copy link
Member

Did you compile the interpreter in release mode?

@asterite
Copy link
Member

I also don't understand why why you need the performance. When you debug something you don't need to run the full program.

@Fryguy
Copy link
Contributor

Fryguy commented Oct 14, 2022

The purpose of the interpreter is that you are trading compilation time for execution time so that you can quickly start and step through your code for debugging purposes. By definition the code will run slower, however the debug/edit loop is significantly faster in human time.

@beta-ziliani
Copy link
Member

Hi @acodervic , thanks for reporting, but we're still far from the point in which optimizing the interpreter is a good use of resources. We still need to work on to make it accessible to most platforms, and to polish its rough edges. Speed is a nice to have feature at this point.

@asterite
Copy link
Member

I think @straight-shoota suggested somewhere to do make interpreter=1 to have the interpreter, but I can't remember where. It should include release=1 as it makes a huge difference.

@acodervic
Copy link
Author

Hi @acodervic , thanks for reporting, but we're still far from the point in which optimizing the interpreter is a good use of resources. We still need to work on to make it accessible to most platforms, and to polish its rough edges. Speed is a nice to have feature at this point.

ok , thank for you anser.

@asterite
Copy link
Member

@acodervic are you using the interpreter compiled in release mode? It would save us all a discussion 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants