Changes between Version 5 and Version 6 of RunTimePerformance
- Timestamp:
- 06/26/17 05:16:06 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
RunTimePerformance
v5 v6 11 11 From the discussion thread in the forums ([http://cobra-language.com/forums/viewtopic.php?f=4&t=700 Why so slow?]), some modified versions of the code are available for comparison: 12 12 * With Python 3.6.0, running against a slightly modified version (for tracking time) with 50,000 loops yielded a run-time of 0.66819638 seconds. 13 * An initial port (which included substantial refactoring to identify the cause of the different final results) with 50,000 loops yielded a run-time of 98.284 seconds 13 * An initial port (which included substantial refactoring to identify the cause of the different final results) with 50,000 loops yielded a run-time of 98.284 seconds (147x slower than the python implementation) 14 14 * After numerous attempts at speed improvement, the cobra code was sped up to a run-time of 0.057 seconds (or 11x faster than python, or 1,724x faster than original implementation. 15 15 16 16 Some of the strategies attempting are listed below and whether they yielded much of a performance change: 17 * Made sure the thefor loop variables had explicit types: yielded 33x improvement17 * Made sure the for loop variables had explicit types: yielded 33x improvement 18 18 * Used float instead of decimal: yielded 7x improvement 19 19 * Using multiplication instead of division: yielded 1.2x improvement