Wiki

Changes between Version 5 and Version 6 of RunTimePerformance

Show
Ignore:
Timestamp:
06/26/17 05:16:06 (7 years ago)
Author:
torial
Comment:

explanatory comments and typo fixing

Legend:

Unmodified
Added
Removed
Modified
  • RunTimePerformance

    v5 v6  
    1111From 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: 
    1212 * 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) 
    1414 * 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. 
    1515 
    1616Some of the strategies attempting are listed below and whether they yielded much of a performance change: 
    17  * Made sure the the for loop variables had explicit types: yielded 33x improvement 
     17 * Made sure the for loop variables had explicit types: yielded 33x improvement 
    1818 * Used float instead of decimal: yielded 7x improvement 
    1919 * Using multiplication instead of division: yielded 1.2x improvement