Skip to content

Native performance is terrible with Python #350

Closed
@jasonzhengbj

Description

@jasonzhengbj

I used docker image ghcr.io/graalvm/graalvm-community (tag: 20.0.2-ol7-20230725) and install GraalPy 3.10.8 (GraalVM CE Native 23.0.1).
I use simple code to test native performance. standalone application performance is slower.

Pythn code:

import datetime

if __name__ == '__main__':
    print(datetime.datetime.now())
    s = 0
    loop = 500
    for i in range(loop):
         for j in range(loop):
             for k in range(loop):
                s += 1
    print(f'loop: {s}')
    print(datetime.datetime.now())
    

graalpy spend time about 1.5s.

sh-4.2# graalpy loop.py
2023-08-07 09:01:32.211000
loop: 125000000
2023-08-07 09:01:33.708000

native spend time about 6.5s.

sh-4.2# graalpy -m standalone binary   --module loop.py  --output loop 
sh-4.2# ./loop
2023-08-07 09:39:43.672000
loop: 125000000
2023-08-07 09:39:50.213000

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions