Better HN
topnewbestaskshowjobs
Log inSign up

mzaks

24 karma · joined May 17, 2016 (10y ago) · 20 submissions

Submissions

1.

Me and ClaudeCode swapped Zed's storage layer for Dagr(mzaks.medium.com ↗)

1 points · by mzaks · 2mo ago · discuss

2.

Let's talk about structured logging(medium.com ↗)

1 points · by mzaks · 2mo ago · discuss

3.

We swapped Zed's storage layer for Dagr(gist.github.com ↗)

2 points · by mzaks · 2mo ago · discuss

4.

Show HN: Untapped potential of fixed-size buffers(mzaks.medium.com ↗)

1 points · by mzaks · 3mo ago · discuss

comment 4y ago · link · parent

Not a data structure, but a nice concept for very fast search on immutable pre sorted array, eytzinger order. I did some experiments, it is about 2-3x faster then binary search. https://medium.com/swlh/binary-search-vs-eytzinger-order-301...

comment 6y ago · link · parent

True, I guess it all boils down to ease of use (convenience). You can build a system which accepts schema + data and build dash boards and data relevant relevant processing + optimisations, but that results in a much more complex system with higher entry burden. Sadly convenient systems always get broader adoption.

comment 6y ago · link · parent

If you need a language support for FlexBuffers please create an issue on GitHub repo. I ported it already to Swift, C#, Dart, Python, JS (is in review). If I am familiar with the language you need, it will take me just a couple of days to port it.

comment 6y ago · link · parent

One use case where schema-less is the way to go, when you provide the infrastructure, but have no „ownership“ of data it will be used for. E.g. you build a logging or analytics tool where customers can send arbitrary data. Or a document database as a matter of fact. There schema-less / self described data is a must.

comment 6y ago · link · parent

You forgot Python and C# :). Plus a Unity3D specific version, which is battle tested in a game with more than half a million downloads ;).

10.

Alternative way of building reactive, testable, easy to evolve apps with Flutter(medium.com ↗)

1 points · by mzaks · 7y ago · discuss

11.

LIDL – Interface Definition Language for AWS Lambda(medium.com ↗)

4 points · by mzaks · 7y ago · discuss

12.

Extending JSON with key paths(medium.com ↗)

1 points · by mzaks · 7y ago · discuss

13.

Why I hate code challenges(hackernoon.com ↗)

4 points · by mzaks · 7y ago · discuss

comment 10y ago · link · parent

The good thing about any narrative, it resonates with different people on different levels.

The blog post is in deed titled "10,000 times faster Swift". I though it will be a catchy title even though 6 seconds to 0.35 ms is not factor of 10,000.

I thought about renaming the title to 500 times faster Swift, which would be rathe more accurate insight of current findings, but than what the hack. It's a blog post. I didn't published a scientific paper. I just reflected on my resent work.

The main points of the Blog posts wehere anyways about how it is possible to make low level optimisations to make Swift programs faster. And as a matter of fact the Loop-invariant code motion was a valid technique to get the same result. Result being sum of payload content. The compiler was smarter than me. It gave me the same result doing 250times less work. I find it impressive.

I must be honest I am not fluent in assembly this is why I could not figure it out by myself.

Was I suspicious? Absolutely!!! But the facts were in my face.

Shouldn't I publish an article, where I am not sure why I got what I got? If I wouldn't publish the article, I would not figured out the truth and wouldn't learned form this experience.

And after all, this post is about performance pitfalls in Swift language. The comparison with C was almost accidental. I would compare it with C++ if I would have a Windows machine, as the benchmark for C++ project has Windows specific code. I also consulted with the author of flatcc, who is much more relaxed about my blog post than you are :)

This blog post is about learning something. I learned something before I wrote this post I shared it and now I learned even more.

You should try it yourself.

Maybe not as satisfying as criticising, but it also has it's moments.

comment 10y ago · link · parent

I was suspicious, I just could not put my finger on it :)

   for i in 0..<iterations {
     let result = flatuseStruct(outputData, start:i)
     assert(result == 8644311666 + Int(i))
     total2 = total2 + UInt64(result)
   }
this results in around 42ms compared to C 25ms. I guess I should update my blog post :)

Thanks for your help.

comment 10y ago · link · parent

This makes sense!

Changed the iteration to:

   for i in 0..<iterations {
     let result = flatuseStruct(outputData, start:i)
     assert(result == 8644311666 + Int(i))
     total2 = total2 + UInt64(result)
   }
now result is around 43ms

Thanks for pointing it out. Have to check if there are so other things involved, but that might be it.

comment 10y ago · link · parent

Performance test run on Travis CI in a virtual machine https://travis-ci.org/mzaks/FlatBuffersSwift

function called for decode+use+dealloc https://github.com/mzaks/FlatBuffersSwift/blob/master/FlatBu...

function called for direct: https://github.com/mzaks/FlatBuffersSwift/blob/master/FlatBu...

function called for using struct: https://github.com/mzaks/FlatBuffersSwift/blob/master/FlatBu...

Everything is on Github, you are welcome to try it out on your own machine.

comment 10y ago · link · parent

I Updated the run bench function

https://gist.github.com/mzaks/e3a2dc7ccdfc2397bc26c55eb6dc8a...

the output is now:

  Eager run
  =================================
  1557 ms encode
  264 ms decode
  34 ms use
  206 ms dealloc
  504 ms decode+use+dealloc
  0,38 ms direct
  0,32 ms using struct
  =================================
  Total counter1 is 8644311667000000
  Total counter2 is 8644311667000000
  Total counter3 is 8644311667000000
  Encoded size is 315 bytes, should be 344 if not using unique strings
  =================================

As you can see all three counters are equal.