# Heavy looping

**URL:** <https://forum.kirupa.com/t/heavy-looping/318869>\
**Category:** flash\
**Created:** [February 2, 2011, 8:44am UTC](https://forum.kirupa.com/t/heavy-looping/318869 "2011-02-02T08:44:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fikontrollet](https://avatars.discourse-cdn.com/v4/letter/f/35a633/32.png) [@fikontrollet](https://forum.kirupa.com/u/fikontrollet)\
**Post date:** [February 2, 2011, 8:44am UTC](https://forum.kirupa.com/t/heavy-looping/318869/1 "2011-02-02T08:44:40Z")

</div>

Hey, I’m having trouble getting my loop to run efficiently on slower computers.  
I’ve made some speed improvements, but i’s still not fast enough. Could someone give me their 2 cents of how to speed it up?

```auto

// all verticles are vectors, *plane is a away3dlite plane

private function updateVerticles():void {
	var __p:int = this.$planes.length;
	for (var i : int = 0; i < __p; i++) {
		var id:int = this.$planes*.id, pointingrid:Point = this.$planes*.pointInGrid;

		this.$planes*.plane.vertices[0]=this.$verticles[id+pointingrid.y+this.$segX].x;
		this.$planes*.plane.vertices[1]=this.$verticles[id+pointingrid.y+this.$segX].y;
		this.$planes*.plane.vertices[3]=this.$verticles[id+pointingrid.y+this.$segX+1].x;
		this.$planes*.plane.vertices[4]=this.$verticles[id+pointingrid.y+this.$segX+1].y;
		this.$planes*.plane.vertices[6]=this.$verticles[id+pointingrid.y].x;
		this.$planes*.plane.vertices[7]=this.$verticles[id+pointingrid.y].y;
		this.$planes*.plane.vertices[9]=this.$verticles[id+pointingrid.y+1].x;
		this.$planes*.plane.vertices[10]=this.$verticles[id+pointingrid.y+1].y;
		this.$planes*.plane.material.dirty = true;
	}
	this.$view.render();
}

```
