Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
halayli
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
88 ms
·
901.
▲
by
halayli
15y ago
Are you competitive?
902.
▲
by
halayli
15y ago
You are looking at techniques to merge 2 dictionaries into a new one. Some will find it useful.
903.
▲
by
halayli
15y ago
You cannot have a sane ORM that works with nosql and sql databases without compromising features & complexity. I am glad sqlalchemy deals with sql-only databases. You don't need an ORM for nosql. A library suffice.
904.
▲
by
halayli
15y ago
I wish Django uses sqlalchemy as the default ORM instead of inventing a squared wheel.
905.
▲
by
halayli
15y ago
I really like this book, it start with the very basics: Discrete Mathematics with Applications ( http://www.amazon.com/gp/product/0495391328/ref=oh_o04_s00_i... )
906.
▲
by
halayli
15y ago
first world problem?
907.
▲
by
halayli
15y ago
Consider using lthread for your c version. You'll save time and gain performance. ( http://github.com/halayli/lthread )
908.
▲
by
halayli
15y ago
I think using a generic OS for IO operations is not a good idea in general. We all do it but there got to be a better solution. We don't need kernel/userland isolation that introduces mode switching, stack copying, copying arguments etc...
909.
▲
by
halayli
15y ago
nginx saturates at ~18k req/sec / core with a latency of ~24ms. This saturation is not coming from nginx in particular but from OS limits (mode switching, stack copying etc.. for read/write system calls). There is nothing new in "modern HTT
910.
▲
by
halayli
15y ago
The OP easily dismissed numpy in Python and coroutines (e.g gevent)
911.
▲
by
halayli
15y ago
Things I can think about: - low level memory management - faster execution (in most cases) - cache line optimization - avoiding language implementation magic
912.
▲
by
halayli
15y ago
If you are checking your parameter types then you haven't used python enough.
913.
▲
by
halayli
15y ago
Better called, evil control structures. These macros add little value and makes it harder to understand the code.
914.
▲
by
halayli
15y ago
Why are you assuming it's linear?
915.
▲
by
halayli
15y ago
Tweaking variables.less is enough to make the site look unique. Someone should write a pseudo-random variables.less generator.
916.
▲
by
halayli
15y ago
It looks like a carbon copy of Apple App store / iTunes.
917.
▲
by
halayli
15y ago
Correct. The local variables address change, but you can still access them, and pass them to functions. What you cannot do is save a pointer of a variable and access inside begin()/end(). I thought I added a warning in the lthread_compute_b
918.
▲
by
halayli
15y ago
This has nothing to do with the kernel scheduler. lthread is a coroutine library, you can think of it as a micro task scheduler inside the process (userland). It's ideal for socket programming because it avoids using callbacks and minimizes
919.
▲
by
halayli
15y ago
Yes a coroutine user has to be aware that allocating on the stack has a penalty, similar to being aware that you cannot make a blocking call in an IO loop for example. On average, yielding ~10 calls deep results in copying ~75 to 100 bytes
920.
▲
by
halayli
15y ago
I am not married to the license. I noticed several complaints, so I am going to reconsider it. :)
921.
▲
by
halayli
15y ago
If you don't have large variables allocated on the stack, the copy is quite fast. This is easily avoidable by allocating on the heap.
922.
▲
by
halayli
15y ago
I do have few small code snippets + examples in the docs. https://github.com/halayli/lthread/tree/master/src/examples thanks for the heads up. :)
923.
▲
by
halayli
15y ago
I have a requirement that I couldn't get rid of yet, which requires me to know which scheduler it is going to run on before I let go of it. Once I manage to find a way around it I'll move to a global queue model.
924.
▲
by
halayli
15y ago
What happens is that it will block the other lthreads, bringing down the RPS to its knees. lthreads are simply coroutines and cooperation/trust are required to maintain fairness.
925.
▲
by
halayli
15y ago
It will not create a new pthread in the local scheduler but a local lthread scheduler gets created in the thread context. So if you want to create more than one lthread scheduler, you just have to create a pthread first and the new lthreads
926.
▲
by
halayli
15y ago
I am against IO event loops :). Scroll down to the bottom of the README and look for fibonacci(35) to see how I solve the problem mentioned in the link. The example is a naive HTTP server that computes fibonacci on every request and replies
927.
▲
by
halayli
15y ago
Thanks!
928.
▲
Lthread - C coroutine lib with multicore support
(github.com)
113 points
by
halayli
15y ago
|
73 comments
929.
▲
by
halayli
15y ago
It takes < 10s to reboot osx lion on my end (mba, iMac). My iMac was frequently crashing but it turned out to be from the RAM, Apple changed it and I never saw a crash again. Alas, the title is misleading.
930.
▲
by
halayli
15y ago
Why all the fuss? Email twitter and resolve it with them. Why everyone has to know about such a minor event?
More ›