Performance Issue
- Dominant language
- C
- Stars
- 20.5k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
Hello I was suggested to open a issue from your twitter.
So tried to compile the same C++ code on my macbookpro and iSH. And it turns out the speed to run an executable it's 10-500x slower.
If the code is very simple the difference could be only 10x. For example this one:
```
#include
#include
#include
int main() {
int size = 1000000;
double array[size];
std::clock_t t1 = std::clock();
for (int i = 0; i < size; ++i) {
array[i] = std::rand();
}
std::clock_t t2 = std::clock();
std::cout << float(t2 - t1) / CLOCKS_PER_SEC << "\n";
return 0;
}
```
And I complied it through `g++ -O3 -o run.o test.cpp` on both devices. On my macbookpro "run.o" prints 0.01, while on iSH(ipad pro) it prints 0.12. Jut 10x slower.
I have another much more complicated code related with my work so I can't show you here... There are lots of headers, classes, loops etc..And I complied exactly the same way as above. it takes 0.06s on my laptop to run but 32s on iSH. 500x slower! I thought it was because iSH is an emulator but you think it could be potentially optimized?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the provided benchmark from test.cpp using the reported g++ -O3 command on macOS and iSH, then compare the 0.01s and 0.12s results. Investigate the reported larger workload only if it can be characterized; done would require identifying a reproducible cause and a defined optimization path for iSH.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- operating-systems, performance
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100