[英]Fastest way to send long string from C# to Python
I have a long string of data streaming continuously, which is generated by my C# script. 我的C#脚本会生成一长串连续不断的数据流。 I would like to use it as an input to Python Machine Learning model. 我想将其用作Python机器学习模型的输入。
What is the fastest & easiest way to implement this transmission? 最快最简单的传输方式是什么?
I have found some possible options: 我发现了一些可能的选择:
Data as an argument, while python is running as a process in C# or 数据作为参数,而python作为C#或进程运行
Something different? 有些不同?
Provided that these processes run on the same machine, I think when handling big chunks of data between process memory mapping is the way to go. 只要这些进程在同一台机器上运行,我认为在进程内存映射之间处理大数据块时是必须走的路。
In other case TCP/UDP sockets is a good option since they don't have the overhead of the Application layer which, HTTP for example, has 在其他情况下,TCP / UDP套接字是一个不错的选择,因为它们没有应用层的开销,例如HTTP
I suggest option 6 Use Database like sqlite. 我建议选项6使用像sqlite这样的数据库。
With this option you gain: 使用此选项,您可以获得:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.