On Thursday, 10 January 2013 at 20:24:02 UTC, Charles Hixson
wrote:
On 01/10/2013 08:41 AM, Ali Çehreli wrote:
On 01/09/2013 04:14 PM, Charles Hixson wrote:
Would the following code:
for (int i = 1; i < di.count; i++)
{ assert (node.di.entry[i - 1].key < node.di.entry[i].key); }
be optimized a
On 01/10/2013 08:41 AM, Ali Çehreli wrote:
On 01/09/2013 04:14 PM, Charles Hixson wrote:
Would the following code:
for (int i = 1; i < di.count; i++)
{ assert (node.di.entry[i - 1].key < node.di.entry[i].key); }
be optimized away if compiled under -release?
It looks like you can use std.algor
On 01/09/2013 04:14 PM, Charles Hixson wrote:
Would the following code:
for (int i = 1; i < di.count; i++)
{ assert (node.di.entry[i - 1].key < node.di.entry[i].key); }
be optimized away if compiled under -release?
It looks like you can use std.algorithm.isSorted instead:
http://dlang.org/p
di is a struct containing *NO* functions. count, however, is a
@property, it just returns a counter variable, but that's not a local
property.
I *LIKE* the
version(assert)
{
...
}
choice. I'd been thinking about debug. I didn't know that version (or
possibly assert) could be used that way.
On Thursday, 10 January 2013 at 00:21:48 UTC, Charles Hixson
wrote:
Would the following code:
for (int i = 1; i < di.count; i++)
{ assert (node.di.entry[i - 1].key < node.di.entry[i].key); }
be optimized away if compiled under -release?
If you write it as:
//
version(assert)
{
for (i
On 01/09/2013 04:40 PM, Jonathan M Davis wrote:
On Wednesday, January 09, 2013 16:14:47 Charles Hixson wrote:
Would the following code:
for (int i = 1; i< di.count; i++)
{ assert (node.di.entry[i - 1].key< node.di.entry[i].key); }
be optimized away if compiled under -release?
If you compile
On Thursday, 10 January 2013 at 01:14:42 UTC, H. S. Teoh wrote:
I tested DMD on a loop containing assert(true);, and apparently
that
*is* optimized out with -O.
I tested it with the program from Jonathan's post – still has an
empty inc/cmp/jl loop in there with -O -release (x86_64).
David
On Thu, Jan 10, 2013 at 02:03:47AM +0100, David Nadlinger wrote:
> On Thursday, 10 January 2013 at 00:40:21 UTC, Jonathan M Davis
> wrote:
> >So clearly, dmd does _not_ optimize out the loop. I have no idea what
> >gdc and ldc do though.
>
> Wow, DMD doesn't optimize it away indeed, just confirmed
On Thursday, 10 January 2013 at 00:40:21 UTC, Jonathan M Davis
wrote:
So clearly, dmd does _not_ optimize out the loop. I have no
idea what
gdc and ldc do though.
Wow, DMD doesn't optimize it away indeed, just confirmed that by
a look at the assembly.
LDC does delete the loop though, starti
On Wednesday, January 09, 2013 16:14:47 Charles Hixson wrote:
> Would the following code:
> for (int i = 1; i < di.count; i++)
> { assert (node.di.entry[i - 1].key < node.di.entry[i].key); }
>
> be optimized away if compiled under -release?
If you compile with -release, assertions will be compile
Would the following code:
for (int i = 1; i < di.count; i++)
{ assert (node.di.entry[i - 1].key < node.di.entry[i].key); }
be optimized away if compiled under -release?
11 matches
Mail list logo