.NET Core 1.0 : a giant leap in .net world

Microsoft, finally released its new generation of .net framework named .NET Core on June 27th 2016. I believe, this version would be a turning point in .net development and would be a giant leap in .net stack.

The reason why I believe so, being the combination of C# language  features and convenience of coding plus a significant improvement in the framework’s performance, as well as cross-Platform support for major operating systems like Windows, Linux and MacOS . Adding the open source code and potentially growing community to that, I believe it’s not just yet another .net version, but a foundation for a new powerful technology stack.

The benchmarks published on Github are showing exciting results :

https://github.com/aspnet/benchmarks

Here is an example of benchmarks done on HTTP server, showing that .NET performs 3x faster than NodeJS!!! Which sounds unbelievable to me! Check out this comparative benchmark copied from the mentioned GitHub page :

Plain Text Performance benchmark

Similar to the plain text benchmark in the TechEmpower tests. Intended to highlight the HTTP efficiency of the server & stack. Implementations are free to cache the response body aggressively and remove/disable components that aren’t required in order to maximize performance.

Stack Server Req/sec Load Params Impl Observations
ASP.NET 4.6 perfsvr 57,843 32 threads, 256 connections Generic reusable handler, unused IIS modules removed CPU is 100%, almost exclusively in user mode
IIS Static File (kernel cached) perfsvr 276,727 32 threads, 512 connections hello.html containing “HelloWorld” CPU is 36%, almost exclusively in kernel mode
IIS Static File (non-kernel cached) perfsvr 231,609 32 threads, 512 connections hello.html containing “HelloWorld” CPU is 100%, almost exclusively in user mode
NodeJS perfsvr 106,479 32 threads, 256 connections The actual TechEmpower NodeJS app CPU is 100%, almost exclusively in user mode
NodeJS perfsvr2 (Linux) 127,017 32 threads, 512 connections The actual TechEmpower NodeJS app CPU is 100%, almost exclusively in user mode
ASP.NET Core on Kestrel perfsvr 313,001 32 threads, 256 connections Middleware class, multi IO thread CPU is 100%
Scala – Plain perfsvr 176,509 32 threads, 1024 connections The actual TechEmpower Scala Plain plaintext app CPU is 68%, mostly in kernel mode
Netty perfsvr 447,993 32 threads, 256 connections The actual TechEmpower Netty app CPU is 100%

To be honest, I can’t believe such a performance improvement yet, I need to touch it myself and do my own benchmark! I’ll be sharing my results and writing about it in the future.

By the way, if you’re into Docker, there is a docker image for .NET core downloadable from here : https://www.microsoft.com/net/core#docker

Advertisements

Robotics and IoT through Cylon.js

In this topic, I’m going to introduce a cool JavaScript library for Robotics and IoT lovers. It’s called Cylon.

Using this library you can easily interact with other devices whether through a web browser or server-side NodeJs code.

Cylon brings the exciting robotics and the Internet of Things world to JavaScript. At this point of time it supports 50+ different platform devices plus a general purpose I/O supports with a shared set of drivers provided by cylon-gpio module.

The figures below show the most famous platforms supported by Cylon. You can find a full list of them here.

Cylon supported platforms
Cylon supported platforms
2
Cylon supported platforms

Using these 3 basic plugins, Cylon enables you to send and receive data with other devices even in a real-time streaming manner:

  • http/https (REST)
  • socket.io library
  • MQTT(an Internet of Things machine to machine connectivity protocol)

Here are some examples of using Cylon :

The code below contols an ARDrone, takes off and then lands again:

"use strict";

var Cylon = require("cylon");

Cylon.robot({
  connections: {
    ardrone: { adaptor: "ardrone", port: "192.168.1.1" }
  },

  devices: {
    drone: { driver: "ardrone" }
  },

  work: function(my) {
    my.drone.takeoff();
    after((10).seconds(), my.drone.land);
    after((15).seconds(), my.drone.stop);
  }
}).start();

Working as a software architect and developer on Network and Environment monitoring applications, I think it would be a great API gateway for the next generation of monitoring applications.  And I strongly believe that the combination of devices like smart phones, drones, sensors, robots, and so forth plus libraries like Cylon.js and cloud services like AWS IoT, would open new horizons of innovation in the new future, and makes the world much closer to what we would imagine in the Sci-Fi movies.

If Cylon is of your interest take a look into these tutorials and samples:

https://cylonjs.com/documentation/examples/

https://cylonjs.com/documentation/tutorials/dreamforce-2014/