Unity3D Tweening performance

Hey, I’ll be short =)
I’m going to compare quickly 3 types of tween animations: built-in Legacy Animation, HOTween and DOTween.
I use 5k objects from prefabs as tweens targets.
Tweens are looped, start by default, have 1 sec length and tweening transform position from (0, 0, 0) to (1.3, 1.4, 1.5).

Used software info:
– Unity 4.6 Beta 16.
– HOTween v1.3.350.
– DOTween 0.7.310 Alpha
– Unity profiler with ‘Deep Profile’ enabled.

Initialization resources usage

Let’s compare initialization time and GC allocations first.
Time + GC Allocation + real memory allocation. Time is frame total time. Memory usage includes memory used by objects.

Frame time: ~166.7 ms (from 3 samples)
GC Allocations: 97.8 KB
Total memory usage: ~20.07 MB (from 3 samples)
Frames to initialize: 1

Frame time: ~268.68 ms (from 3 samples) + ~55.62 ms (from 3 samples) for second frame
GC Allocations: 4293 KB + 1.3 KB for second frame
Total memory usage: ~25.1 MB (from 3 samples)
Frames to initialize: 2

Frame time: 122.86 ms (from 3 samples)
GC Allocations: 1800 KB (may be kept away from GC using internal pooling)
Total memory usage: ~10 MB (from 3 samples)
Frames to initialize: 1

Resources usage per frame

Now tweening performance, allocations per frame (excluding constant Unity-releated allocators) and total memory usage while running tweens (memory usage increases for a while after initialization).
Time is frame total time.

Frame time: 12-13 ms
GC Allocations: 0 B

Frame time: 36-40 ms
GC Allocations: 420 B – 672 B (sad face here)

Frame time: 9 ms
GC Allocations: 0 B

Brand new DOTween gets the best Unity tweening solution award from me!
And it’s free, very flexible, user-friendly and has a great author. It definitely desires donation!

Grab messy benchmark sources (should be compatible with Unity 4.5) here.

Found a typo? Please, highlight it and press Shift + Enter or click here to inform me!

Share Button


Unity3D Tweening performance — 7 Comments

  1. Thank you for this post!
    This is so helpful

    Can you check the chart images in the post because I can’t see them, please ?

  2. Thank you very much for your post. This is really useful.

    Are you gonna do the same for Unity5?


    • Hey, Javier!
      DOTween is still the best, so I’m not sure it’s worth making this test again =)

  3. Спасибо за статью. Думаю попробовать перейти на DoTween уже версии 1.
    Интересно было увидеть сравнение результатов по сравнению с iTween.

    • Рад, что пригодилось, DoTween определённо заслуживает внимания.
      iTween уступал HOTween когда я их сравнивал пару лет назад.
      Возможно, с тех пор что-то изменилось, но я сомневаюсь что кардинально.
      Вы можете сравнить производительность HOTween с iTween тут: http://hotween.demigiant.com/testRun.html (последняя кнопка).

      • Мне этого теста достаточно! Спасибо за ссылку 😉