10000 Interpreter performance · Issue #30 · typeness/intp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Interpreter performance #30

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

Open
typeness opened this issue Dec 9, 2017 · 2 comments
Open

Interpreter performance #30

typeness opened this issue Dec 9, 2017 · 2 comments

Comments

@typeness
Copy link
Owner
typeness commented Dec 9, 2017

I compared it with C++ and Python. Although slow it's not that bad. Only ~3.4 times slower than Python default interpreter.

Intp (0.1.2)

time java -jar intp-0.1.2.jar test.intp 

real	0m20.845s
user	0m21.236s
sys	0m0.260s

i = 0
while (i < 10000) {
  j = 0
  while (j < 10000) {
    j = j + 1
  }
  i = i + 1
}

Python (2.7.6)

time python test.py

real	0m6.061s
user	0m6.028s
sys	0m0.036s
i = 0
while (i < 10000):
    j = 0
    while (j < 10000):
        j = j + 1
    i = i + 1

C++ (clang version 3.4)

clang++ test.cpp -o test -std=c++11 -O0
time ./test

real	0m0.241s
user	0m0.240s
sys	0m0.000s



int main() {
  int i = 0;
  while (i < 10000) {
    int j = 0;
    while (j < 10000) {
      j = j + 1;
    }
    i = i + 1;
  }
  return 0;
}
@typeness
Copy link
Owner Author

@typeness
Copy link
Owner Author

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

1 participant
0