# Optimization test: -= faster than += ...?

**URL:** https://forum.kirupa.com/t/optimization-test-faster-than/278522
**Category:** Uncategorized
**Created:** [December 31, 2008, 7:09pm UTC](https://forum.kirupa.com/t/optimization-test-faster-than/278522 "2008-12-31T19:09:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Pattt](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@Pattt](https://forum.kirupa.com/u/Pattt)
#### Post date: [December 31, 2008, 7:09pm UTC](https://forum.kirupa.com/t/optimization-test-faster-than/278522/1 "2008-12-31T19:09:33Z")

</div>

I did a performance recently…

```auto

var a = 100;
for (var i:int=0;i<10000000;i++){
    a += 1;
}
trace(getTimer());
//traces 410

```

and then…

```auto

var a = 100;
for (var i:int=0;i<10000000;i++){
    a -= -1;
}
trace(getTimer());
//traces 280

```

Both are doing exactly the same thing, but in different ways. The -= method did it much faster.  
Can it be true?
