As already mentioned, Arduino should be faster because it uses compiled code. PICAXE has many strengths, but speed isn't one of them.
If speed is required, then on any microcontroller system it's usually better to write to whole ports at once instead of set individual pins. PIC and AVR are 8-bit microcontrollers, so writing 8 bits at a time is no more difficult than just writing one - in fact it's easier because when just writing one you've got to read what all the other bits are and write those to the port as well.
Take for instance the Arduino function digitalWrite: (PICAXE does something similar)
Code:
[color=#CC6600]void[/color] [color=#CC6600]digitalWrite[/color](uint8_t pin, uint8_t val)
{
uint8_t*timer*=*digitalPinToTimer(pin);
uint8_t*[color=#CC6600]bit[/color] = digitalPinToBitMask(pin);
uint8_t*port*=*digitalPinToPort(pin);
volatile*uint8_t**out;
[color=#CC6600]if[/color] (port == NOT_A_PIN) [color=#CC6600]return[/color];
[color=#7E7E7E]// If the pin that support PWM output, we need to turn it off[/color]
[color=#7E7E7E]// before doing a digital write.[/color]
[color=#CC6600]if[/color] (timer != NOT_ON_TIMER) turnOffPWM(timer);
out*=*portOutputRegister(port);
uint8_t*oldSREG*=*SREG;
cli();
[color=#CC6600]if[/color] (val == [color=#006699]LOW[/color]) {
*out*&=*~[color=#CC6600]bit[/color];
}*[color=#CC6600]else[/color] {
*out*|=*[color=#CC6600]bit[/color];
}
SREG*=*oldSREG;
}
/*
ABOVE CODE TAKEN FROM THE FOLLOWING LIBRARY
wiring_digital.c - digital input and output functions
Part of Arduino - http://www.arduino.cc/
Copyright (c) 2005-2006 David A. Mellis
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
Modified 28 September 2010 by Mark Sproul
$Id: wiring.c 248 2007-02-03 15:36:30Z mellis $
*/
That's very complicated just to do something very simple. And it even contains other functions that are defined elsewhere!
If you're writing a whole port at once, it's simply:
PORTB = B10101010;
on both systems (remove ; and replace B with % for PICAXE) which translates into very simple assembly when compiled.
On PICAXE, the ports are already called that in the pinout diagram, on the ATmega328 PORTB is digital pins 8-13, PORTC is A0-A5 and PORTD is digital pins 0-7.
Do that comparison and see what timings you get.
Aside from the comments already posted regarding the difference between running interpreted code (PICAXE) and straight compiled code (Arduino) you should also note: The 8-bit microchips that PICAXE is built on run an instruction ever 4 clock cycles...so, the effective million of instructions per second for a 20M2 running at 32 MHZ is 8 MIPS. As noted, those are PICAXE FIRMWARE instructions, not your code's instructions.
ATmega runs an instruction every clock cycle...so the effective million of instructions per second for the "standard" Arduino (ATMega 328P) is 16 MIPS.
To compare fairly, you should be running a 20X2 at 64MHz to "match up" MIPS-wise with an Arduino running at 16Mhz.
Absolutely correct, a PIC with a 16MHz oscillator and 4xPLL to make it one instruction per clock cycle shouldn't be called 64MHz when comparing it with an AVR which does one instruction per clock cycle anyway.
(AHEM! - Page 24 -Microcontroller Comparison)
Out of interest:
Sketch uses 856 bytes (2%) of program storage space. Maximum is 32,256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2,039 bytes for local variables. Maximum is 2,048 bytes
Which is a lot of bytes for such a simple programme.
This is because PICAXE already has all its functions defined in the program memory occupied by the interpreter, so all PICAXE functions only take up a small amount of memory.
Arduino has nothing apart from a bootloader to enable serial programming. Every new function you add has to be defined in program memory, which means simple programs take up lots of space though expanding on it shouldn't make it much bigger.