[ https://issues.apache.org/jira/browse/BEAM-9085?focusedWorklogId=388984&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-388984 ]
ASF GitHub Bot logged work on BEAM-9085: ---------------------------------------- Author: ASF GitHub Bot Created on: 18/Feb/20 18:34 Start Date: 18/Feb/20 18:34 Worklog Time Spent: 10m Work Description: tvalentyn commented on pull request #10885: [BEAM-9085] Fix performance regression in SyntheticSource URL: https://github.com/apache/beam/pull/10885#discussion_r380857370 ########## File path: sdks/python/apache_beam/testing/synthetic_pipeline.py ########## @@ -415,19 +418,24 @@ def get_range_tracker(self, start_position, stop_position): tracker = range_trackers.UnsplittableRangeTracker(tracker) return tracker + @staticmethod + def random_bytes(length): + """Return random bytes.""" + return b''.join( + (struct.pack('B', random.getrandbits(8)) for _ in xrange(length))) + def _gen_kv_pair(self, index): - r = np.random.RandomState(index) - rand = r.random_sample() + random.seed(index) Review comment: How about we instantiate random.Random() instead of modifying the global state? This is important if we execute this generator concurrently. Not sure if we do. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 388984) Time Spent: 0.5h (was: 20m) > Performance regression in np.random.RandomState() skews performance test > results across Python 2/3 on Dataflow > -------------------------------------------------------------------------------------------------------------- > > Key: BEAM-9085 > URL: https://issues.apache.org/jira/browse/BEAM-9085 > Project: Beam > Issue Type: Bug > Components: testing > Reporter: Kamil Wasilewski > Assignee: Kamil Wasilewski > Priority: Major > Time Spent: 0.5h > Remaining Estimate: 0h > > Tests show that the performance of core Beam operations in Python 3.x on > Dataflow can be a few time slower than in Python 2.7. We should investigate > what's the cause of the problem. > Currently, we have one ParDo test that is run both in Py3 and Py2 [1]. A > dashboard with runtime results can be found here [2]. > [1] sdks/python/apache_beam/testing/load_tests/pardo_test.py > [2] https://apache-beam-testing.appspot.com/explore?dashboard=5678187241537536 -- This message was sent by Atlassian Jira (v8.3.4#803005)