home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
My TVSeries
Store language(s) from MediaInfo
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="ltfearme" data-source="post: 1130751" data-attributes="member: 52219"><p>Over 200 hundred. Yes you should test with more, it will show that the execution path taken it is not optimised when you do the option toggle vs the import execution path.</p><p></p><p>Import:</p><p>[CODE]</p><p>var episodesForCount = DBSeries.GetEpisodesForCount();</p><p>foreach (DBSeries series in allSeries)</p><p>{</p><p> DBSeries.UpdateEpisodeCounts(series, episodesForCount);</p><p>}</p><p>[/CODE]</p><p></p><p>The Option Toggle you Added:</p><p>[CODE]</p><p>foreach (var series in allSeries)</p><p>{</p><p> int epsTotal = 0;</p><p> int epsUnWatched = 0;</p><p> DBEpisode.GetSeriesEpisodeCounts(series[DBSeries.cID], out epsTotal, out epsUnWatched);</p><p> series[DBOnlineSeries.cEpisodeCount] = epsTotal;</p><p> series[DBOnlineSeries.cEpisodesUnWatched] = epsUnWatched;</p><p> series.Commit();</p><p>}</p><p>[/CODE]</p><p></p><p>As you can see its two different paths. The reason why its faster is because DBSeries.GetEpisodesForCount(); does the database query needed for all series, where as you're doing a query on every single series.</p></blockquote><p></p>
[QUOTE="ltfearme, post: 1130751, member: 52219"] Over 200 hundred. Yes you should test with more, it will show that the execution path taken it is not optimised when you do the option toggle vs the import execution path. Import: [CODE] var episodesForCount = DBSeries.GetEpisodesForCount(); foreach (DBSeries series in allSeries) { DBSeries.UpdateEpisodeCounts(series, episodesForCount); } [/CODE] The Option Toggle you Added: [CODE] foreach (var series in allSeries) { int epsTotal = 0; int epsUnWatched = 0; DBEpisode.GetSeriesEpisodeCounts(series[DBSeries.cID], out epsTotal, out epsUnWatched); series[DBOnlineSeries.cEpisodeCount] = epsTotal; series[DBOnlineSeries.cEpisodesUnWatched] = epsUnWatched; series.Commit(); } [/CODE] As you can see its two different paths. The reason why its faster is because DBSeries.GetEpisodesForCount(); does the database query needed for all series, where as you're doing a query on every single series. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
My TVSeries
Store language(s) from MediaInfo
Contact us
RSS
Top
Bottom