Can vibed be fast as Go or Python?

Martin Nowak via Digitalmars-d digitalmars-d at puremagic.com
Thu Mar 30 02:55:20 PDT 2017


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 03/28/2017 09:32 AM, Suliman wrote:
> I found very interesting Python async framework japronto 
> https://github.com/squeaky-pl/japronto
> 
> Test show that in some cases japronto may work as fast as Go.
> 
> Can vibed be competitor (or even better) than Go and Python for 
> micro-services?

The answer is clearly yes, it's possible to build services that are
significantly faster in D than in most other languages.
The only thing that could be avoided w/ vibe.d, at the cost of a
horrible callback based API, is the tiny stack switching overhead of
Fibers (which go uses as well). Usually none of that matters as
services are either I/O or processing bound.

For the processing D has a lot of means to avoid additional memory
allocations and indirections necessary in go or Java (not to speak of
dynamic languages), it also offers easy access to SIMD powered array
operations, and can go as low-level as assembly (though you'll
unlikely ever need that).
https://github.com/libmir/mir-glas
https://github.com/kostya/benchmarks

Vibe.d currently undergoes a major rewrite of it's internals that
should result in even better performance figures
(http://dlang.org/blog/2017/03/01/project-highlight-vibe-d/,
https://github.com/vibe-d/vibe-core).

Truth to be told, while people in the D community tend to write very
fast code by default, sometimes almost obsessively, a lot more
engineering power went into other projects, e.g. go has a fairly
complex and optimized Fiber scheduler.

Yet the fact that small D projects are capable to hold their grounds
against major projects w/ dozens of engineers is indicative of the
sweet spot D hits combining performance + productivity.

You might find Liran's talk helpful
http://dconf.org/2016/talks/zvibel.html, basically you can get a
competitive advantage out of choosing D, but should be prepared to
contribute back to the ecosystem and community.

Why not let us know a bit more about what Microservice you have in
mind, so that we can give you a much more specific answer?

- -Martin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCgAGBQJY3NYIAAoJELJzgRYSuxk5pvgP/iPBlVWJl58+ooH94xU3JAiW
GeKsPDATGlEM9HCwRGUaoH3v/+lj1DaNX4g12q6o/uUNc8uhc2rapJ2Bbxp58y2c
H3gcV1lA6EJbsVi1M+FipNoUpvfq1AvBb1+knpX7adgNiD7DGe9tUd116XlQqhRN
heUD6VUodgbJYAa8g+48Buu1stIMKx0qoNRZYePzYtVBlxJcOyee5Qq1XvEGkyF4
VcsuLLkm6lh5WfVDk6QSeUtL7OCGKjYVBmkOxua5lojbCYhvlPjzO54dxQ9CgJ8R
xV922RIl2WMHW+A6vBN/n63Z0alM2WTe0kIGuDsB4MUA9A59/nCbMdt9QCRRsIUk
hiPBAan3DUQoyAEwl10tzWATIIXa9RNjWV8RAbH1Q/fS31rI6IeC/1SZ1/2Z+2gk
0XLv6clZfk1oj9eL80Ba2kH/Rr5Db2j5KcFDXgewwlhP+x9ajUdMkXw/3Wawa8ye
cS6haKcUpkCLdxfKDpmuCMPMdn3uVNC7Xd/5wsphPXWGzvwfjIh1MKC+Tr4qfh9r
IgTZu0Y/raFW7s4ef7UXAjfc9F8+1oLJQE4wA7xbZiXuboE5iyIIGaj7NQZF18CP
aKV21LDnkX4Q+2fF8vA0TqxMMd6QbCe4WBrinKvid0E1FTcUT6Ed4zGKS3nmQAak
o6ubj1zt0VsEEBFbXaeC
=Upyx
-----END PGP SIGNATURE-----


More information about the Digitalmars-d mailing list