针对proxy的性能提升
def collect_input_data(self):
"""Fetches input data and turns it into key-value pair for a system. """
input_data = {}
if self.system_type == "in":
input_data['input'] = self.model.runtime.input_data[self.name]
return input_data
for name, connection in self.runtime_input_conns.items():
#if name == "null":
# continue
#source_proxy = connection.get_source_proxy()
#source_port_name = connection.get_source_port_name()
source_proxy,source_port_name = connection.get_source_proxy_and_port_name() #合并成了
try:
input_data[name] = source_proxy.emit_output_data()[source_port_name]
except KeyError:
#input_data[name] = np.at_least(0)
input_data[name] = np.array([[0]])
return input_data
做了一点改变,对name=="null"的判断去掉,对connection的两个函数合并, np.at_least(0)替换为更快的np.array([[0]])本文章使用limfx的vscode插件快速发布