Very low performance in a "for" loop
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Stellarium |
Fix Released
|
High
|
Unassigned |
Bug Description
The 0.11.4 version 64bit of Stellarium on a 64bit Windows 7 system (core i5, 12 GB RAM) seems to degrade performance in a "for" loop if used on conjunction with the "core.wait()" function inside the loop.
This is the code:
for (i=0; i<20; i++)
{
core.setDate("+1 days");
core.wait(0.2);
}
Even if the whole frame rate is high (60 fps), the rate of the loop is extremely low (every ~1 second instead of 0.2 second). During the "for" loop the whole frame rate is lowered to 14 fps and when it ends, goes back to 60 fps. Only the first cycle of the loop is at the correct speed, not the others.
Reinstalling the old 0.11.3, the loop works at the correct speed. Has something changed in the wait() function?
I don't know if the bug affects also the 0.11.4 32-bit systems.
tags: | added: performance |
tags: | added: scripting |
Changed in stellarium: | |
status: | Triaged → Fix Released |
I prepared a VM with Win7 32bit and it seems that this bug does affect also this architecture. In order to find if the bug is in the "core.wait()" function rather than elsewhere, I changed the code to the following:
for (i=0; i<20; i++)
{
core.wait(0.1);
}
(I deleted any other functions in the loop).
It takes 20 seconds to complete, instead of 2 seconds, 10 times higher!