0

DwinHs has a DwinsHs_Data_Buffer_Length macro. I have set it to a value of 8192 but the download speeds are still rather slow.

For example, I have a 200 MBit connection and the file is 25 MB. It takes two and a half minutes to download.

I have read through some of the answers here:

What is the best memory buffer size to allocate to download a file from Internet?

It suggests a 16K buffer instead. Either way, is there any way we can use a maximum buffer length with Pascal given the user system?

Browsers download faster so why can’t we here in Inno Setup?


Example

[ISPP]
#define HelpDocSetupURL "https://www.publictalksoftware.co.uk/downloads/PublicTalksHelpDocumentationSetup.exe"

[Setup]
AppID = TestID
AppName = Test App
OutputBaseFilename = My_Test_App_Setup
AppVersion = 1.0
DefaultDirName = {pf}\MyTestApp
DefaultGroupName = My Test App

[Tasks]
Name: "downloadhelp"; Description: "Task Desc"; GroupDescription: "Group Desc";

[Files]

Source: "{tmp}\HelpDocSetup.exe"; \
    DestDir: "{app}"; \
    Flags: external deleteafterinstall; \
    Tasks: downloadhelp; \
    Check: DwinsHs_Check( ExpandConstant('{tmp}\HelpDocSetup.exe'), '{#HelpDocSetupURL}', 'My_Setup', 'Get', 0, 0 )

[Code]
program Setup;

#define DwinsHs_Use_Predefined_Downloading_WizardPage
#define DwinsHs_Data_Buffer_Length 8192
#include "dwinshs.iss"

procedure InitializeWizard();
begin
  DwinsHs_InitializeWizard(wpPreparing);
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  DwinsHs_CurPageChanged(CurPageID, nil, nil);
end;

function ShouldSkipPage(CurPageId: Integer): Boolean;
begin
  Result := False;
  DwinsHs_ShouldSkipPage(CurPageId, Result);
end;

function BackButtonClick(CurPageID: Integer): Boolean;
begin
  Result := True;
  DwinsHs_BackButtonClick(CurPageID);
end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
  Result := True;
  DwinsHs_NextButtonClick(CurPageID, Result);
end;

procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
  DwinsHs_CancelButtonClick(CurPageID, Cancel, Confirm);
end;
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
  • 1
    Can you post a complete example? – Martin Prikryl Jun 03 '19 at 06:26
  • 1
    It takes ~ 10 seconds on my machine/network (definitely well below 200 MBit), what is about as expected. It takes significantly longer (25 seconds) when the installer is executed in Inno Setup IDE. With 16KB, it's slightly faster (~8 seconds). – Martin Prikryl Jun 03 '19 at 08:37
  • @MartinPrikryl Interesting. If I run it outside of the Inno Setup IDE it executed at 380.28 KB/s and took 1 minute 8 seconds. So it was over 50% faster but nothing like 10 seconds! – Andrew Truckle Jun 03 '19 at 08:41
  • 1
    @MartinPrikryl Just done a speed test on my PC and it reports 50MBits! – Andrew Truckle Jun 03 '19 at 09:04

1 Answers1

1

The software author got back to me about this issue and proposed:

You can try to set the cache size to 16384, 32768 or 655536.

So I set it to:

#define DwinsHs_Data_Buffer_Length 655536

The results are much better:

Download Window

As you can see, only 10 seconds.


I don't know what impact such a cache value would have for those who had a slower internet connection.

Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164