
- Larkin, Power BASIC cannot be THAT good:
- 05-15-2009
![]() Re: Larkin, Power BASIC cannot be THAT good:
| langwadt@fonz.d... | 05-15-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-15-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-15-2009 |
![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-15-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-15-2009 |
![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-15-2009 |
![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-15-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| John Devereux | 05-15-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-15-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-15-2009 |
![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-16-2009 |
![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-16-2009 |
![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-16-2009 |
![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-16-2009 |
![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-26-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-26-2009 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Michael A. Terr... | 06-10-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-19-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-19-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-19-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Rich the Cynic | 06-19-2009 |
![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-20-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-20-2009 |
![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-20-2009 |
![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-08-2009 |
![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Spehro Pefhany | 06-09-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-08-2009 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Michael A. Terr... | 06-10-2009 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Michael A. Terr... | 06-10-2009 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-10-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-10-2009 |
![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Michael A. Terr... | 06-10-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-20-2009 |
![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Spehro Pefhany | 06-22-2009 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-21-2009 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Michael A. Terr... | 07-03-2009 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-21-2009 |
![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-21-2009 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| John Devereux | 06-21-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-20-2009 |
![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-20-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-19-2009 |
![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-19-2009 |
![]() ![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-20-2009 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-20-2009 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-21-2009 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-21-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-22-2009 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Vladimir Vassil... | 05-20-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-20-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-20-2009 |
![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-20-2009 |
![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Kim Enkovaara | 05-26-2009 |
![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-26-2009 |
![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-26-2009 |
![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Kim Enkovaara | 05-27-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-27-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-20-2009 |
![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-21-2009 |
![]() ![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-21-2009 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Vladimir Vassil... | 05-21-2009 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Michael A. Terr... | 05-21-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-21-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-22-2009 |
![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-23-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-23-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Clifford Heath | 05-21-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-19-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-18-2009 |
![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-26-2009 |
![]() ![]() ![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 05-26-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-10-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-11-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Jan Panteltje | 06-10-2009 |
![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Michael A. Terr... | 06-29-2009 |
![]() ![]() ![]() Re: Larkin, Power BASIC cannot be THAT good:
| Michael A. Terr... | 06-29-2009 |
If you were Registered and logged in, you could reply and use other advanced thread options
The run time in C is 13 seconds here on a 1GHz processor.
Can you specify your 'old HP computer' ?
I can win maybe 1 second by writing the code a bit different.
And a 3GHz would do it in 12 / 4 = 4 seconds...
A bigger cache would help a bit perhaps.
A Cray would be even better.
What does you C code look like? Mine is in the other posting.
Else you goofed a factor 10.
Seems to me anyways :-)
I just tried in Matlab, on a 2GHz core2-duo with 2GB
with 32bit signed ints: ~2.5 second
with 16bit signed ints: ~1.0 second
with 64bit floats: ~4.0 second
-Lasse
On a sunny day (Fri, 15 May 2009 08:35:25 -0700 (PDT)) it happened
Yes, what I think happens is that those core2 duo execute those intructions
a lot faster then my Celeron or whatever it is, so that would gain an other
200%, so Larkin's '''Old''' HP' must be a 3 GHz core?
Maybe I should upgrade to a more recent processor, but luckely I do not need to
add 64M integers :-)
Typing the following into Open Watcom,
-=3D-=3D-
#define ARRAY_SIZE 64000000
int main(void) {
short *a; int *s; int i;
int startTime, endTime;
a =3D malloc(ARRAY_SIZE * sizeof(short));
s =3D malloc(ARRAY_SIZE * sizeof(int));
if (a =3D=3D NULL || s =3D=3D NULL) {
printf("Memory allocation failed.\n");
return -1;
}
printf("Starting...\n");
startTime =3D GetTickCount();
for (i =3D 0; i < ARRAY_SIZE; i++) {
s[i] +=3D a[i];
}
endTime =3D GetTickCount();
printf("Total time taken adding %i array entries: %f seconds.\n",
ARRAY_SIZE, ((float)(endTime - startTime)) / 1000);
free(a); free(s);
return 0;
}
-=3D-=3D-
and saving as test.c and compiling, I get the typical output:
-=3D-=3D-
Total time taken adding 64000000 array entries: 1.453000 seconds.
Total time taken adding 64000000 array entries: 1.546000 seconds.
-=3D-=3D-
My computer is an Athalon 2500 at 1.66GHz, 1.1GB PC133 RAM (currently
472MB free, so no problems allocating the test), running Windows XP
SP2. Basically state-of-the-art way back in the year 2001. If your
computers are taking more than a couple seconds, either your compiler
really sucks or your computers suck even more. :-)
Tim
On a sunny day (Fri, 15 May 2009 09:04:43 -0700 (PDT)) it happened Tim
for(j = 0; j < 10; j++)
{
for(i = 0; i < BIG_SIZE; i++)
{
mem[i] += b[i];
}
}
So multiply your result by 10, and you got 15 seconds, even slower then me
on the eeePC with 512 MB ram and 900 MHz celeron in Linux with gcc-4.0 :-)
Sorry 'bout that ;-)
Can you specify your 'old HP computer' ?
I can win maybe 1 second by writing the code a bit different.
And a 3GHz would do it in 12 / 4 = 4 seconds...
A bigger cache would help a bit perhaps.
A Cray would be even better.
What does you C code look like? Mine is in the other posting.
Else you goofed a factor 10.
Seems to me anyways :-)
I just tried in Matlab, on a 2GHz core2-duo with 2GB
with 32bit signed ints: ~2.5 second
with 16bit signed ints: ~1.0 second
with 64bit floats: ~4.0 second
-Lasse
On a sunny day (Fri, 15 May 2009 08:35:25 -0700 (PDT)) it happened
>> The run time in C is 13 seconds here on a 1GHz processor.
>> Can you specify your 'old HP computer' ?
>> I can win maybe 1 second by writing the code a bit different.
>> And a 3GHz would do it in 12 / 4 = 4 seconds...
>> A bigger cache would help a bit perhaps.
>> A Cray would be even better.
>> What does you C code look like? Mine is in the other posting.
>> Else you goofed a factor 10.
>> Seems to me anyways :-)
>> Can you specify your 'old HP computer' ?
>> I can win maybe 1 second by writing the code a bit different.
>> And a 3GHz would do it in 12 / 4 = 4 seconds...
>> A bigger cache would help a bit perhaps.
>> A Cray would be even better.
>> What does you C code look like? Mine is in the other posting.
>> Else you goofed a factor 10.
>> Seems to me anyways :-)
>I just tried in Matlab, on a 2GHz core2-duo with 2GB
>with 32bit signed ints: ~2.5 second
>with 16bit signed ints: ~1.0 second
>with 64bit floats: ~4.0 second
>-Lasse
>with 32bit signed ints: ~2.5 second
>with 16bit signed ints: ~1.0 second
>with 64bit floats: ~4.0 second
>-Lasse
Yes, what I think happens is that those core2 duo execute those intructions
a lot faster then my Celeron or whatever it is, so that would gain an other
200%, so Larkin's '''Old''' HP' must be a 3 GHz core?
Maybe I should upgrade to a more recent processor, but luckely I do not need to
add 64M integers :-)
> The run time in C is 13 seconds here on a 1GHz processor.
> Can you specify your 'old HP computer' ?
> I can win maybe 1 second by writing the code a bit different.
> And a 3GHz would do it in 12 / 4 =3D 4 seconds...
> A bigger cache would help a bit perhaps.
> A Cray would be even better.
> What does you C code look like? Mine is in the other posting.
> Else you goofed a factor 10.
> Seems to me anyways :-)
> Can you specify your 'old HP computer' ?
> I can win maybe 1 second by writing the code a bit different.
> And a 3GHz would do it in 12 / 4 =3D 4 seconds...
> A bigger cache would help a bit perhaps.
> A Cray would be even better.
> What does you C code look like? Mine is in the other posting.
> Else you goofed a factor 10.
> Seems to me anyways :-)
Typing the following into Open Watcom,
-=3D-=3D-
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <stdlib.h>
#include <windows.h>
#define ARRAY_SIZE 64000000
int main(void) {
short *a; int *s; int i;
int startTime, endTime;
a =3D malloc(ARRAY_SIZE * sizeof(short));
s =3D malloc(ARRAY_SIZE * sizeof(int));
if (a =3D=3D NULL || s =3D=3D NULL) {
printf("Memory allocation failed.\n");
return -1;
}
printf("Starting...\n");
startTime =3D GetTickCount();
for (i =3D 0; i < ARRAY_SIZE; i++) {
s[i] +=3D a[i];
}
endTime =3D GetTickCount();
printf("Total time taken adding %i array entries: %f seconds.\n",
ARRAY_SIZE, ((float)(endTime - startTime)) / 1000);
free(a); free(s);
return 0;
}
-=3D-=3D-
and saving as test.c and compiling, I get the typical output:
-=3D-=3D-
E:\WATCOM\Projects>test
Starting...
Total time taken adding 64000000 array entries: 1.453000 seconds.
E:\WATCOM\Projects>test
Starting...
Total time taken adding 64000000 array entries: 1.546000 seconds.
-=3D-=3D-
My computer is an Athalon 2500 at 1.66GHz, 1.1GB PC133 RAM (currently
472MB free, so no problems allocating the test), running Windows XP
SP2. Basically state-of-the-art way back in the year 2001. If your
computers are taking more than a couple seconds, either your compiler
really sucks or your computers suck even more. :-)
Tim
On a sunny day (Fri, 15 May 2009 09:04:43 -0700 (PDT)) it happened Tim
>> The run time in C is 13 seconds here on a 1GHz processor.
>> Can you specify your 'old HP computer' ?
>> I can win maybe 1 second by writing the code a bit different.
>> And a 3GHz would do it in 12 / 4 = 4 seconds...
>> A bigger cache would help a bit perhaps.
>> A Cray would be even better.
>> What does you C code look like? Mine is in the other posting.
>> Else you goofed a factor 10.
>> Seems to me anyways :-)
>> Can you specify your 'old HP computer' ?
>> I can win maybe 1 second by writing the code a bit different.
>> And a 3GHz would do it in 12 / 4 = 4 seconds...
>> A bigger cache would help a bit perhaps.
>> A Cray would be even better.
>> What does you C code look like? Mine is in the other posting.
>> Else you goofed a factor 10.
>> Seems to me anyways :-)
>Typing the following into Open Watcom,
>-=-=-
>#define ARRAY_SIZE 64000000
>int main(void) {
> short *a; int *s; int i;
> int startTime, endTime;
> a = malloc(ARRAY_SIZE * sizeof(short));
> s = malloc(ARRAY_SIZE * sizeof(int));
> if (a == NULL || s == NULL) {
> printf("Memory allocation failed.\n");
> return -1;
> }
> printf("Starting...\n");
> startTime = GetTickCount();
> for (i = 0; i < ARRAY_SIZE; i++) {
> s[i] += a[i];
> }
> endTime = GetTickCount();
> printf("Total time taken adding %i array entries: %f seconds.\n",
>ARRAY_SIZE, ((float)(endTime - startTime)) / 1000);
> free(a); free(s);
> return 0;
>}
>-=-=-
>and saving as test.c and compiling, I get the typical output:
>-=-=-
>E:\WATCOM\Projects>test
>Starting...
>Total time taken adding 64000000 array entries: 1.453000 seconds.
>E:\WATCOM\Projects>test
>Starting...
>Total time taken adding 64000000 array entries: 1.546000 seconds.
>-=-=-
>My computer is an Athalon 2500 at 1.66GHz, 1.1GB PC133 RAM (currently
>472MB free, so no problems allocating the test), running Windows XP
>SP2. Basically state-of-the-art way back in the year 2001. If your
>computers are taking more than a couple seconds, either your compiler
>really sucks or your computers suck even more. :-)
>Tim
>-=-=-
>#define ARRAY_SIZE 64000000
>int main(void) {
> short *a; int *s; int i;
> int startTime, endTime;
> a = malloc(ARRAY_SIZE * sizeof(short));
> s = malloc(ARRAY_SIZE * sizeof(int));
> if (a == NULL || s == NULL) {
> printf("Memory allocation failed.\n");
> return -1;
> }
> printf("Starting...\n");
> startTime = GetTickCount();
> for (i = 0; i < ARRAY_SIZE; i++) {
> s[i] += a[i];
> }
> endTime = GetTickCount();
> printf("Total time taken adding %i array entries: %f seconds.\n",
>ARRAY_SIZE, ((float)(endTime - startTime)) / 1000);
> free(a); free(s);
> return 0;
>}
>-=-=-
>and saving as test.c and compiling, I get the typical output:
>-=-=-
>E:\WATCOM\Projects>test
>Starting...
>Total time taken adding 64000000 array entries: 1.453000 seconds.
>E:\WATCOM\Projects>test
>Starting...
>Total time taken adding 64000000 array entries: 1.546000 seconds.
>-=-=-
>My computer is an Athalon 2500 at 1.66GHz, 1.1GB PC133 RAM (currently
>472MB free, so no problems allocating the test), running Windows XP
>SP2. Basically state-of-the-art way back in the year 2001. If your
>computers are taking more than a couple seconds, either your compiler
>really sucks or your computers suck even more. :-)
>Tim
Tim, you forgot that I was running >2 loops< inside each other, as Larkin's
original post mentions:
for(j = 0; j < 10; j++)
{
for(i = 0; i < BIG_SIZE; i++)
{
mem[i] += b[i];
}
}
So multiply your result by 10, and you got 15 seconds, even slower then me
on the eeePC with 512 MB ram and 900 MHz celeron in Linux with gcc-4.0 :-)
Sorry 'bout that ;-)
- basic power supply
- March 1, 2009, 5:21 pm
- OT: Power Basic bargain
- March 1, 2010, 4:29 pm
- Basic power supply design question
- June 4, 2007, 7:33 pm
- Released under the GPL, a Linux program to communicate with, and download / upload BASIC files from / to a MCS-8052AH-BASIC embedded system.
- January 4, 2010, 10:41 am
- Released under the GPL, a Linux program to communicate with, and download / upload BASIC files from / to a MCS-8052AH-BASIC embedded system.
- January 7, 2010, 5:32 pm
- Mastech power supply--any good?
- April 14, 2005, 6:54 pm
- Any good resources for DC power supply design?
- February 7, 2007, 3:33 pm
- Any good resources for DC power supply design?
- February 7, 2007, 3:35 pm
- New book describes how to make a good switch mode power supply...
- December 30, 2006, 4:43 pm
- PIC Basic pro
- September 1, 2009, 5:46 pm
- PIC Basic pro (again)
- September 1, 2009, 5:50 pm
- Basic question for somebody to help me with
- December 16, 2004, 4:33 pm
- basic ECL question
- July 12, 2005, 3:58 pm
- Basic doubt
- December 22, 2005, 10:27 pm
- Basic question
- June 28, 2006, 12:40 am








> Can you specify your 'old HP computer' ?
> I can win maybe 1 second by writing the code a bit different.
> And a 3GHz would do it in 12 / 4 = 4 seconds...
> A bigger cache would help a bit perhaps.
> A Cray would be even better.
> What does you C code look like? Mine is in the other posting.
> Else you goofed a factor 10.
> Seems to me anyways :-)