改善节选者的表现 [英] improving performance of streamwriter
本文介绍了改善节选者的表现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
目前,我们有一个场景,我们将大量数据写入文本文件,使用streamwriter按字符完成角色。请问有人可以建议一种提高性能的方法吗?使用内存流的
可以提高性能吗?
谢谢
解决方案
< span lang ="EN-GB"style ="margin:0px"> 我认为你应该考虑一个
BufferedStream ,它写的到构造函数中指定的 FileStream 。当您创建
StreamWriter 时,请在构造函数中指定缓冲流。
Hi,
Currently, we have a scenario where we are writing large amount of data into a text file which is done character by character using streamwriter. Could some please suggest a way to improve the performance of this? does using memorystream improves performance?
Thanks
解决方案
I think that you should consider a BufferedStream, which writes to a FileStream that is specified in the constructor. When you make the StreamWriter, specify the buffered stream in the constructor.
这篇关于改善节选者的表现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文