English Amiga Board


Go Back   English Amiga Board > Main > Amiga scene

 
 
Thread Tools
Old 03 August 2015, 16:10   #221
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
Quote:
Originally Posted by Megol View Post
Obviously true for anybody with some programming education. Unless one have a problem with (almost) sorted data
well you would hope, but apparently not...

a lot of programmers actually don't have a programming education, i have worked with a lot of people with a scientific or mathematical background, especially physics (which is also my background). Often you learn some programming on those courses, but they don't go through such stuff as time complexity in detail. I'm glad i picked up a book on the subject. really the bit that changed my entire worldview was where it said that it becomes more important as computers get faster, not less, which is the subtlety that a lot of people miss, i think. "Ah i have 3GHz CPU so i don't have to care about efficiency" yeah but you also have 4Gb of data so yeah, you do, and double.

BTW there are ways to deal with (almost) sorted data. There's also heapsort of course, which has no such problem with worst-case scenarios (although it has problems of its own, like probability of cache misses).
Mrs Beanbag is offline  
AdSense AdSense  
Old 03 August 2015, 16:21   #222
Thorham
Computer Nerd

Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 41
Posts: 2,972
Quote:
Originally Posted by Mrs Beanbag View Post
Well then you would say, if you wrote the quick sort in asm it would be ever faster still. And you'd be right. But the user really doesn't care if he gets his result in a tenth of a second or a hundredth of a second, but he sure as hell doesn't want to have to wait ten minutes.
Sure, but on 68k fast code is almost as important as using the right algorithm. Imagine having an amount of data you want to sort that takes five seconds to sort with same crappy C quick sort, while it takes one or two with a highly optimized asm quick sort. I know what the user is going to prefer in such scenarios.

When dealing with the asm vs C question you have to ask yourself why you want to write in asm. Some people write asm because they enjoy it as a hobby. Seems perfectly legit to me.
Thorham is offline  
Old 03 August 2015, 16:27   #223
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
Quote:
Originally Posted by meynaf View Post
Of course the algorithm helps, but it's not always like bubble vs quick sort. My asm implementation of jpeg's "slow int" DCT is faster than the compiled "fast int" version - slower algorithm, but still faster code.
Well i was going to mention, sometimes the opposite can be the case, for instance if you know your data set is very small. Most quick sort implementations revert to a simpler algorithm such as Insertion Sort when the range becomes small enough.

Quote:
Never said otherwise.

Quote:
Originally Posted by meynaf View Post
Normally if you use C, speed isn't an issue.
If it is really vital that you meet a particular speed target, maybe you really have to consider Asm. I am certainly not knocking your own decision to do so.

But if i went to my boss and said "can i do this in asm please?" i know his reply already... "lol, nope"
Mrs Beanbag is offline  
Old 03 August 2015, 16:29   #224
Thorham
Computer Nerd

Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 41
Posts: 2,972
Quote:
Originally Posted by Mrs Beanbag View Post
But if i went to my boss and said "can i do this in asm please?" i know his reply already... "lol, nope"
Luckily we can do whatever we want on our Amigas
Thorham is offline  
Old 03 August 2015, 16:51   #225
Samurai_Crow
Total Chaos forever!

Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Ft. Collins, CO USA
Age: 43
Posts: 913
Send a message via Yahoo to Samurai_Crow
Going back to the managed code idea, would a managed Assembly language that would let you "take off the training wheels" like Oberon 2 did be of interest to anyone? I think that it's a good idea as long as the VM sandbox is lightweight. Think of AmigaDE but for 68k Amigas first.

Re:sorts
Ditch the quicksort and use an iterative natural mergesort. On sorted data the log n term drops out to make it linear. The only remaining advantage of having a quicksort is the lower and upper bound subset computations required by C++ STL.
Samurai_Crow is offline  
Old 03 August 2015, 17:00   #226
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
Quote:
Originally Posted by Samurai_Crow View Post
Going back to the managed code idea, would a managed Assembly language that would let you "take off the training wheels" like Oberon 2 did be of interest to anyone? I think that it's a good idea as long as the VM sandbox is lightweight. Think of AmigaDE but for 68k Amigas first.
I would. I have entertained the idea of a more structured Asm, implementing such concepts as scope of labels, &c..

Quote:
Re:sorts
Ditch the quicksort and use an iterative natural mergesort. On sorted data the log n term drops out to make it linear. The only remaining advantage of having a quicksort is the lower and upper bound subset computations required by C++ STL.
well i was only using that as an example. i have experimented with many different sorting algorithms, and invented a few of my own. Djikstra's Smoothsort is a fascinating variant of heap sort that reduces to linear time on already sorted data. Any sort of merge sort tends to require auxiliary storage though. Also Comb sort is surprisingly effective for its simplicity.
Mrs Beanbag is offline  
Old 03 August 2015, 17:22   #227
Dunny
Registered User

Dunny's Avatar
 
Join Date: Aug 2006
Location: Scunthorpe/United Kingdom
Posts: 862
If I might interject here...

I'm writing a BASIC interpreter and naturally speed is a very important concern for me - by their nature interpreted languages are slow (which is why things like JIT and Dynarecs were created). Normally I'd jump straight into assembly to get the best speed, but unfortunately I can't - it needs to build for both x86 and ARM chipsets, so asm is completely ruled out.

To that end, I have to rely on the compiler to produce good code - which is where algorithm choice comes in. But when it really comes down to it, I've made great progress by disassembling the output and tweaking the code to avoid bottlenecks and compiler idiocy - though the cases where I could have done better than the compiler are few and far between.

Of course, there comes a point where I just don't care about getting more speed - dropping into asm quickly becomes a non-starter when it comes to getting the code ported.

D.
Dunny is offline  
Old 04 August 2015, 13:57   #228
modrobert
old bearded fool

modrobert's Avatar
 
Join Date: Jan 2010
Location: Bangkok
Age: 50
Posts: 424
Even Gates admit it:
https://en.wikipedia.org/wiki/Wirth%...w#Gates.27_law

I agree with the answer to this question (note the time offset):
[ Show youtube player ]
modrobert is offline  
Old 04 August 2015, 14:17   #229
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 44
Posts: 2,459
Quote:
Originally Posted by modrobert View Post
meynaf is offline  
Old 04 August 2015, 20:51   #230
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
you might also like this (if you haven't seen it already)
http://www.stilldrinking.org/programming-sucks
Mrs Beanbag is offline  
Old 16 August 2015, 06:42   #231
B14ck W01f
m68k all the way
 
Join Date: Aug 2011
Location: Koalaland
Posts: 482
I agree that the Amiga was well ahead of its time. It had everything that the PC didn't have - stereo sound, better graphics, better software titles, etc. Hell, it even had emulation going as far back as the A1000. IBM/Microsoft/other PC manufacturers didn't even try to compete with the Amiga. The PC was stuck with Mono/CGA graphics and PC Speaker sound. Until the likes of WinUAE came along, it was a one-way street: "The Amiga can emulate a PC, but a PC can't emulate an Amiga".

Putting hard disks aside, one thing I really like about the Amiga is that you slip a disk in the internal disk drive, and it just worked. There was no need to install the software first. Gaming for PCs has gotten worse. Not only do you have to install games, but you have to deal with DRM and continual updates. That's why for its 30th anniversary, I showed my respects by buying an A500 from eBay.
B14ck W01f is offline  
Old 23 August 2015, 10:32   #232
beezle
Banned

 
Join Date: May 2015
Location: Australia
Posts: 67
OS overheads, layers of abstraction for APIs, etc, etc.

There's no mystery or magic. Its just that once upon a time people programmed the hardware more directly, which results in getting more from the hardware.

Computers aren't as simple as they were in the amigas day, so people tend to program for software rather than hardware.

Higher resolutions and color depths, higher quality sound and so on also mean computers are shifting a heck of a lot more data around.
Do this on an Amiga and watch it buckle under the weight.
beezle is offline  
Old 23 August 2015, 12:01   #233
eXeler0
Registered User

eXeler0's Avatar
 
Join Date: Feb 2015
Location: Sweden
Age: 43
Posts: 1,419
@beezle What you say isnt wrong but you can turn it around as well. The Amiga hardware was built to easily handle the software at the time. A modern Amiga would target the same issues I guess..
Only everything would be 1000 times faster.
One thing that (to this day) always annoyed me in Windows - no matter how fast CPU I have or how much RAM I have (right now thats a 4.1GHz i7 + 32GB RAM and the system itself on a fast SSD) the OS is unpredictable. Doing exactly the same thing, 9 out of 10 times it will respond as you expect it but sometimes that same action will - for some unclear reason - take much longer than usual. Stuff like that annoys me a LOT. The OS is doing something I dont know about.. Every time that happens I remember Amiga OS and how stuff like that never happened.

Sure enough.. windows is doing a hell of a lot more stuff than Amiga OS ever did but maybe thats not a good excuse because you could also say that no one forced them to over-bloat the OS like that.
But its not just Windows.. modern OS's have loads of services running, apparently doing something absolutely need (?)..
Theres unpredictable indexing of files, silent updates, data mining (oh yes ;-) and a bunch of other stuff.. (check the list of crap running in the background on Android OS at any given time).

I still believe we could have a new system that feels like the Amiga but this has already been discussed a million times. Long story short. 99% of ppl dont care enough about efficiency so it would never go beyond a small nische market.
eXeler0 is offline  
Old 23 August 2015, 12:11   #234
robinsonb5
Registered User
 
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 522
Quote:
Originally Posted by eXeler0 View Post
Doing exactly the same thing, 9 out of 10 times it will respond as you expect it but sometimes that same action will - for some unclear reason - take much longer than usual. Stuff like that annoys me a LOT.
This. 100 times this. I describe this as "feeling like I don't have the computer's full attention."
robinsonb5 is offline  
Old 23 August 2015, 12:17   #235
Leffmann

 
Join Date: Jul 2008
Location: Sweden
Posts: 2,025
Quote:
Originally Posted by robinsonb5 View Post
Quote:
Originally Posted by eXeler0 View Post
Doing exactly the same thing, 9 out of 10 times it will respond as you expect it but sometimes that same action will - for some unclear reason - take much longer than usual. Stuff like that annoys me a LOT.
This. 100 times this. I describe this as "feeling like I don't have the computer's full attention."
Windows in a nutshell. It needs five minutes of furious grooming every hour, just so you can boot it up and see the desktop. Really annoying.
Leffmann is offline  
Old 23 August 2015, 15:51   #236
beezle
Banned

 
Join Date: May 2015
Location: Australia
Posts: 67
Yeah, absolutely.
Windows is much more predictable and less annoying when you remove the bloat and/or tune it to the nth degree.
Once you do that its a heck of a lot more snappy and does less unpredictable/annoying stuff (directory caching is a pet peeve for me on modern versions of windows,.... ends up doing the exact opposite of its purpose more often than not).

I ended up making an iso of a tuned Windows install. Ends up much, much nicer an experience. It really doesn't have to be the experience people like to complain about it you spend the time to fix it to begin with.

Alternatively, and more fitting for an Amiga site, AROS is a similar experience straight out of the box.
beezle is offline  
Old 23 August 2015, 20:42   #237
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 44
Posts: 2,459
Quote:
Originally Posted by beezle View Post
Do this on an Amiga and watch it buckle under the weight.
Try to do this on any antiquated hardware and you'll get the same result.
This is exactly the reason why new hardware is badly needed !


Quote:
Originally Posted by robinsonb5 View Post
This. 100 times this. I describe this as "feeling like I don't have the computer's full attention."
But, boy, you do not have the computer's full attention. For it you're not its owner, but just a user.
meynaf is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Amiga 1200 computer sidrulez! MarketPlace 4 02 January 2015 00:36
looking for my amiga 3000 computer amicrawler MarketPlace 4 19 September 2009 22:50
Amiga inc reveal new entry Amiga computer - $489usd Mikey_C News 132 01 October 2007 14:10
The DADDY Amiga computer is? Bloodwych Retrogaming General Discussion 27 05 August 2002 19:14

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:09.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.21889 seconds with 11 queries