What i don't understand is that it runs fine at first, but gets slower and slower as time goes on, i thought it would be fine as units die there is less demand on CPU but no
This sounds like some bug in the scripting. Once, I had something similar and it turned out that a repetitively called script did not properly terminate and as time went on, more and more instances were running.
BTW, how many groups/units do you have onmap? Like OFP itself, CE2 scales with the number of groups. If you like, you can also reduce the CE2 workload a bit. Take a look at "globalloop.sqs", which is actually the only looping script in the CE2 and from which all the other stuff is called. In the loop, there are waiting commands:
~1
To reduce the frequency, make the waiting times larger, say, 1.5 or 2 seconds. After that, the CE2 is maybe a little less responsive (e.g. when issuing a movement command it may take a little longer until they start moving), but should work fine.
I must admit i've written the code 'fully expanded', ie; i use 'if ... then' instead of '? :' and suchlike, which must slow it as it's all interpreted ... gee i dunno !
This should not make much of a difference, I wouldnÂ't worry about that.