Open kabra1110 opened 1 year ago
Most of this time is spent in list assignment.
Great catch. Let's investigate this and fix it.
The results are different from mine on Apple M1 2020. See:
% time lpython b.py
lpython b.py 36.32s user 0.77s system 99% cpu 37.266 total
% time lpython b.py --fast
lpython b.py --fast 5.73s user 0.09s system 98% cpu 5.935 total
It turns out that this issue exists on Linux. It takes more time to execute with the --fast
option.
--fast
(base) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py --time-report
File reading: 0.395267ms
Parsing: 7.09136ms
AST to ASR: 7.12419ms
ASR to LLVM: 102.906ms
LLVM to binary: 9285.17ms
--fast
(base) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py --fast --time-report
File reading: 0.342711ms
Parsing: 5.22279ms
AST to ASR: 5.70584ms
ASR to LLVM: 1568.22ms
LLVM to binary: 23837.7ms
As is conveyed by the time-report, all the excess time is spent in the back-end.
l
is shuffledlist(range(total))