Skip to content

Conversation

@9il
Copy link
Member

@9il 9il commented Jul 22, 2016

The code has grouping of elements. And optimisation in case of stride!(N-1) == 1.
Coverage equals 100%. Codecove shows attribute propagation in murmurhash.d as not covered for no reason (probably because Travis is always 64-bit for Phobos).

@9il 9il added the ndslice label Jul 22, 2016
See_also: $(ZREF2 Slice.toMurmurHash3, toMurmurHash3), $(MREF std, _digest, murmurhash)
+/
pure nothrow @nogc
size_t toHash()() const @safe
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it a template ?
And if it is, it shouldn't have explicit attribute but const.

@DmitryOlshansky
Copy link
Member

LGTM

Hash map implementations should care about finalization step.
Built-in associative arrays has finalization step.

See_also: $(ZREF2 Slice.toMurmurHash3, toMurmurHash3), $(MREF std, _digest, murmurhash)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know the REF_ALTTEXT macro? The reference here won't work with ddox

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, fixed

@WalterBright
Copy link
Member

Just a quick glance, but many functions have parameters with no Params: Ddoc section and return things with no Returns: section.

@9il
Copy link
Member Author

9il commented Jul 25, 2016

Just a quick glance, but many functions have parameters with no Params: Ddoc section and return things with no Returns: section.

Added Returns for toHash. @WalterBright Do you refer to this PR, MurmurHash3 module, or ndslice package?


/++
Computes hash value using MurmurHash3 algorithms without the finalization step.

Copy link
Contributor

@qznc qznc Jul 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing Params section. Document things like "32 or 128" here.

Copy link
Member Author

@9il 9il Jul 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proper description of size and opt is large enough. I added reference to MMH3 in the See_also section Instead of Params.

@qznc
Copy link
Contributor

qznc commented Jul 26, 2016

LGTM

{
import std.experimental.ndslice.selection : iotaSlice;
const sl = iotaSlice(3, 7);
size_t hash = sl.toHash;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small FYI - using assert on ddoced tests isn't bad - in fact a soon-to-come update might rewrite the asserts to writeln in interactive mode (see dlang/dlang.org#1297)

@wilzbach
Copy link
Contributor

wow this is some kickass work 🎉
Looks great!

@wilzbach
Copy link
Contributor

@9il would you be so kind to rebase this, so that we can see the coverage report.

@codecov-io
Copy link

codecov-io commented Jul 30, 2016

Current coverage is 88.70% (diff: 92.59%)

Merging #4639 into master will decrease coverage by <.01%

@@             master      #4639   diff @@
==========================================
  Files           121        121          
  Lines         73916      73968    +52   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          65566      65612    +46   
- Misses         8350       8356     +6   
  Partials          0          0          

Powered by Codecov. Last update d7a7173...4866f6c

h3 = seed[3 - 1];
h2 = seed[2 - 1];
h1 = seed[1 - 1];
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to coverage, this is never tested.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i will just remove them. If some one wants them, then he can open PR and write unittests :-)

@JackStouffer
Copy link
Contributor

Why is the default toHash not sufficient?

@9il
Copy link
Member Author

9il commented Jul 30, 2016

Why is the default toHash not sufficient?

Default hashOf computes hash of struct, but not hash of data this struct points to

@9il
Copy link
Member Author

9il commented Jul 31, 2016

Coverage equals 100%. Codecove shows attribute propagation in murmurhash.d as not covered for no reason (probably because Travis is always 64-bit for Phobos).

@9il
Copy link
Member Author

9il commented Jul 31, 2016

rabased

@wilzbach
Copy link
Contributor

Coverage equals 100%. Codecove shows attribute propagation in murmurhash.d as not covered for no reason (probably because Travis is always 64-bit for Phobos).

Yep (one step at a time) -> #4699

@9il
Copy link
Member Author

9il commented Aug 4, 2016

@DmitryOlshansky Can we move forward with this PR? Martin will merge to the stable branch soon, thought.

@DmitryOlshansky
Copy link
Member

Auto-merge toggled on

@9il
Copy link
Member Author

9il commented Aug 4, 2016

Thanks!

@DmitryOlshansky DmitryOlshansky merged commit fba7339 into dlang:master Aug 4, 2016
@9il 9il deleted the mm3 branch August 4, 2016 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants