什么是NO_PERF标志,无扩展源$ C ​​$ C做 [英] What is the NO_PERF flag in reactive extensions source code doing

查看:181
本文介绍了什么是NO_PERF标志,无扩展源$ C ​​$ C做的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ReactiveExtensions源$ C ​​$ C也有$ C不同的实现之间$ CS切换巨大的大片,如

In the ReactiveExtensions source code there are huge swathes of codes switching between different implementations such as

<一个href="https://github.com/Reactive-Extensions/Rx.NET/blob/master/Rx.NET/Source/System.Reactive.Linq/Reactive/Linq/QueryLanguage.StandardSequenceOperators.cs" rel="nofollow">https://github.com/Reactive-Extensions/Rx.NET/blob/master/Rx.NET/Source/System.Reactive.Linq/Reactive/Linq/QueryLanguage.StandardSequenceOperators.cs

和片断

#if !NO_PERF
    return new Distinct<TSource, TSource>(source, x => x, EqualityComparer<TSource>.Default);
#else
     return Distinct_(source, x => x, EqualityComparer<TSource>.Default);
#endif

这是什么标志 NO_PERF 的意图,什么是它,没有它编译库之间的行为差​​异。

what is the intention of this flag NO_PERF and what is the difference in behaviour between the library compiled with it and without it.

推荐答案

由于接收团队的一员,我可以回答这个问题:

As a member of the Rx team, I can answer this:

答案又回到了我们的变化,从接收1.1到2.0接收。我们希望保持旧风格的使用AnonymouseObservable各地以防万一的能力,但对于大多数的时候,你想要的性能增强版本。

The answer goes back to our changes from Rx 1.1 to Rx 2.0. We wanted the ability to keep the old style of using AnonymouseObservable around just in case, but for most of the time, you want the performance enhanced version.

有两种表现差异很大,在某些情况下更渴望处置。你可以了解我们更改的详细信息<一个href="http://blogs.msdn.com/b/rxteam/archive/2012/03/12/reactive-extensions-v2-0-beta-available-now.aspx"相对=nofollow>这里。

There are big differences in both performance, and in some cases more eager disposal. You can find out more information about our changes here.

这篇关于什么是NO_PERF标志,无扩展源$ C ​​$ C做的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆