简体   繁体   English

QuickFix / N记录性能

[英]QuickFix/N logging performance

Has anyone tried creating their own logger in c# as per: 有没有人尝试按照以下方式在C#中创建自己的记录器:

https://github.com/connamara/quickfixn/blob/master/QuickFIXn/FileLog.cs https://github.com/connamara/quickfixn/blob/master/QuickFIXn/FileLog.cs

I am testing this and I don't seem to be able to increase logging speed - there appears to be a finite amount of time taken in getting to: 我正在对此进行测试,但似乎无法提高日志记录速度-到达以下位置似乎花费了有限的时间:

public void OnIncoming(string msg){}

Or I am doing something wrong. 或我做错了什么。

In my version, I purely timestamp the message and add to list in memory and write to file later on a background thread. 在我的版本中,我纯粹是给消息加时间戳,然后将其添加到内存中的列表中,并稍后在后台线程中写入文件。 However, the time between log entries appears same as if I wrote straight to disk. 但是,日志条目之间的时间似乎与我直接写入磁盘的时间相同。 So, I am wondering if there is much hidden processing prior to this call. 因此,我想知道在此调用之前是否有很多隐藏处理。

I have disabled "Crack" - so it is not doing that. 我已禁用“裂纹”-因此它没有这样做。

I seems your processing time is not taken by logging, but in your program. 我似乎您的处理时间不是通过日志记录,而是在程序中。 Doing an add to a list should be faster than writing it to disk. 向列表中添加内容比将其写入磁盘要快。 However if your program does much processing you will only notice a small difference in the overall performance. 但是,如果您的程序进行了大量处理,您只会注意到整体性能上的细微差别。 You can add a profiler to find where the time is taken. 您可以添加探查器以查找时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM