-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6833 from coodie/forVersusWhile-perf-fix
Fix forVersusWhilePerf.chpl [contributed by @coodie, reviewed by Lydia] Looking at current performance graphs one can notice that in case of LLVM chapel's version of this test there is slight performance degradation, after some investigation I realized that this test is not written well due to few factors: - Chapel's default size for integer is 64-bits while in case of C it is usually 32-bits, so the tests had different performance due to usage of different types of integers, in this case there was better performance for C version. - Chapel's version cannot perform constant propagation due to marking variables as "config const". C's version uses "static const" what enables to do constant propagation which reduces register pressure, that in this case made some difference. After changing all "int" to "int64_t" and "static const int64_t" to "int64_t" the Chapel's version performance closely matches the C version performance. Verified the test changes via correctness and performance testing
- Loading branch information
Showing
3 changed files
with
52 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
int c_trial(void); | ||
int64_t c_trial(void); | ||
int64_t for_loop(void); | ||
int64_t while_loop(void); |