什么是NO_PERF标志,无扩展源$ C ​​$ C做标志、NO_PERF

由网友(孤独患者)分享简介:在ReactiveExtensions源$ C ​​$ C也有$ C不同的实现之间$ CS切换巨大的大片,如In the ReactiveExtensions source code there are huge swathes of codes switching between different impleme...

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

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

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.

有两种表现差异很大,在某些情况下更渴望处置。你可以了解我们更改的详细信息这里。

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

阅读全文

相关推荐

最新文章