D4R issues
Vince M Hudd (116) 534 posts |
By doing that, though, you are increasing the complexity of your code and reducing its efficiency: You are making two tests, instead of just one. Decide on a single total size above which a shift is necessary, and shift in that case, and only in that case. Granted, the increase in complexity is only a very small one, but it’s something that is to be avoided if possible. The reduced efficiency, though, may be less small – it might be small for a single download, but consider the situation when a user is using D4R to download a lot of files. Since these tests are being done when you’re calculating the percentages, that’s the amount of percentage calculations needed over the course of each download, times the number of downloads, times two.
If you’re getting a reasonably consistent download speed (and the progress bar is being updated at regular intervals) it should be – but I wouldn’t bank on the download speed remaining consistent. Especially for larger files.
You may think you’re joking, but I remember being appalled at the time estimation of a Vista computer belonging to a friend for writing some photographs to DVD. I can’t remember what units it used, but if you worked it out, the estimated time was indeed in a number of weeks. Luckily, however, it didn’t actually take that long! |
Rick Murray (539) 13840 posts |
That’s why I suggested that the total size part needs to be >100 for a percentage. 65536 will give a percentage, 64(K) will not.
I guess multiplying by 200 or 400 (etc) would give you a finer grained result? One of my downloaders has the slider be 600 OS units wide. I’m happy with “jumping” 6 pixels on every %ge point because when things are slow people tend to be frustrated about things other than how smooth the display is. I’m actual fact, I only did the %ge calculation on each 16K block – spend more time receiving and less time worrying about visual fluff.
There’s an FPU. I don’t think RISC OS does much with it.
Please please calculate this using a heuristic method – work out from how much has been received and how long it has taken. It sounds obvious but it really seems like some software makes its guess based upon how fast the last <amount> took, leading to some utterly random estimations… |
Rick Murray (539) 13840 posts |
Yes. If they can’t get the “display pretty animation” right, imagine what a mess could result from having to first work out if the box is even necessary. Vince said what I’ve been hinting at – every unnecessary calculation wastes time. It might seem funny in a cooperative system where you can choose when to yield; however by stripping out the unnecessary you can concentrate more on the necessary… |
Steve Pampling (1551) 8170 posts |
I think you missed my point: In RISC OS our configure for Filer allows two options
A bit too binary for most users I would say. Would a simple, accurate count of files transferred not suffice? |
Rick Murray (539) 13840 posts |
Oh… We’re talking about RISC OS now. The part “The fact that without the swirly display the process would take so little time” indicated Windows, and I kind of assumed that it followed me. Actually, we have three options. There’s the “Faster” choice.
Not always. I usually copy with Verbose+Faster (I think that doesn’t bother to give a filename, just the amounts copied so far) but I switch back to non-Faster for a moment to see if this is going to be a TakeAges job, or not. That said, FilerAction is doing a thankless job in unpleasant circumstances. Don’t expect bells and whistles. |
Malcolm Hussain-Gambles (1596) 811 posts |
Thanks for the feedback, again I’ve nothing to really comment – all common sense (I’m not saying I have any – but the comments seem logical) One of the obvious problems is I can’t have 2000 “Filer” display windows open, so there will be a separate window – pretty much like a torrent download window which has all of the current downloads in it. As regards the time estimation, I wasn’t joking – I’ve seen Vista’s time estimation, my specific use of weeks was deliberate ;-) Windows 2010 file copy is really pretty, I’m not sure of it’s actual usefulness but it looks pretty. |
Tony Noble (1579) 62 posts |
But that gives you a mean value of download speed to base a prediction on, which is rarely accurate and easily skewed. Median would be better, but impractical. The best option, surely, is to take a regular point reading (either time or size based) and then base your ‘remaining’ prediction on an average of the last |
Malcolm Hussain-Gambles (1596) 811 posts |
The skew depends on the length of time it is based on. I was thinking of basing this on a 10 second slice. |
Malcolm Hussain-Gambles (1596) 811 posts |
Just a small update, now I’ve got a machine again, I’m back on the case. |
Malcolm Hussain-Gambles (1596) 811 posts |
Thinking about this further, if I can get a socket buffer size set to be 256k then it would mean using a module would be a viable option (i.e. without using wimp_poll) as the centisecond timer would give up to 2.5MB/sec and the millisecond timer up to 256MB/sec – obviously they are all theoretical, a stable 10MB/sec just using wimp_poll_idle will be my next step. |
Malcolm Hussain-Gambles (1596) 811 posts |
My theory, seems to have just been that :-( I’m going to try reading data of the socket, process it (i.e. decode headers, write to disc etc.) then attempt another read of the socket to read any further data – if that is sucessfull then loop, if there is no data to read give control back to the wimp. Or something like that, I’ll have to give it some deeper thought…. |
Malcolm Hussain-Gambles (1596) 811 posts |
Now that my stress levels have returned to an almost bearable level, I’ve managed to continue with this a little further. I’ll need to rewrite the header code logic – which is now the third re-write of it, now that I have a hopefully, full understanding of how I want it to work. |
Malcolm Hussain-Gambles (1596) 811 posts |
I’ve released a minor update for my program. It’s now at least usable, still alpha quality though – but it is functional and works without crashing (for me). The slow download speeds (5MB/sec) I am seeing I think are due to when my mx6 runs at 324MHz. Next up is to clean up the primary buffer code ready for multiple downloads, which I’ve partially started – this stablised the download speed on my mx6 closer to 11MB/sec My main interest of doing multiple downloads is to see if there is any speed difference at all downloading two files rather than one, i.e. will I get: Obviously this depends where the bottleneck is on my iMX6. If I get answer 2 or 3 – then I’ll look at implementing “chunked” downloading as an option earlier. |
Rick Murray (539) 13840 posts |
Sounds like what XP does – various download utilities were devised because breaking a file into pieces tended to run faster than a single piece, for some reason. |
Malcolm Hussain-Gambles (1596) 811 posts |
Thanks Rick, will do. I was more thinking of having a “mirror search” option as the more cunning mirrors use ip based throttling. |
Malcolm Hussain-Gambles (1596) 811 posts |
I’ve done some more tweaking with the secondary buffer and now I’m getting up to 13MB/sec on an MX6 – although the problem I’m having is it’s using too little CPU so the clock speed keeps diving down, which then kills the wimp_polls and thus the download then dives to 3MB/sec. But that’s a good place to be I think, using too little CPU. |
Steve Pampling (1551) 8170 posts |
Adjust the low level CPU speed during the download? Portable_Speed2… |
Malcolm Hussain-Gambles (1596) 811 posts |
I’ll take a look at that, thanks. |
Malcolm Hussain-Gambles (1596) 811 posts |
I’ve done a couple of minor tweaks, I’m now seeing 14MB/sec (sometimes) and fixed the downloading issues. |
Steve Pampling (1551) 8170 posts |
So my off the cuff remark was useful. Good to know some of the grey cells work :) |
Chris Hall (132) 3554 posts |
I definitely need to provide a configuration interface to use Portable_Speed2. There’s !CPUFreq and !CPUClock from !Store. |
Malcolm Hussain-Gambles (1596) 811 posts |
Yeah I use that at the moment, however that’s not really nice. I’ve done some more testing, found some more bugs and weirdness. I’m guessing that I’ll get that weirdness sorted, fix some more bugs and leave it at a single download for the moment. |
Malcolm Hussain-Gambles (1596) 811 posts |
I’ve put up 0.08, which has a few bug fixes. |
Malcolm Hussain-Gambles (1596) 811 posts |
I’ve found some interesting things out about the sockets on RISC OS, which maybe of interest. The obvious reason for the actual slow speeds in the first place dawned on me though…. But at least now I can listen to music and get a reasonable download speed! But it was interesting to learn! In case anyone else wonders. |
Colin (478) 2433 posts |
Did you actually read the size of the buffer after the read to prove this? I can’t see that anything changes the size of the receive buffer and setting the size of the recv buffer to the same value doesn’t do anything. |