Slow image particle generation on mac simulator, but fine on device

Using Build 764. Here are the particulars:

I made the jump to Lion, xcode 4.3.1, and iOS 5.1.
I normally only run the simulator on Windows and have, what I hope to be, my final build running on Build 746 on Windows sim.
I had not actually tested the game on the mac simulator in quite some time (no need cause Corona rocks!:).
Now the issue…

I am experiencing a MASSIVE slow down with a couple bullet types which generate some particles (using images) only on the Mac simulator, not the device. It is my own particle generator. Normal rectangle particles appear fine on both.
I have not upgraded my Windows Build yet to see if the slow down is happening on it, but at this point i do not want this issue to slow me down.

Please let me know what else I can provide. The code base is huge, so an example may be tough, but it is definitely happening when generating these IMAGE particles and it appears to be running great on the device (iPad 1). [import]uid: 21331 topic_id: 23102 reply_id: 323102[/import]

hmmm… darn crickets…

Is this related to all the new graphics work and/or possibly xCode 4.3.2? Should I file as bug? Have you been able to reproduce? Seems like very fast display.newImageRect calls cause this to happen. [import]uid: 21331 topic_id: 23102 reply_id: 92592[/import]

Even after the great work from the team today, I am still having this issue on the Mac Simulator. When things slow down over there, I would really appreciate some guidance here on how to proceed. Thanks… [import]uid: 21331 topic_id: 23102 reply_id: 93897[/import]

That is surprising and unexpected. Usually this kind of weirdness is due to OpenGL driver issues. The first thing I would try is finding a different Mac with a completely different video card and see if it behaves differently.

Also, you might run Instruments on Mac and see where the application is spending time.

Either way, it might be worth filing a performance bug with Apple because almost always a modern Mac should beat a modern iOS device.
[import]uid: 7563 topic_id: 23102 reply_id: 93913[/import]

Thanks for getting me started. I do appreciate being acknowledged. :slight_smile:
I updated my PC build to the latest 767 and it is fine (a couple of audio.stop oddities, but can’t lock them down completely yet to say why it acted different).

It runs fine on the device as well, iPad 1,2, and 3. I have a new Macbook pro 13 and it has always performed fine until the change to Lion, xCode 4.3.1, and new Corona build. All I know for sure is it is happening during fast image creation within a timer.

Sadly this sounds like a nasty journey… :frowning: [import]uid: 21331 topic_id: 23102 reply_id: 93955[/import]

Actually, we just reproduced a problem which sounds kind of like yours. We’ll probably look at it next week. (It might be related to all the new graphics optimizations/changes we just made.)
[import]uid: 7563 topic_id: 23102 reply_id: 93961[/import]

That is actually great news…lol…funny how that works…

I will also try to reproduce with a small piece of code over the weekend. If I can, I’ll get it to you. I’m really grateful for your attention to this! [import]uid: 21331 topic_id: 23102 reply_id: 93965[/import]

If you have that piece of code and also the System Profile information of the systems you tested on, that would be a big help. The performance issue seems to differ hardware to hardware (looking more and more like an OpenGL driver issue) and doesn’t behave completely consistently for us so far.

[import]uid: 7563 topic_id: 23102 reply_id: 94851[/import]

Ok. I was so busy trying to get my game uploaded by Sunday I did not get a chance to reproduce in a smaller chunk of code. My code-base is rather large, so it may take me the evening. I will try to get the size down as small as possible. This is very important, thanks for the attention and I’ll have it up ASAP. [import]uid: 21331 topic_id: 23102 reply_id: 94899[/import]

I have worked on this most of the evening. My code is just too complex to recreate simply. I could, but it could take weeks to re-create the hierarchy and debug.

Simple tests have not replicated the issue. My particle generator is generating the image particles fine in simple tests and is displaying correctly in the Mac Sim.

The issue is only happening on the Mac simulator. It is running fine on the device (as far as I can tell…). If I change my particles from images to rects, it runs fine on the Mac Simulator as well.

All the code used to run fine on all platforms.

I’m not really comfortable uploading a year of my life, but what can I do. I understand you must see the issue to detect the problem. :wink:

I imagine you have done this process before (providing me an SFTP site or something privately), so please let me know how we can proceed through my account email.

[import]uid: 21331 topic_id: 23102 reply_id: 94968[/import]

This was filed as bug 13428.

Just updating for those on this thread. We found issues in the test case project that was submitted. Specifically in NaN values in the Lua code wreaking havoc on our offscreen culling optimization.

We’ve added asserts to libraries like transition to minimize bad values being passed in. [import]uid: 26 topic_id: 23102 reply_id: 108417[/import]

I noticed my quick red flash issues went away after starting the particle auto update as soon as the scene is loaded. I was calling this on the same frame as when the emitter is started and this was too much for some reason causing bad lag and red flash.

All flashing and also lag issues went after this, hope that helps anyone trying to get good performance.
@walter

Ive heard asserts slow things down but suppose its a necessary fail safe. [import]uid: 118379 topic_id: 23102 reply_id: 108496[/import]