SQL过程中的打印语句会影响性能?(Print Statement in SQL procedure should affect Performance?)
我正在使用SQL Server过程,并且有习惯在存储过程中使用
我的数据库中有近200-250个程序。 打印声明是否会影响性能? 我正在开发多用户Windows应用程序。
I am using SQL Server procedures and I have a habit of using of
I have almost 200-250 procedures in my DB. Should print statement affect the performance? I am working on multi-user Windows application.
原文:https://stackoverflow.com/questions/3690127
最满意答案
携带可以订阅
a
s的事件的来源具有以下类型type Source m a = (a -> m ()) -> m (m ()) | | ^--- how to unsubscribe | ^--- how to subscribe ^--- what to do when an `a` happens
消费者或事件处理者天真地接受事件源并订阅它
type Handler m a = (Source m a ) -> m () = ((a -> m ()) -> m (m ())) -> m () ^-- set up the consumer.
这有点令人费解,我们可以将事物颠倒过来并为事件处理函数获得更好的表示形式:
type Handler m a = m () -> m (a -> m ()) | | ^-- what to do when an `a` happens | ^-- set up the consumer ^-- how to unsubscribe
原始事件来源有点棘手, 订阅者可能想要响应事件发生而取消订阅,在这种情况下,他们需要递归地将产生的取消订阅行为转变为事件发生时要做的事情。 从处理程序的更好的定义开始,我们没有这个问题。 事件源现在是接受事件处理程序并发布给它的东西。
type Source m a = (Handler m a ) -> m () = (m () -> m (a -> m ())) -> m () ^-- how to subscribe
An source of events carrying
a
s that can be subscribed to has the following typetype Source m a = (a -> m ()) -> m (m ()) | | ^--- how to unsubscribe | ^--- how to subscribe ^--- what to do when an `a` happens
A consumer or handler of events is naively something that accepts an event source and subscribes to it
type Handler m a = (Source m a ) -> m () = ((a -> m ()) -> m (m ())) -> m () ^-- set up the consumer.
This is a bit convoluted, we can invert things and get a nicer representation for an event handler:
type Handler m a = m () -> m (a -> m ()) | | ^-- what to do when an `a` happens | ^-- set up the consumer ^-- how to unsubscribe
The original event source was a bit tricky to use; a subscriber might want to unsubscribe in response to an event happening, in which case they'd need to recursively get the resulting unsubscribe action into what to do when an event happens. Starting with the nicer definition of a
Handler
we don't have this problem. An event source is now something that accepts an event handler and publishes to it.type Source m a = (Handler m a ) -> m () = (m () -> m (a -> m ())) -> m () ^-- how to subscribe
相关问答
更多-
事件总线在iOS中等同(Event Bus equivalent in iOS)[2022-10-08]
使用Swift,你可以使用SwiftEventBus 。 这只是 NSNotificationCenter和DispatchQueue的一个很好的包装 。 注册一个事件: SwiftEventBus.onMainThread(target, name: "someEventName") { result in // UI thread // Do something when the event occurr } 触发事件: SwiftEventBus.post("someEventNam ... -
携带可以订阅a s的事件的来源具有以下类型 type Source m a = (a -> m ()) -> m (m ()) | | ^--- how to unsubscribe | ^--- how to subscribe ^--- what to do when an `a` happens 消费者或事件处理 ...
-
id被预定义为haskell中的标识函数。 它的类型为id :: a -> a 。 如果您愿意,您可以轻松定义自己的: myIdentityFunction :: a -> a myIdentityFunction a = a id is predefined as the identity function in haskell. It has type id :: a -> a. If you wanted, you could define your own easily: myIdentityFu ...
-
我爱你的目标,但这是一个很大的工作。 几个提示: 我已经在GHC上工作了,而且你不想要任何部分的资源。 拥抱是一个更简单,更清洁的实现,但不幸的是在C. 这是一个小小的拼图,但马克·琼斯写了一个美丽的文章, 打字哈斯克尔在哈斯克尔 ,这将是一个伟大的起点,你的前端。 祝你好运! 确定Haskell的语言水平,从教室的支持证据,将对社区有很大的好处,绝对是一个可发布的结果! I love your goal, but it's a big job. A couple of hints: I've worked ...
-
你几乎拥有它。 rev :: [Int] -> [Int] rev [] = [] rev x = last x : rev (init x) 说明:[x]是包含x的列表,而您希望直接使用x进行操作 PS。 这是Data.List的文档 。 并记得import Data.List You almost had it. rev :: [Int] -> [Int] rev [] = [] rev x = last x : rev (init x) Explanation: [x] was a list co ...
-
这已经存在于Debug.Trace包中。 它叫做traceShowId 。 (它的确使用了unsafePerformIO - 你可以在这里看到trace的实现 。) This already exists in the Debug.Trace package. It's called traceShowId. (And it does use unsafePerformIO under the covers - you can see the implementation of trace here.)
-
我如何在Haskell中编写MST算法(Prim或Kruskal)?(How can I write a MST algorithm (Prim or Kruskal) in Haskell?)[2021-06-24]
正如svenningsson所言, 优先搜索队列非常适合Kruskal和Prim(至少作者在他的论文中声明了它)。Kruskal的问题在于它需要你有一个O(log n) 联合发现算法 。 这里描述了一个具有纯功能接口的联合查找数据结构,但它在内部使用可变状态,并且纯功能实现可能是不可能的,实际上,有一些问题尚未知晓高效的纯功能解决方案,如这个相关的SO问题。 一个非纯粹的替代品是在ST monad中实现union-find算法。 对Hackage的搜索发现等价包适合我们的需求。 以下是使用来自等价包的Dat ... -
使用RxJava和Retrofit进行异步网络调用。 RxJava提供开箱即用的Retrofit支持。 从改造界面返回Observable 。 @GET("/posts/{id}") public Observable
getData(@Path("id") int postId); 在您的活动类中使用它 - retrofitBuilderClass.getApi() .getData() .subscribeOn(Schedulers.newThread()) .observeOn(A ... -
RxJava作为Android项目中的事件总线 - 从总线中删除事件(RxJava as event bus in Android project - remove event from the bus)[2022-06-05]
只要您不打算允许您的events为null ,我认为这可以很容易地实现。 正如您所说的,您可以使用BehaviorSubject来传播sticky事件,当您想要从bus removeStickyEvent ,您可以只发出一个null对象(以“刷新” subject )。 像这样的东西(从我的头顶 - 没有测试,没有泛型,只是一个简单的基于Object事件的例子): public class RxEventBus { PublishSubject -
EventBus中的事件数量没有限制。 如果您注册到EventBus的对象的生命周期短于EventBus的生命周期(通常与应用程序生命周期相同),您肯定需要从EventBus取消注册。 如果不这样做,注册的对象将始终在EventBus中引用它,这将阻止垃圾收集器完成其工作。 假设您有一个订阅活动的文件查看器活动。 您可以打开文件,查看它,关闭活动并打开另一个使用相同活动的文件。 现在,如果您不取消订阅EventBus,那么用户打开的所有活动都将在EventBus中引用它们。 它们永远不会被垃圾收集,因此最终 ...