[ 
https://issues.apache.org/jira/browse/BEAM-10549?focusedWorklogId=467087&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-467087
 ]

ASF GitHub Bot logged work on BEAM-10549:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 06/Aug/20 06:14
            Start Date: 06/Aug/20 06:14
    Worklog Time Spent: 10m 
      Work Description: saavannanavati commented on a change in pull request 
#12352:
URL: https://github.com/apache/beam/pull/12352#discussion_r466168597



##########
File path: sdks/python/apache_beam/runners/worker/opcounters.py
##########
@@ -202,6 +209,37 @@ def __init__(
     self._sample_counter = 0
     self._next_sample = 0
 
+    self.producer_type_hints = None
+    self.producer_full_label = None
+    self.producer_parameter_name = None
+
+    if producer and hasattr(producer, 'spec') and hasattr(producer.spec,
+                                                          'serialized_fn'):
+      fns = pickler.loads(producer.spec.serialized_fn)
+      if fns:
+        if hasattr(fns[0], '_runtime_type_hints'):
+          self.producer_type_hints = fns[0]._runtime_type_hints
+        if hasattr(fns[0], '_full_label'):
+          self.producer_full_label = fns[0]._full_label
+        if hasattr(fns[0], '_runtime_parameter_name'):
+          self.producer_parameter_name = fns[0]._runtime_parameter_name
+
+    self.consumer_type_hints = []
+    self.consumer_full_labels = []
+    self.consumer_parameter_names = []
+
+    if consumers:

Review comment:
       I moved as much logic as possible to the visitor (and removed the 
duplicated code) but kept the producer/consumer distinction because that 
determines whether we type check using the output types (for the producer) 
versus the input types (for the consumer)




----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 467087)
    Time Spent: 1h 50m  (was: 1h 40m)

> Improve Runtime Type Checking Performance
> -----------------------------------------
>
>                 Key: BEAM-10549
>                 URL: https://issues.apache.org/jira/browse/BEAM-10549
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-core
>            Reporter: Saavan Nanavati
>            Assignee: Saavan Nanavati
>            Priority: P2
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> The performance gain will come from moving the runtime type check from a 
> decorator to OperationCounters.
>  
> This has (2) improvements:
>  # Cython optimizable
>  # Sampling is a built-in feature
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to