RejectedSoftware Forums

Sign up

Release build causes some issues

Hi I'm writing a web app with vibe. I've hit on two issues that I'm hoping have obvious answers.

1/ When I build in release mode dub --build=release --parallel the whole process takes about an hour and a half on a decent machine. Is this not too long? Have I done something wrong as in debug mode it'll finish in about ten seconds or so.

2/ This one is more concerning. Some of my ajax calls return 404. They all work as they should in debug mode, however.

Thanks for any help.

dmd v2.67.1
dub v0.9.23
vib-d v0.7.23

Re: Release build causes some issues

On Fri, 04 Sep 2015 00:33:30 GMT, bushman wrote:

Hi I'm writing a web app with vibe. I've hit on two issues that I'm hoping have obvious answers.

1/ When I build in release mode dub --build=release --parallel the whole process takes about an hour and a half on a decent machine. Is this not too long? Have I done something wrong as in debug mode it'll finish in about ten seconds or so.

2/ This one is more concerning. Some of my ajax calls return 404. They all work as they should in debug mode, however.

Thanks for any help.

dmd v2.67.1
dub v0.9.23
vib-d v0.7.23

Try using vibe-d": "~>0.7.24"

my dub.json file
it compiles well, and fast, took about 30 seconds or less...

Re: Release build causes some issues

On Sat, 05 Sep 2015 03:59:59 GMT, Louie Bacani Foronda wrote:

On Fri, 04 Sep 2015 00:33:30 GMT, bushman wrote:

Hi I'm writing a web app with vibe. I've hit on two issues that I'm hoping have obvious answers.

1/ When I build in release mode dub --build=release --parallel the whole process takes about an hour and a half on a decent machine. Is this not too long? Have I done something wrong as in debug mode it'll finish in about ten seconds or so.

2/ This one is more concerning. Some of my ajax calls return 404. They all work as they should in debug mode, however.

Thanks for any help.

dmd v2.67.1
dub v0.9.23
vib-d v0.7.23

Try using vibe-d": "~>0.7.24"

my dub.json file
it compiles well, and fast, took about 30 seconds or less...

Thanks Louie, latest vibe knocks about half an hour off the time, but the ajax errors remained. I upgraded dmd to 2.068 and the time went back up (to just over an hour) but now the app seems to work correctly (strange). I notice a bug fix dmd has just been released too that claims to address long compile times. I shall try with that shortly and see if the times come down.

Many thanks - obvious solution indeed!

Re: Release build causes some issues

On Tue, 08 Sep 2015 00:33:50 GMT, bushman wrote:

On Sat, 05 Sep 2015 03:59:59 GMT, Louie Bacani Foronda wrote:

On Fri, 04 Sep 2015 00:33:30 GMT, bushman wrote:

Hi I'm writing a web app with vibe. I've hit on two issues that I'm hoping have obvious answers.

1/ When I build in release mode dub --build=release --parallel the whole process takes about an hour and a half on a decent machine. Is this not too long? Have I done something wrong as in debug mode it'll finish in about ten seconds or so.

2/ This one is more concerning. Some of my ajax calls return 404. They all work as they should in debug mode, however.

Thanks for any help.

dmd v2.67.1
dub v0.9.23
vib-d v0.7.23

Try using vibe-d": "~>0.7.24"

my dub.json file
it compiles well, and fast, took about 30 seconds or less...

Thanks Louie, latest vibe knocks about half an hour off the time, but the ajax errors remained. I upgraded dmd to 2.068 and the time went back up (to just over an hour) but now the app seems to work correctly (strange). I notice a bug fix dmd has just been released too that claims to address long compile times. I shall try with that shortly and see if the times come down.

Many thanks - obvious solution indeed!

A general note: I would strongly recommend against using the -release switch when compiling server software - it disables bounds checking in most cases (in addition to assertions), which makes the application potentially vulnerable for buffer overflow attacks. It also usually only has minimal impact on performance. To remove that and just keep the -O -inline flags, add this to your dub.json:

"buildTypes": {
  "release": {
    "buildOptions": ["optimize", "inline"]
  }
}

The huge build time is probably caused by the machine starting to swap due to all RAM being exhausted. Unfortunately DMD currently still takes up huge amounts of memory when compiling vibe.d (which will hopefully change with some future compiler improvements). For that reason I'd recommend to drop the --parallel switch and/or try --build-mode=singleFile.

Re: Release build causes some issues

On Wed, 09 Sep 2015 06:38:21 GMT, Sönke Ludwig wrote:

On Tue, 08 Sep 2015 00:33:50 GMT, bushman wrote:

On Sat, 05 Sep 2015 03:59:59 GMT, Louie Bacani Foronda wrote:

On Fri, 04 Sep 2015 00:33:30 GMT, bushman wrote:

Hi I'm writing a web app with vibe. I've hit on two issues that I'm hoping have obvious answers.

1/ When I build in release mode dub --build=release --parallel the whole process takes about an hour and a half on a decent machine. Is this not too long? Have I done something wrong as in debug mode it'll finish in about ten seconds or so.

2/ This one is more concerning. Some of my ajax calls return 404. They all work as they should in debug mode, however.

Thanks for any help.

dmd v2.67.1
dub v0.9.23
vib-d v0.7.23

Try using vibe-d": "~>0.7.24"

my dub.json file
it compiles well, and fast, took about 30 seconds or less...

Thanks Louie, latest vibe knocks about half an hour off the time, but the ajax errors remained. I upgraded dmd to 2.068 and the time went back up (to just over an hour) but now the app seems to work correctly (strange). I notice a bug fix dmd has just been released too that claims to address long compile times. I shall try with that shortly and see if the times come down.

Many thanks - obvious solution indeed!

A general note: I would strongly recommend against using the -release switch when compiling server software - it disables bounds checking in most cases (in addition to assertions), which makes the application potentially vulnerable for buffer overflow attacks. It also usually only has minimal impact on performance. To remove that and just keep the -O -inline flags, add this to your dub.json:

"buildTypes": {
  "release": {
    "buildOptions": ["optimize", "inline"]
  }
}

The huge build time is probably caused by the machine starting to swap due to all RAM being exhausted. Unfortunately DMD currently still takes up huge amounts of memory when compiling vibe.d (which will hopefully change with some future compiler improvements). For that reason I'd recommend to drop the --parallel switch and/or try --build-mode=singleFile.

Thanks for the info! I'm not sure the machine is swapping though as it has 16gig, or are things really so bad?

Re: Release build causes some issues

On Wed, 09 Sep 2015 22:09:51 GMT, bushman wrote:

On Wed, 09 Sep 2015 06:38:21 GMT, Sönke Ludwig wrote:

(...)

The huge build time is probably caused by the machine starting to swap due to all RAM being exhausted. Unfortunately DMD currently still takes up huge amounts of memory when compiling vibe.d (which will hopefully change with some future compiler improvements). For that reason I'd recommend to drop the --parallel switch and/or try --build-mode=singleFile.

Thanks for the info! I'm not sure the machine is swapping though as it has 16gig, or are things really so bad?

Hm, no, not that bad... in that case it must be something else that I haven't seen, yet. For me a full release build of a vibe.d based application (took userman as an example, dub build -b release --force) takes about 40 seconds total. This was on Windows on a laptop with 8 GB RAM.