What are the best practices for performance maximization?
For example, is it better to call a function 40 times, or is it better to create a global variable which calls the function once and then call upon that variable 40 times?
If a variable is in an external object, is it better to call upon it multiple times inside a script, or is it better to create a local variable inside the script to call upon the external global once and then reuse the local variable?
Essentially, I'm not sure if the code should be maximized for memory consumption or CPU consumption. I'm also wondering how "expensive" calling global variables is in relation to calling locally declared variables inside a script.
Performance Maximization
-
- Newbie
- Posts: 45
- Joined: 19 May 2013 17:58
Re: Performance Maximization
Liine team? Code junkies? Anybody?
what would cause Lemur to exit suddenly to the iPad's main screen? The project with the issue clocks in at 18% percent usage as seen on the pie graph in the Lemur Editor, but this is in it's default setting where all menu objects and any other arrays are empty.
This is a new issue that has come up after prototyping the following mechanism:
lemur receives an array of up to 128 strings via OSC and is stored into 4 expression-arrays of 32. The expressions are then called to fill a menu object depending on which "segment" the user selects.
The mechanism is used 16 times to create 16 "dynaminc" menu objects.
I want to say that from testing that the "boot" occurs after the OSC data dump kicks off all of these array manipulating events, but I'm not 100% sure. Is there anything I can do to debug and find out what the issue may be? This goes along with my OP as I am wondering whether I am overdriving the CPU or running out of memory.
what would cause Lemur to exit suddenly to the iPad's main screen? The project with the issue clocks in at 18% percent usage as seen on the pie graph in the Lemur Editor, but this is in it's default setting where all menu objects and any other arrays are empty.
This is a new issue that has come up after prototyping the following mechanism:
lemur receives an array of up to 128 strings via OSC and is stored into 4 expression-arrays of 32. The expressions are then called to fill a menu object depending on which "segment" the user selects.
The mechanism is used 16 times to create 16 "dynaminc" menu objects.
I want to say that from testing that the "boot" occurs after the OSC data dump kicks off all of these array manipulating events, but I'm not 100% sure. Is there anything I can do to debug and find out what the issue may be? This goes along with my OP as I am wondering whether I am overdriving the CPU or running out of memory.
Re: Performance Maximization
Im not sure about these things, but if Lemur App is exiting to the background, you might be able to catch the error and report it to support using - https://itunes.apple.com/en/app/system- ... 58981?mt=8 - i think its support@liine.net
Lemur seems to exit sometimes when handling fast and large amounts of data over OSC, so maybe there is a way of breaking your data up into smaller chunks and queueing it at the source?
Another thing, are you on windows? With the system-console app I get a "broken pipe" error when lemur exits with some OSC commands on windows tcp stack, so it might have something to do with this? Mac doesnt seem to suffer from this.
Lemur seems to exit sometimes when handling fast and large amounts of data over OSC, so maybe there is a way of breaking your data up into smaller chunks and queueing it at the source?
Another thing, are you on windows? With the system-console app I get a "broken pipe" error when lemur exits with some OSC commands on windows tcp stack, so it might have something to do with this? Mac doesnt seem to suffer from this.
-
- Newbie
- Posts: 45
- Joined: 19 May 2013 17:58
Re: Performance Maximization
thank you so much for this bit of info. I am on a windows machine, but I get "invalid destination port" for an error. The amount of data being sent is substantial, but it's the same as it was before I began encountering the error. The difference being that if I sent an array larger than 32 strings (or list of symbols in Max) to Lemur, Lemur would simply truncate the excess. Now, I parse the large array into smaller arrays so they can fit in a menu object.
I have managed to minimize the sudden exits by forcing a wait of 10 seconds between OSC dumps, but it will still occur at random (immediately after or during an OSC dump, which is also when the array gets parsed).
In any regard - thank you again for the debugging tool and support address. I've sent details to support, so we'll see what happens.
I have managed to minimize the sudden exits by forcing a wait of 10 seconds between OSC dumps, but it will still occur at random (immediately after or during an OSC dump, which is also when the array gets parsed).
In any regard - thank you again for the debugging tool and support address. I've sent details to support, so we'll see what happens.
Re: Performance Maximization
Theres definitely a problem with windows causing the ports to close. Windows 7 just doesnt like opening and closing ports. Ive not quite put my finger on it yet, but its definitely there. Mac does it too sometimes. I think its a TCP problem. Wireshark can also give you more info. https://www.wireshark.org/ . Just download it here https://www.wireshark.org/download.html and press start on the network you want to sniff. If you right click on a packet and select "follow tcp stream" or "udp stream" you can see exactly what was sent, where it stopped, why it stopped etc. Its a bit of a rabbit hole, but potentially might give you some clues.
-
- Newbie
- Posts: 45
- Joined: 19 May 2013 17:58
Re: Performance Maximization
if we observe any error about a port closing on the ipad while running lemur, it can only be a port on the ipad. Osc transfers over udp. since udp is a "connection-less" protocol, the "sender" doesn't require the "receiver" to accept data packets or report anything about them (ie whether the packets have been received at all). A system error can only be originated from within the system that does any changes to its own ports. Further, I don't think a port closing would hard-crash the app .. I would think the issue would be along the lines of simply not receiving data.
The full list of errors in the log is as follows:
2013-09-24 21:23:09 +0000 backboardd BKSendGSEvent ERROR sending event type 23: (ipc/send) invalid destination port (0x10000003)
2013-09-24 21:23:09 +0000 backboardd BKSendGSEvent ERROR sending event type 23: (ipc/send) invalid destination port (0x10000003)
2013-09-24 21:23:09 +0000 backboardd Application 'UIKitApplication:net.liine.Lemur[0x8625]' exited abnormally with signal 11: Segmentation fault: 11
2013-09-24 21:23:09 +0000 backboardd BKSendGSEvent ERROR sending event type 23: (ipc/send) invalid destination port (0x10000003)
2013-09-24 21:23:09 +0000 backboardd BKSendGSEvent ERROR sending event type 3001: (ipc/send) invalid destination port (0x10000003)
A google search on "exited abnormally with signal 11: Segmentation fault: 11" yielded an interesting result. Apparently this is an error that "occurs when your program tries to access the memory location of an object that no longer exists" - http://stackoverflow.com/questions/1002 ... n-fault-11. This is interesting too - http://stackoverflow.com/questions/1437 ... onaryvalue. I had a feeling it was a memory issue .. now the question is whether it's a bug in lemur's handling of system memory or if I'm exhausting the available memory to the app.
The full list of errors in the log is as follows:
2013-09-24 21:23:09 +0000 backboardd BKSendGSEvent ERROR sending event type 23: (ipc/send) invalid destination port (0x10000003)
2013-09-24 21:23:09 +0000 backboardd BKSendGSEvent ERROR sending event type 23: (ipc/send) invalid destination port (0x10000003)
2013-09-24 21:23:09 +0000 backboardd Application 'UIKitApplication:net.liine.Lemur[0x8625]' exited abnormally with signal 11: Segmentation fault: 11
2013-09-24 21:23:09 +0000 backboardd BKSendGSEvent ERROR sending event type 23: (ipc/send) invalid destination port (0x10000003)
2013-09-24 21:23:09 +0000 backboardd BKSendGSEvent ERROR sending event type 3001: (ipc/send) invalid destination port (0x10000003)
A google search on "exited abnormally with signal 11: Segmentation fault: 11" yielded an interesting result. Apparently this is an error that "occurs when your program tries to access the memory location of an object that no longer exists" - http://stackoverflow.com/questions/1002 ... n-fault-11. This is interesting too - http://stackoverflow.com/questions/1437 ... onaryvalue. I had a feeling it was a memory issue .. now the question is whether it's a bug in lemur's handling of system memory or if I'm exhausting the available memory to the app.
-
- Newbie
- Posts: 45
- Joined: 19 May 2013 17:58
Re: Performance Maximization
liine replied to my support e-mail request When I get a second, I'll send them the necessary data they requested and report back what we find.