English 中文(简体)
SubSonic & LinqTemplate: 为什么在这里读得如此缓慢?
原标题:SubSonic & LinqTemplate: Why is read so slow here?

Not sure where to get this info out to the subsonic crew as they took down their forums, and said use stackoverflow, so here we go.

我在努力与一个管理事务办公室取得最大的业绩。 我爱的亚慢性及其大体插入、更新、删除“实体框架”这一背景,但简单明了,“EF”用5x更快的性能从水中分出来。

I ve stripped both down, removed change tracking, foreign properties, navigational properties, everything down to poco.

EF executes a simple select of 1M rows in about 4.8, SubSonic Linq is taking 5x that...

looking at SQL profiler the call is slightly different: Entity Framework: SELECT TOP (1000000) [c].[Id] AS [Id], [c].[ProjectIDL] AS [ProjectIDL], [c].[DescriptorIDL] AS [DescriptorIDL], [c].[FieldIDL] AS [FieldIDL], [c].[Data] AS [Data], [c].[OptionId] AS [OptionId] FROM [dbo].[DescriptorFieldValues] AS [c]

SubSonic:SELECT TOP (1000000) [t0].[Data], [t0].[DescriptorIDL], [t0].[FieldIDL], [t0].[Id], [t0].[OptionId], [t0].[ProjectIDL] FROM [dbo].[DescriptorFieldValues] AS t0

SQL profiler is running a trace and showing a massive duration difference here.
I checked the audit login before both queries and they are identical...

If I run the same query in sql management studio it takes 11 seconds for both queries

看看老的3.04来源,我无法指出,如果我会作出调整,使之与欧洲经济体系相匹配,但这里的争 que是否真地使这一大事变得如此大,或者在我不知道的情况下,是否有某种魔力?

Thanks for your help!

最佳回答

After getting berated by Rob Corney for wanting to learn why SubSonic is slow in comparison to EF, and told we are stupid for wanting to learn why SubSonic is broke, we believe our team has identified a couple places for these performance issues:

  1. In Extensions/Database.cs Load uses per row, per property reflection to serialize the datarow to a concrete object.
  2. In Extensions/Database.cs ToEnumerable all DataReader conversion are done in 1 sequential while loop.
  3. in ExecutionBuilder - this querycompiler is a straight copy paste of an alpha for educational purposes only querycompiler and is woefully out of date using DynamicInvoke.

我们的团队计划作出以下修改:

  1. In Extensions/Database.cs ToEnumerable pull the property infos once and pass them into load, this is believed to have mininmal performance impact, but likely a decent memory utilization impact.

  2. Modify ToEnumerable to multithread the materialization for large datasets.

  3. Add a method into the object factories to allow for construction of an object from a datarow without using reflection, and instead using the t4 template code generation ahead of time.
  4. Inside load, check the object activator for this interface method, if so use this, if not, default back to reflective based serialization.
  5. Update the ExceutionBuilder to avoid the use of DynamicInvoke.

Hopefully this should bring our performance needs to fruition.

Thank you to Jeff V, Ken I, and QES for their help. It s sad to see the creator of SubSonic Rob Corney so defensive about SubSonic s performance, when it appears to be fairly easy to solve. ~ JT

问题回答

Aside from the fact that your SubSonic query doesn t seem to be selecting the ID field, the two SQL statements are for all intents and purposes identical. Finding that the two queries take the same amount of time to execute in SQL Management Studio seems to support this.

这似乎表明,SubSonic实际上比EF需要更长时间的时间:。 众所周知,在业绩方面有一些问题,可以肯定地解释这一差异。

确实,我们需要更详细地了解你的确切用法,以便真正找到答案,说明为什么对你来说,这种质疑会放慢。

另外,如果你正在研究当前的活动和帮助分站,你应尝试their/2008/4 Group

亚慢性、强硬的创建者在相当一段时间前就停止了工作,而“永久船员”则释放了任何实质性的更新(如果是的话,我想他们只能说我不会完全肯定)。 这是一项你可能同时考虑的项目,该项目的工作已经停止(所有实际目的),但实际需要的是更多的工作(工作)。

顺便说一句,“常设论坛”的网页已经关闭,进入了StackOverflow,这些网页的年复一年地根本没有更新。

Subsonic 3 is so slow because its need to compile again and again and again the same thinks before its go to sql server and ask for results.

而这一汇编是在支线上进行的。

For example a simple static command like "Select * FROM Products WHERE ProductID > 100" that typed in subsonic 3 as Products.Find(x => (x.ProductID > 100) needs first a lot of time to converted to string command, and I mean a very long time.

之所以如此缓慢,主要原因就是亚慢性3无价值。

在林克,trick是“ Comp”。 发挥汇编它并记忆中的功能。 对我和我的标准来说,我们怎么办也非常缓慢。

Now back to subsonic 2, this is a really nice idea, but still need a lot of optimization inside. Apparently they not think too much the speed. Anyway with some optimization subsonic 2 can be super fast, near the simple ado commands.

My tests a year ago: Benchmark Linq2SQL, Subsonic2, Subsonic3 - Any other ideas to make them faster?

My idea is to go back to subsonic 2 and make it better and speedy, and drop the subsonic 3. I thank them for both subsonic 2 and 3, but in the version 3 they fail, its ok, I have made too many programs all that years, and not all of them used. Is not big deal.





相关问题
Debugging SQL in ASP.NET

private void BuildGridView2() { GridView1.DataSource = new Select() .From("NewsReleases") .Where("RelMonth").IsEqualTo(this.ddlAward.SelectedValue) .And("RelYear").IsEqualTo(this....

SubSonic Error with MySql CONVERT()

I has encountered conversion from integer to string with MySql+SubSonic3 (it generates wrong SQL query). After I found root of the problem in SubSonic sources and fixed it, everything works fine, but ...

SubSonic OpenExpression/CloseExpression

Hey All! I m trying to construct a query that is something like this: Where column = "value" AND column2 = "value" AND (column3 = "value" OR column4 = "value") I have this code: return new Select() ...

Grouping with SubSonic 3

I have the following table "GroupPriority": Id Group Priority 1 1 0 2 2 0 3 3 0 4 2 1 5 1 1 6 2 2 7 ...

Subsonic Linq guid problem

The construtor Void .ctor(System.Guid, Int32) is not supported. this error occured with the following statements: var Test = from r in db.UserRoles join p in db.UserPermissions on new { r....

热门标签