06-29-2009 09:48 AM
I REALLY need some more performance on my latest Storm app. Are there any switches or tools outside of the source I could use to get some extra speed. Maybe a compiler switch or something?
Oddly enough I tried using both Eclipse and JDE to see if there was a difference and the final cod when using JDE was smaller but didn't run any faster.
Oh and I have used the profiler which is really good on the simulator but I can't get it to work on the device. Is it even possible?
06-29-2009 11:30 AM
If there is a magic "more speed" feature, I certainly have no located it yet.
What is it that your app is doing that requries additional speed? I would take a carefull look at the code and see if there are any opportunities for optimization.
RE: the profiler on-device, not sure I understand the necessity for this. You code is the same whether it runs on the device or the sim. You are looking at a percentage of system utilization and the number of objects generated, so this will not change on the device.
06-29-2009 11:48 AM
My app is a game that is using voxel rendering to simulate 3d. The main hot spot is filtering 4 height values/pixels from a bitmap. Its surprising that this doesn't run faster. I would have thought that this code would perform differently on the device since the simulator gives me 10x the framerate as the device. But if you're saying the numbers are percentages, maybe they will scale the same.
static final int FP_SHIFT = 9; static final int FP_MULTIPLIER = 512; static final float FP_FMULTIPLIER = 512.0f; static final int FP_FRACTION_MASK = 0x1FF; static final int FP_ONE = 0x1FF; // Inner loop filtering of heightvalues int xCoord = (fpRayX >> FP_SHIFT); int yCoord = (fpRayY >> FP_SHIFT); int xCoordOne = (xCoord + 1) & HEIGHTFIELD_WIDTH_MASK; int yCoordOne = (yCoord + 1) & HEIGHTFIELD_HEIGHT_MASK; xCoord &= HEIGHTFIELD_WIDTH_MASK; yCoord &= HEIGHTFIELD_HEIGHT_MASK; int coordIndex = xCoord + (yCoord << HEIGHTFIELD_WIDTH_SHIFT); int x00 = m_HeightMapPixels[ coordIndex ]; int x10 = m_HeightMapPixels[ xCoordOne + (yCoord << HEIGHTFIELD_WIDTH_SHIFT) ]; int x11 = m_HeightMapPixels[ xCoordOne + (yCoordOne << HEIGHTFIELD_WIDTH_SHIFT) ]; int x01 = m_HeightMapPixels[ xCoord + (yCoordOne << HEIGHTFIELD_WIDTH_SHIFT) ]; int xRatio = fpRayX & FP_FRACTION_MASK; int yRatio = fpRayY & FP_FRACTION_MASK; int xOneMRatio = FP_ONE - xRatio; int yOneMRatio = FP_ONE - yRatio; int fpHeight = (x00 * ((xOneMRatio * yOneMRatio) >> FP_SHIFT)) + (x10 * ((xRatio * yOneMRatio) >> FP_SHIFT)) + (x11 * ((xRatio * yRatio) >> FP_SHIFT)) + (x01 * ((xOneMRatio * yRatio) >> FP_SHIFT));