| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: C64 BASIC - what`s faster INT() or %? Plus benefits of DEF FN A() |
On Thursday, 19 April 2018 08:14:28 UTC+1, Janne Johansson wrote: > On 2018-04-18 09:37, Shaun Bebbington : Janne Johansson wrote: > > On Wednesday, 18 April 2018 16:41:28 UTC+1, Janne Johansson wrote: > >> On 2018-04-18 05:38, Shaun Bebbington : All wrote: > >> > Thanks for the hints all. I'll do some bench mark testing or > >> whatever :-) > >> > >> Please do. If benchmarking with a FOR loop over hundreds or thousands of > >> repetitions is too hard to figure it out, then the answer isn't really > >> important. > > > > Hey! Good hint. > > I noticed (after sending of course) that it may have been perceivable as > a harsh statement, hinting at lazyness or something, I meant more along > the lines of "if you try 100 loops and can't make out the difference, > then try 1000 loops then try 10k loops and so on, the difference might > be so small that its not worth coding your BASIC programs with % > sprinkled here and there for optimization reasons, but just go for > normal ordinary readability and simplicity since performance is then > bound by something else like algorithmic complexity and not the one-time > conversions from ints to floats and back". > > If you really need a basic program to run faster, there are a lot of > compilers that pre-calculate and pre-parse and then make some kind of > machine language equivalent program out of it which you can run and > which will be lots faster. If that isn't fast enough still, code > important parts in ASM directly or at least code it up in CC65 using > C for some middle ground between compiled BASIC and doing it all in > ASM yourself. Yes Blitz BASIC seems to do a reasonably good job at this. As for C, well I love C. My thinking is like this: optimize BASIC, then compile. That should get the best results. Regards, Shaun. --- SoupGate-Win32 v1.05* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3) SEEN-BY: 57/0 116/102 153/150 250 317/2 3 393/68 633/267 280 640/384 712/620 SEEN-BY: 712/848 770/0 1 3 100 340 772/0 1 210 500 @PATH: 770/3 1 712/848 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.