|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Studio Execution Logic
So I was helping plucky debug some code for v3 of his movie wall. We were primarily trying to make things faster. And i came across a piece of code that looks like it should only be executing once; however, it was executing multiple times (and obviously making things much slower). To help see what was happening I made a little test stv to show you guys. I want to know if this is normal? How to avoid this in structuring your code? etc. From what i have observed i think the issue lies in performing logic as children of panel widgets.
Both tests involve logic that is A = A + 1. Then i display the result of A 4 times. Test 1 - A is displayed in a child panel that is a child of A = A + 1 Test 2 - A is displayed as a direct child of A = A + 1 I would think that A should equal 1 for both tests. However for test 1 it executes the code twice, and for test 2 it executes the code a total of 8 times (twice for each display of A). I probably explained that terribly so take a look at the attached jpgs and/or the stv containing this code and let me know your thoughts. Also take a look at the cmd window.. i displayed A there while it was executing to see what was going on. Thanks PS - to fix the original issue that plucky and I were trying to diagnose in SMW we ended up moving all the logic (in this case a loop through your entire video collection) into BeforeMenuLoad. Everything worked much faster after
__________________
Server 2003 r2 32bit, SageTV9 (finally!) 2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast) 2x HD300, 1x SageClient (Win10 Test/Development) Check out TVExplorer Last edited by razrsharpe; 06-22-2009 at 06:51 PM. |
#2
|
||||
|
||||
Laying out and rendering the UI is a multi-pass process, and widgets in a blue UI chain get evaluated on every pass. Think of this blue code as like the menu's Draw or HitTest method that gets called at the drop of a hat whenever Sage needs to know something about how the menu lays out.
So if you have something that's expensive to compute, or has side effects that you don't want to happen more than once, it's best to put that sort of code into green process chains wherever possible, since those chains get evaluated just once per click or hook event.
__________________
-- Greg |
#3
|
|||
|
|||
ahhhhhhhh... i figured it was something like that. Thanks for explaining it so clearly ... Is there a means of saying i want this code to be "green"? According to the studio docs (page 16) it says that it needs to a child of a hook, listener, or user selection of a UI element... so it would appear that i cant just say "make this code green"
anyway, thanks for clarifying that bit of confusion and responding so fast
__________________
Server 2003 r2 32bit, SageTV9 (finally!) 2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast) 2x HD300, 1x SageClient (Win10 Test/Development) Check out TVExplorer |
#4
|
||||
|
||||
Quote:
Quote:
- Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#5
|
|||
|
|||
Razor,
Thanks for asking I figured that was the response but I am glad it is confirmed. There are lots placed you can put the code "to make it green" I think we did it best in before menuload. Greg and Andy thanks for the great explanation it is clear to me now. Got an additional question is there a way to force beforemenuload to calculate again say after a property has changed that affects it. I currently just point to the menu widget again to reload the menu but was wondering if there was another way |
#6
|
|||
|
|||
Andy, thanks for the additional info... that makes sense now i think i know what i want/need to do now.
Andy answered that above (if i understand him)... you put a reference to the chain of code in BeforeMenuLoad that updates the data when you want to update the data (ie after the property is updated)... then (also after the property is updated) you refresh the UI elements with RefreshArea() (or something similar).
__________________
Server 2003 r2 32bit, SageTV9 (finally!) 2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast) 2x HD300, 1x SageClient (Win10 Test/Development) Check out TVExplorer |
#7
|
|||
|
|||
That he did answer to early in the morning I think I will leave mine reloading the menu as that way I don't forgot to refresh an area by mistake.
|
#8
|
|||
|
|||
the only downside to that that i see that you will recalculate EVERYTHING.. .and that may needlessly slow things down if you only need to update a small subset of the data.
__________________
Server 2003 r2 32bit, SageTV9 (finally!) 2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast) 2x HD300, 1x SageClient (Win10 Test/Development) Check out TVExplorer |
#9
|
|||
|
|||
Doesn't seem to slow anything down as I clear the menucache as well.
|
#10
|
|||
|
|||
sounds like youre all set then
__________________
Server 2003 r2 32bit, SageTV9 (finally!) 2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast) 2x HD300, 1x SageClient (Win10 Test/Development) Check out TVExplorer |
#11
|
||||
|
||||
Quote:
- Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#12
|
|||
|
|||
Andy,
No I posted that wrong I am only using that in one part (the cache gets to full if I don't) I have recoded today all to reference the necessary section in beforemenuload and refresh after to much better success. |
#13
|
||||
|
||||
Quote:
Quote:
- Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#14
|
|||
|
|||
I think I just overloaded the ui so much when changing a major ui setting it seems to be the only way to speed it up, but that was before I recoded and put/moved allot of it to BeforeMenuLoad. I can probably get rid of it now without much problems. I only had/have it in one spot but I will try and get rid of it there as well didn't realize it cleared so much.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
6.1.x tuner use logic | sleonard | SageTV Beta Test Software | 2 | 03-26-2007 12:48 PM |
Program Guide logic, FireFly remote ? | davefred99 | SageTV Software | 3 | 05-02-2006 08:01 PM |
Live TV while recording scheduled show logic | julesjohn | SageTV Software | 5 | 01-09-2005 11:13 AM |
Cancellation logic? | corykim | SageTV EPG Service | 1 | 05-01-2003 08:06 AM |