The LeapYear
#9
For testing the speed of the routines, I wrote a little benchmark programm, calculating the given years in your code each 65535 times with my Basic- ans your Inline-Asm-code.

The Julian routine in PB is relatively fast, in contrast to the Gregorean, where Asm shows its power to BASIC!






Quote:03-09-2025    00:25:24      Linux - DOSBox-X German numbers!

Testing the speed of leapyear calculaition in (Power)BASIC and Inline-Asm

Test 1, part 1: Calculating 65535 times in BASIC-Code:
2000 leap? yes - Test took 4.436.195,000 Millisekunden

Test 1, part 2: Calculating 65535 times in Inline-Asm-Code:
2000 leap? yes - Test took 1.059.302,000 Millisekunden
Inline-Asm is      4,187847 times faster here


Test 2, part 1: Calculating 65535 times in BASIC-Code:
2100 leap? no  - Test took 4.413.717,000 Millisekunden

Test 2, part 2: Calculating 65535 times in Inline-Asm-Code:
2100 leap? no  - Test took  971.019,000 Millisekunden
Inline-Asm is      4,545449 times faster here


Test 3, part 1: Calculating 65535 times in BASIC-Code:
2104 leap? yes - Test took 4.435.798,000 Millisekunden

Test 3, part 2: Calculating 65535 times in Inline-Asm-Code:
2104 leap? yes - Test took  971.021,000 Millisekunden
Inline-Asm is      4,568179 times faster here


Test 4, part 1: Calculating 65535 times in BASIC-Code:
2103 leap? no  - Test took 4.413.715,000 Millisekunden

Test 4, part 2: Calculating 65535 times in Inline-Asm-Code:
2103 leap? no  - Test took  728.261,000 Millisekunden
Inline-Asm is      6,060622 times faster here


Test 5, part 1: Calculating 65535 times in BASIC-Code:
1204 leap? yes - Test took  838.600,000 Millisekunden

Test 5, part 2: Calculating 65535 times in Inline-Asm-Code:
1204 leap? yes - Test took  728.261,000 Millisekunden
Inline-Asm is      1,151510 times faster here


Test 6, part 1: Calculating 65535 times in BASIC-Code:
1201 leap? no  - Test took  816.533,000 Millisekunden

Test 6, part 2: Calculating 65535 times in Inline-Asm-Code:
1201 leap? no  - Test took  706.190,000 Millisekunden
Inline-Asm is      1,156251 times faster here



03-08-2025    24:26:54      Linux - DOSBox German numbers!

Testing the speed of leapyear calculaition in (Power)BASIC and Inline-Asm

Test 1, part 1: Calculating 65535 times in BASIC-Code:
2000 leap? yes - Test took 4.394.786,000 Millisekunden

Test 1, part 2: Calculating 65535 times in Inline-Asm-Code:
2000 leap? yes - Test took 1.048.882,000 Millisekunden
Inline-Asm is      4,189972 times faster here


Test 2, part 1: Calculating 65535 times in BASIC-Code:
2100 leap? no  - Test took 4.370.329,000 Millisekunden

Test 2, part 2: Calculating 65535 times in Inline-Asm-Code:
2100 leap? no  - Test took  961.471,000 Millisekunden
Inline-Asm is      4,545461 times faster here


Test 3, part 1: Calculating 65535 times in BASIC-Code:
2104 leap? yes - Test took 4.392.178,000 Millisekunden

Test 3, part 2: Calculating 65535 times in Inline-Asm-Code:
2104 leap? yes - Test took  961.471,000 Millisekunden
Inline-Asm is      4,568186 times faster here


Test 4, part 1: Calculating 65535 times in BASIC-Code:
2103 leap? no  - Test took 4.370.327,000 Millisekunden

Test 4, part 2: Calculating 65535 times in Inline-Asm-Code:
2103 leap? no  - Test took  721.107,000 Millisekunden
Inline-Asm is      6,060580 times faster here


Test 5, part 1: Calculating 65535 times in BASIC-Code:
1204 leap? yes - Test took  830.365,000 Millisekunden

Test 5, part 2: Calculating 65535 times in Inline-Asm-Code:
1204 leap? yes - Test took  721.107,000 Millisekunden
Inline-Asm is      1,151514 times faster here


Test 6, part 1: Calculating 65535 times in BASIC-Code:
1201 leap? no  - Test took  808.510,000 Millisekunden

Test 6, part 2: Calculating 65535 times in Inline-Asm-Code:
1201 leap? no  - Test took  699.252,000 Millisekunden
Inline-Asm is      1,156250 times faster here



03-09-2025    00:27:32      Linux - DOSEmu German numbers!

Testing the speed of leapyear calculaition in (Power)BASIC and Inline-Asm

Test 1, part 1: Calculating 65535 times in BASIC-Code:
2000 leap? yes - Test took  131.325,000 Millisekunden

Test 1, part 2: Calculating 65535 times in Inline-Asm-Code:
2000 leap? yes - Test took    13.212,000 Millisekunden
Inline-Asm is      9,939827 times faster here


Test 2, part 1: Calculating 65535 times in BASIC-Code:
2100 leap? no  - Test took  126.944,000 Millisekunden

Test 2, part 2: Calculating 65535 times in Inline-Asm-Code:
2100 leap? no  - Test took    12.813,000 Millisekunden
Inline-Asm is      9,907438 times faster here


Test 3, part 1: Calculating 65535 times in BASIC-Code:
2104 leap? yes - Test took  127.343,000 Millisekunden

Test 3, part 2: Calculating 65535 times in Inline-Asm-Code:
2104 leap? yes - Test took    12.585,000 Millisekunden
Inline-Asm is    10,118633 times faster here


Test 4, part 1: Calculating 65535 times in BASIC-Code:
2103 leap? no  - Test took  127.684,000 Millisekunden

Test 4, part 2: Calculating 65535 times in Inline-Asm-Code:
2103 leap? no  - Test took    10.438,000 Millisekunden
Inline-Asm is    12,232612 times faster here


Test 5, part 1: Calculating 65535 times in BASIC-Code:
1204 leap? yes - Test took    13.623,000 Millisekunden

Test 5, part 2: Calculating 65535 times in Inline-Asm-Code:
1204 leap? yes - Test took    11.585,000 Millisekunden
Inline-Asm is      1,175917 times faster here


Test 6, part 1: Calculating 65535 times in BASIC-Code:
1201 leap? no  - Test took    14.706,000 Millisekunden

Test 6, part 2: Calculating 65535 times in Inline-Asm-Code:
1201 leap? no  - Test took    10.805,000 Millisekunden
Inline-Asm is      1,361037 times faster here
Reply


Messages In This Thread
The LeapYear - by Andy Dee - 03-07-2025, 04:09 PM
RE: The LeapYear - by Dale Yarker - 03-07-2025, 11:49 PM
RE: The LeapYear - by Andy Dee - 03-08-2025, 01:00 AM
RE: The LeapYear - by Dale Yarker - 03-08-2025, 08:50 AM
RE: The LeapYear - by Andy Dee - 03-08-2025, 11:57 AM
RE: The LeapYear - by Dale Yarker - 03-08-2025, 12:06 PM
RE: The LeapYear - by Andy Dee - 03-08-2025, 03:05 PM
RE: The LeapYear - by Andy Dee - 03-08-2025, 08:34 PM
RE: The LeapYear - by Andy Dee - 03-09-2025, 12:41 AM
RE: The LeapYear - by Dale Yarker - 03-09-2025, 05:30 AM
RE: The LeapYear - by Andy Dee - 03-09-2025, 05:01 PM
RE: The LeapYear - by Dale Yarker - 03-09-2025, 09:18 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)