Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 11:20
    claassistantio commented #508
  • 11:19
    dependabot-preview[bot] labeled #508
  • 11:19
    dependabot-preview[bot] opened #508
  • 11:19

    dependabot-preview[bot] on nuget

    Bump MailKit from 2.5.0 to 2.5.… (compare)

  • Feb 16 05:53
    joshmeads starred exceptionless/Exceptionless
  • Feb 15 21:37
  • Feb 14 22:06
    claassistantio commented #507
  • Feb 14 22:05
    dependabot-preview[bot] labeled #507
  • Feb 14 22:05
    dependabot-preview[bot] opened #507
  • Feb 14 22:05

    dependabot-preview[bot] on nuget

    Bump UAParser from 3.1.43 to 3.… (compare)

  • Feb 14 18:36
  • Feb 14 17:28
    claassistantio commented #506
  • Feb 14 17:28

    dependabot-preview[bot] on nuget

    (compare)

  • Feb 14 17:28
    dependabot-preview[bot] closed #502
  • Feb 14 17:28
    dependabot-preview[bot] commented #502
  • Feb 14 17:28
    dependabot-preview[bot] labeled #506
  • Feb 14 17:28
    dependabot-preview[bot] opened #506
  • Feb 14 17:28

    dependabot-preview[bot] on nuget

    Bump Foundatio.Repositories.Ela… (compare)

  • Feb 13 09:34
    StefanKoell commented #131
  • Feb 13 00:18
    claassistantio commented #505
Sander Rijken
@srijken
properties window of the .Portable project
UGH
the first fix it suggests is “turn on C#6 support"
and there’s no other fix
Frank Ebersoll
@frankebersoll
Had a discussion at work today about performance of string comparisons. Colleagues wanted to do GetHashCode to compare two long strings, but it turned out to be a bad idea: GetHashCode would need to be
...called every time and it takes about 4 times longer than comparing the strings themselves
Sander Rijken
@srijken
makes sense
Frank Ebersoll
@frankebersoll
that's because string comparison and GetHashCode both need to look at every single character, but GetHashCode needs to multiply and xor things.
So, actually it is more costly and doesnt add any performance when used on few instances.
So, maybe we need more than one hashcode? Could we have a fail-fast-hash that only uses few properties?
Sander Rijken
@srijken
no
oh wait like that
hmm
but that makes things more complicated
let’s first measure things
Frank Ebersoll
@frankebersoll
Yes, i dont want to prematurely optimize either.
Just saying, because GetHashCode itself is already trying to be an optimization
Eric J. Smith
@ejsmith
problem is that you need a hash that covers the entire object in order to find matches later
Sander Rijken
@srijken
you could in theory use a quick hash to determine that it’s different for sure
like if the event message is different.. there’s no need to do a full hashcode
Eric J. Smith
@ejsmith
So like have 2 levels of hashes?
Frank Ebersoll
@frankebersoll
Yes, but those could be calculated on demand if the fail-fast-hash matched
Which would only happen rarely
Eric J. Smith
@ejsmith
Yeah
Let's test
Frank Ebersoll
@frankebersoll
With on demand i mean lazily
Sander Rijken
@srijken
well you need it right away, so I don’t get the lazily
it does save calculating them a lot though
I wonder if System.String save the hashcode internally after requesting
Frank Ebersoll
@frankebersoll
With lazy i mean the real hash
Sander Rijken
@srijken
it can safely do so as it’s immutable
Frank Ebersoll
@frankebersoll
It didnt when i looked at the code today
Sander Rijken
@srijken
that’s.. strange
Eric J. Smith
@ejsmith
Could do a GetQuickHashcode that just includes the base event level properties plus includes all the data key names
Frank Ebersoll
@frankebersoll
But i can
Sander Rijken
@srijken
if they do that, you have a very good change that it’s lightning fast, because most string that are generated by throw new Exception(“Somemessage”) are interned anyway
Frank Ebersoll
@frankebersoll
Have a look again*
Jon Skeet says its a performance / memory question, and memory wins here.
Sander Rijken
@srijken
it’s 4 bytes.. well anyway :)
I guess there’s a lot of strings on the heap and it adds up
@niemyjski C#6 stuff has been removed, pushed
Frank Ebersoll
@frankebersoll
Bedtime. See you!
Sander Rijken
@srijken
can you see if it succeeds this time, as it’s also bedtime for me?
looks like
:)
Eric J. Smith
@ejsmith
Good night guys!
Blake Niemyjski
@niemyjski
Eric J. Smith
@ejsmith
yeah, we are using that.
Blake Niemyjski
@niemyjski
work pretty good?
Eric J. Smith
@ejsmith
yeah