Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up transfers #6

Merged
merged 7 commits into from
Mar 13, 2020
Merged

Speed up transfers #6

merged 7 commits into from
Mar 13, 2020

Conversation

ducasp
Copy link
Contributor

@ducasp ducasp commented Jul 24, 2019

Hi fr3nd,

I've made a few changes that speed up a lot file transfers. On my UNAPI adapter, it went from 2,7KB/s average to almost 20KB/s average.

Best regards,

Oduvaldo

ducasp added 2 commits July 24, 2019 02:23
Speed it up it a lot, from 2,7KB/s to 20KB/s!!!

It will speed it up due to three factors:

- when waiting for tcp data, do not wait an extra tick change, TCPIP_WAIT call will wait any time it needs, no need for additional wait.
- changed a little bit the progress bar presentation so it is not printed every received block almost one line of data, VDP text writes on DOS are dead slow... Instead, change it to update only adding the => when enough data to move the counter arrived. Also made the calculation to progress the bar a lot easier for z80 using only one division when initializing the progress bar and then only adds received size to a block counter, if it exceeds the block, progress the bar.
- Changed the way of dealing with received data -> file... Instead of moving byte per byte on multiple function calls (stacking and unstacking is not efficient, and moving the memory back and forth byte per byte is not efficient as well), just move the whole received data block to the file, directly from the RCV call.

I've tested it for quite a few files, and it is way faster on my UNAPI adapter.
@fr3nd
Copy link
Owner

fr3nd commented Jul 26, 2019

Thank you!! It looks promising. I'm currently unable to review your contribution, but I'll do it as soon as possible!

@ducasp
Copy link
Contributor Author

ducasp commented Mar 11, 2020

Hi fr3nd,

I have made a small fix, where some hub packages were not working on my improved speed version of MSX HUB because it would loop filling the screen with the progress bar when a file with too small size was received (i.e.: sofarun has a bas file of 27 bytes and trying to hub install it in 80 columns would not be succesfull). This version seems to be quite stable and I've tested it with many packages with success. :)

@fr3nd
Copy link
Owner

fr3nd commented Mar 11, 2020

Wow, that's a huge improvement. The speed increase is really noticeable and so far I haven't detected any issue.

I'd like to do some more testing before merging your PR and releasing a new version, but it looks really good!

Thank you for your contribution!

@fr3nd fr3nd merged commit 4f65bfd into fr3nd:master Mar 13, 2020
@fr3nd
Copy link
Owner

fr3nd commented Mar 13, 2020

I did some small and cosmetic changes to your code in #9 and I merged it. Awesome work, thank you! 🥇
I'll create a new release now.

@ducasp
Copy link
Contributor Author

ducasp commented Mar 13, 2020

Glad to help! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants