Whatkind of speed are you getting and what kind of speed are you hoping to get (and what things have you tried so far to make it go faster)? Can you post a link to the datasheet for your stepper motor? What are you using for your power supply and what do you have the current limit set to on the driver? Can you post your code?
Generally speaking, you probably are not going to get more than a few hundred RPM from your stepper motor, but you should be able to do better than 120 RPM. There are a few main ways to increase your maximum step speed:
The stepper motor library you are using in your most recent program is not designed to work with the A4988 driver you are using and will not give you the behavior you want. You should do something similar to the first program you posted.
3a8082e126