Skip to content

Instantly share code, notes, and snippets.

View rogeralsing's full-sized avatar
😈
Feeling Awesome

Roger Johansson rogeralsing

😈
Feeling Awesome
View GitHub Profile
package proto
open class LocalContext : IMessageInvoker, IContext, ISupervisor {
companion object {
private val logger : ILogger = Log.createLogger<LocalContext>()
internal fun defaultReceive (context : IContext) : Task {
var c : LocalContext = LocalContextcontext
if (c.message is PoisonPill) {
c.self.stop()
Msbuild failed when processing the file 'C:\git\ProjectExodus\democode\Proto.Mailbox\Proto.Mailbox.csproj' with message: C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Roslyn\Microsoft.CSharp.Core.targets: (71, 5): The "Csc" task could not be instantiated from the assembly "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Roslyn\Microsoft.Build.Tasks.CodeAnalysis.dll". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. Unable to cast object of type 'Microsoft.CodeAnalysis.BuildTasks.Csc' to type 'Microsoft.Build.Framework.ITask'.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Roslyn\Microsoft.CSharp.Core.targets: (71, 5): The "Csc" task has been declared or used incorrectly, or failed during construction. Check the s
-module(router).
-author("ROJO01").
-export([start/2]).
start(N, F) ->
Workers = spawn_workers(N, [], F),
spawn(fun() -> round_robin_router(Workers, 0) end).
round_robin_router(Workers, Next) ->
receive
-module(pingpong).
-author("ROJO01").
-export([run/0, ping/3, pong/1]).
-define(BATCH, 100).
-define(CONCURRENCY, 20).
-define(MESSAGES, 1000000).
ping(Pong, Num, ReplyTo) ->
receive
{start, NewPong} ->
-module(pingpong).
-author("ROJO01").
-export([run/0, ping/2, pong/0]).
ping(Num, ReplyTo) ->
receive
{msg, Pong} ->
case Num of
0 -> ReplyTo ! done;
N when N rem 100 == 0 ->

My experiences with writing high performance .NET vs Go code.

Generally, writing fast Go code is easier. This comes down to two reasons:

The Go scheduler will yield on sys and function calls. You simply write "normal" sequential code and it will perform really well under high concurrent load.

In .NET, we have the TPL and async await. .NET is capable of high performance concurrent code, using Tasks works well for this.

protoc -I=. -I=%GOPATH%\src\github.com\gogo\protobuf\protobuf -I=%GOPATH%\src --gogoslick_out=Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,plugins=grpc:. protos.proto
REM do not that %GOPATH%\src\github.com\gogo\protobuf\protobuf is mapped as a root path
At Asynkron, we manage a lot of open source projects and we’re required to have agreements with everyone who takes part in them.
It’s the easiest way for you to give us permission to use your contributions.
In effect, you’re giving us a licence, but you still own the copyright — so you retain the right to modify your code and use it in other projects.
using System;
using System.Diagnostics;
using Akka.Actor;
namespace SpawnTest
{
internal class Request
{
public long Div;
public long Num;
ZeroFormatter
Serialize 620 ms
Deserialize 131 ms
Size 65 bytes
Total 751 ms
ZeroFormatterWithPooling
Serialize 519 ms
Deserialize 162 ms
Size 65 bytes
Total 681 ms