News for hackers. Stuff that matters.
Re:Zcoin implementation bug enabled attacker to create over ... by iopq on Tuesday March 07, 2017 @02:24AM (#13808836)
The difference is not negligible:

http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...

Sure, it's silly benchmarks, so I wouldn't take the results as gospel. But the fact is, nobody who writes C# managed to produce a benchmark yet that beats a C++ program.

Fast languages like Rust have managed to at least match the performance of C in some benchmarks (and even beat it in others).

Re:Zcoin implementation bug enabled attacker to create over ... by hvidgaard on Tuesday March 07, 2017 @02:27AM (#13808848)
Properly unmanaged code will probably always be faster than managed code. But the point still stands. Code in a managed language, identify the hot spots and inject highly performant unmanaged code there. There is no need to go full C++ for 99.999% of all projects.
Re:Zcoin implementation bug enabled attacker to create over ... by igouy on Tuesday March 07, 2017 @11:45AM (#13811860)
Like this?

http://benchmarksgame.alioth.debian.org/u64q/program.php?tes...

How should /unsafe be set with .Net CORE csproj ?

Re:Zcoin implementation bug enabled attacker to create over ... by igouy on Wednesday March 08, 2017 @01:25PM (#13822327)
I only knew the command line option which no longer worked. Once I found the project.json

    "buildOptions": {
        "allowUnsafe": true
    }
I was able to fake something for dotnet migrate and find the needed setting:

    <Project Sdk="Microsoft.NET.Sdk">
        <PropertyGroup>
            <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
        </PropertyGroup>
    </Project>
Re:Zcoin implementation bug enabled attacker to create over ... by lmm on Tuesday March 07, 2017 @08:28AM (#13810098)
> nobody who writes C# managed to produce a benchmark yet that beats a C++ program

No, but I've seen Haskell programs that were much faster than the C++ program they replaced, which is what matters in the real world.

Microbenchmarks measure what happens if you have the time to polish every single line to perfection. If you have infinite developer time then C++ will be faster than most languages. But infinite developer time is a negligible use case.

Re:Zcoin implementation bug enabled attacker to create over ... by igouy on Tuesday March 07, 2017 @11:43AM (#13811825)
Did the Haskell programs implement the same algorithm?
Re:Zcoin implementation bug enabled attacker to create over ... by lmm on Tuesday March 07, 2017 @11:45AM (#13811859)
It implemented the same business requirements. I don't know or care what algorithm was involved (indeed I wouldn't really say there was one).
Re:Zcoin implementation bug enabled attacker to create over ... by igouy on Tuesday March 07, 2017 @11:47AM (#13811887)
"Will your toy benchmark program be faster if you write it in a different programming language? It depends how you write it!" :-)
Re:Zcoin implementation bug enabled attacker to create over ... by willtim on Tuesday March 07, 2017 @02:39AM (#13808889)
It's worth pointing out that the majority of large C++ projects contain non-deterministic memory management (reference counting) and cache-inefficient object structures like C#.
Re:Zcoin implementation bug enabled attacker to create over ... by iopq on Tuesday March 07, 2017 @02:44AM (#13808904)
Absolutely. But note that if you don't have cycles, reference counting of SOME objects is faster than having a GC for everything. The RAII idiom when used in C++ helps with statically determining that some objects can be released at defined points without having to reference count them.
Re:Zcoin implementation bug enabled attacker to create over ... by NKCSS on Tuesday March 07, 2017 @02:58AM (#13808945)
If they were properly written, I'd accept that, but just take a look at how vastly different things these two are doing:

http://benchmarksgame.alioth.debian.org/u64q/program.php?tes... http://benchmarksgame.alioth.debian.org/u64q/program.php?tes...

Re:Zcoin implementation bug enabled attacker to create over ... by iopq on Tuesday March 07, 2017 @05:18AM (#13809413)
Nobody stops you from submitting a different version that's faster.
Re:Zcoin implementation bug enabled attacker to create over ... by igouy on Tuesday March 07, 2017 @11:50AM (#13811936)
Isn't that the usual explanation for why some program is faster than some other program? They do things differently.