iPhone 6S GPU Benchmarking

DZone 's Guide to

iPhone 6S GPU Benchmarking

The 6S runs a Metal particles app approximately 3x faster than the vanilla 6 and can render 8 million particles at 30 frames per second.

· Mobile Zone ·
Free Resource

My shiny new iPhone 6S has just arrived and, of course, the first thing I did was run up my Swift and Metal GPU particle system app, ParticleLab. The performance jump from my trusty old 6 is pretty impressive!

With 4,000,000 particles, the 6 runs at around 20 frames per second, while the 6S hovers at around 60 frames per second. With 8,000,000 particles, the 6 runs at an unusable 10 frames per second while the 6s manages a not-too-shabby 30 frames per second. 

Comparing the same application on my iPad Air 2 is a little unfair because the iPad has more pixels to handle, but the iPhone 6s runs the demos about 50% faster.

It took two minutes to update my multiple touch demo to support 3D Touch. UITouch objects now have a force and maximumPossibleForce properties. If your device doesn't support 3D Touch, the value both will be zero, so my code caters for both classes with a simple ternary to calculate a touchMultiplier constant:

 let currentTouchesArray = Array(currentTouches)

    for (i, currentTouch) in currentTouchesArray.enumerate() where i < 4
        let touchMultiplier = currentTouch.force == 0 && currentTouch.maximumPossibleForce == 0
            ? 1
            : Float(currentTouch.force / currentTouch.maximumPossibleForce)

        particleLab.setGravityWellProperties(gravityWellIndex: i,
            normalisedPositionX: Float(currentTouch.locationInView(view).x / view.frame.width) ,
            normalisedPositionY: Float(currentTouch.locationInView(view).y / view.frame.height),
            mass: 40 * touchMultiplier,
            spin: 20 * touchMultiplier)

You can try for yourself—the source code for ParticleLab is available in my GitHub repository.

iphone 6s or iphone 6s plus ,rendering

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}