Skip to content

PandasData will convert each DateTime to python once - #2812

Merged
jaredbroad merged 1 commit into
QuantConnect:masterfrom
Martin-Molinero:performance-2810-convert-datetime-to-python-once
Jan 10, 2019
Merged

jaredbroad merged 1 commit into
QuantConnect:masterfrom
Martin-Molinero:performance-2810-convert-datetime-to-python-once

Conversation

@Martin-Molinero

Copy link
Copy Markdown
Member

Description

  • PandasData will convert DateTime to python once and share it among
    consumers giving a performance improvement ~5-10%.

Python history benchmark https://github.com/QuantConnect/Lean/blob/master/Algorithm.Python/Benchmarks/HistoryRequestBenchmark.py
Master:
221.52 seconds at 0k data points per second. Processing total of 36,975 data points.
220.52 seconds at 0k data points per second. Processing total of 36,975 data points.
222.92 seconds at 0k data points per second. Processing total of 36,975 data points.
PR:
210.10 seconds at 0k data points per second. Processing total of 36,975 data points.
220.46 seconds at 0k data points per second. Processing total of 36,975 data points.
202.64 seconds at 0k data points per second. Processing total of 36,975 data points.

Python average use case benchmark python_benchmark_algo.txt
Master:
162.97 seconds at 44k data points per second. Processing total of 7,092,090 data points.
159.80 seconds at 44k data points per second. Processing total of 7,092,090 data points.
158.17 seconds at 45k data points per second. Processing total of 7,092,090 data points.
PR:
140.18 seconds at 51k data points per second. Processing total of 7,092,090 data points.
139.96 seconds at 51k data points per second. Processing total of 7,092,090 data points.
140.58 seconds at 50k data points per second. Processing total of 7,092,090 data points.

Related Issue

Closes #2810

Motivation and Context

Python Execution Speed Improvement

Requires Documentation Change

N/A

How Has This Been Tested?

Multiple times executing performance benchmark algorithm

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-functional change (xml comments/documentation/etc)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention bug-<issue#>-<description or feature-<issue#>-<description>

- `PandasData` will convert DateTime to python once and share it among
consumers giving a performance improvement.
@jaredbroad

Copy link
Copy Markdown
Member

@jaredbroad
jaredbroad merged commit 7ce2839 into QuantConnect:master Jan 10, 2019
@Martin-Molinero Martin-Molinero mentioned this pull request Jan 11, 2019
6 of 9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pandas Data is converting DateTime to python multiple times

3 participants