是否值得将 PLINQ 与 ASP.NET 一起使用?

发布于 2024-08-16 10:52:52 字数 390 浏览 1 评论 0原文

有人有在 ASP.NET 中使用 PLINQ 的经验吗?这是一个很好的组合,还是在大多数情况下应该避免的组合?

我为一家律师事务所(约 100 个用户)开发了一个 Intranet ASP.NET 站点。有几个页面包含重要的 LINQ 代码,例如,我们有一个银行记录页面,它使用 LINQ to Datasets 比较我们的会计数据库和银行数据之间的数千笔金融交易。这很慢,所以我很想尝试 PLINQ,但我担心这可能会导致 1 个请求独占 Web 服务器。让银行记录运行速度提高 4 倍,但在运行时将所有其他用户拒之门外,这并不会带来任何改进。

我知道有比 LINQ 更快的解决方案,但我宁愿维护简短的代码。

现在,我们有一个 Dual Pentium 4 Web 服务器,但我希望我们能在不久的将来升级到像样的硬件。

Does anyone have experience using PLINQ with ASP.NET? Is this a good combination, or something to avoid in most situations?

I develop an intranet ASP.NET site for a lawfirm (~100 users). Several pages include non-trivial LINQ code, for example, we have a bank rec page that compares thousands of financial transactions between our accounting database and the bank's data, using LINQ to Datasets. This is slow, so I am tempted to try PLINQ, but I am worried this could lead to 1 request monopolizing the web server. Having the bank rec run 4 times faster but shutting all other users out while it is running would not be an improvement.

I know there are much faster solutions than LINQ, but I would rather have short code to maintain.

Right now, we have a Dual Pentium 4 web server, but I am hoping we can upgrade to decent hardware in the near future.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清泪尽 2024-08-23 10:52:52

据我所知,只有少数情况下 PLINQ 比 LINQ 慢。我没有听说过任何像你所描述的那样 PLINQ 垄断事物的案例。 Microsoft 在 PDC09 上举办了一场会议PLINQ:LINQ,但更快!。我希望该视频能够帮助您确定 PLINQ 是否适合您,但正如他们所说,要衡量之前和之后。祝你好运。

Just from what I've heard, there are only a few cases where PLINQ is slower than LINQ. I hadn't heard any cases where PLINQ monopolized things as you described. Microsoft has a session at PDC09 PLINQ: LINQ, but Faster!. I hope this video will help you decide if PLINQ is right for you, but as they say, measure before and after. Good luck.

撩起发的微风 2024-08-23 10:52:52

我也有类似的担忧。
我假设 plinq 使用线程池中的后台线程,如果是这种情况,那么它将影响站点的可扩展性。默认情况下,每个 cpu 有 100 个线程,如果您的站点使用率较低,您可能希望为每个用户请求刻录一些额外的线程,但我会非常谨慎地这样做

I have a similar concern.
I'm assuming plinq uses a backgroud thread from the thread pool, if this is the case then it would impact scalability of the site. You get by default 100 threads per cpu if you have a low used site you might want to burn some extra threads per user request, but I'd do so very cautiously

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文