Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pkolaczk
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
47 ms
·
601.
▲
by
pkolaczk
6y ago
> Delayed destruction (either on another thread or batches) removes the possibility of safely using RAII via finalizers No, it doesn't in general. Delayed destruction can be used selectively only for these object graphs that could c
602.
▲
by
pkolaczk
6y ago
Once upon a time I had an attiny85 chip with no serial interface on the board. Lacking a digital logic recorder in my home lab, I debugged it by blinking a diode. Time consuming, but apparently has worked :)
603.
▲
by
pkolaczk
6y ago
The problem of destructor chains has been solved a long time ago. You can deallocate on another thread or deallocate in small batches during allocations. Also pauses from malloc/free are orders of magnitude smaller than pauses caused b
604.
▲
by
pkolaczk
6y ago
A "rather slow" is quite debatable. Tracing GC gets speed advantage at the cost of much higher memory and energy usage, unpredictable pauses, cache thrashing, etc. If you try to make these things equal, tracing can become embarras
605.
▲
by
pkolaczk
6y ago
Pretty much matches my experience of Rust + Cassandra on a Linux laptop (I get ~250k req/s without database, ~50k with updates).
606.
▲
by
pkolaczk
6y ago
600 requests per second for a hello world not even hitting a database? Are the units right? Shouldn't it be in kilo-requests per second?
607.
▲
by
pkolaczk
6y ago
I don't know about Ruby, but saying Scala and Rust put everything into the language is just totally incorrect. Both are designed with philosophy of building minimal set of features with very strong expressivity. For example Scala 3 rem
608.
▲
by
pkolaczk
6y ago
I program in Python at my job and Rust in a hobby project. It surprised me how easy and productive actually Rust is, and I was really very sceptical initially. I know it is very subjective, and possibly a result of my longer exposure to sta
609.
▲
by
pkolaczk
6y ago
But is the drive's reordering buffer so deep? NCQ in the system reorders only up to 32 requests. I doubt the drive's firmware is capable of reordering millions of requests. These things have typically small amount of memory, just
610.
▲
by
pkolaczk
6y ago
> If you obtain the inode number by fetching the metadata you're already accessing the inode, defeating a part of the optimization Actually this is what fclones does, because it needs other metadata of the file as well (e.g. its len
611.
▲
by
pkolaczk
6y ago
It would be interesting to try, but probably that wouldn't work as a general-purpose solution. This would require opening all these files at the same time, risking hitting the open-file number limit. Although the limit could be technic
612.
▲
Ordering Requests to Accelerate Disk I/O
(pkolaczk.github.io)
46 points
by
pkolaczk
6y ago
|
29 comments
613.
▲
by
pkolaczk
6y ago
The number of times I was misguided by an outdated comment: 0 The number of times a comment saved my ass, despite being slightly inaccurate: 435 The number of times I struggled to understand what the authors thought when writing "self-
614.
▲
by
pkolaczk
6y ago
I was talking about JITs in general. Sure, you can AOT-compile .NET code quite efficiently, but then this is a different story. Here is a nice analysis of how various JITs warmup in practice: https://tratt.net/laurie/bl
615.
▲
by
pkolaczk
6y ago
> They only need to do that for the hot paths, that’s often a small portion of the code. That's often correct, however unfortunately codebases today can be very, very huge. It can take a really lot of effort to optimize even just 10
616.
▲
by
pkolaczk
6y ago
> JIT runtimes have more input data than a C compiler They have more data, but they are at a disadvantage by being time-pressured. They can't apply costly analysis to these data because they need to compile fast. Therefore typicall
617.
▲
by
pkolaczk
6y ago
Reordering or hinting branches has virtually zero impact on branch prediction performance on modern architectures with advanced hardware branch prediction. What's much more important for good performance is memory layout and good use o
618.
▲
by
pkolaczk
6y ago
Fair point. So what are these limitations in facilities of abstraction that Python doesn't have and Java has?
619.
▲
by
pkolaczk
6y ago
Is Python not an OOP language? I think it is, so OOP design patterns still apply to it. So the differences you observed might be not because of a language itself, but the complexity of projects these languages are applied to and cultural di
620.
▲
by
pkolaczk
6y ago
Ah, I completely agree with what you have written here. My earlier post applied to using the if clause for matching to the variable value instead of capturing the value from the object. I view pattern matching from a bit different angle - i
621.
▲
by
pkolaczk
6y ago
Not sure what boilerplate in Rust or Scala you're talking about. I admit Rust is much harder to learn initially, but once learned properly, the amount of code in both languages is very similar (as long as we're not comparing one p
622.
▲
by
pkolaczk
6y ago
> The most concerning thing is knowing to write that in the first place This is something you learn from reading the docs / book on the feature. This applies to all language features. > Even if you get it right when writing it, w
623.
▲
by
pkolaczk
6y ago
case Point(x, y) if x == something Where's the problem?
624.
▲
by
pkolaczk
6y ago
I started the other way round and came to Python long after I coded a lot in statically typed languages like Object Pascal, C++, Java, Scala and Rust. My feelings about Python are quite opposite to yours. I'm actually quite surprised h
625.
▲
by
pkolaczk
6y ago
Minor correction: Poland is not Eastern Europe. Also correlation is not causation. Generally eastern countries of former Soviet Union are poorer than western ones. EVs are more expensive than traditional cars, so obviously fewer people can
626.
▲
by
pkolaczk
6y ago
Yes. Actually a brand new Mazda Cx-5. During the first 4 years it had 2 very minor mechanical issues covered by warranty and 1 minor electrical issue - broken USB (but not sure if that wasn't mechanical really, these ports are often fr
627.
▲
by
pkolaczk
6y ago
Fair point about Tesla. Basically you have to pay a lot for a car with such performance, so the price of battery vs the price of a powerful enough really big ICE is attractive. But that's still a niche of the market, most people don&#x
628.
▲
by
pkolaczk
6y ago
Correct. But isn't there also 30x more EVs?
629.
▲
by
pkolaczk
6y ago
This, but also faster charging and abundance of chargers is needed. I can drive an ICEV / HEV / PHEV anywhere in Europe and refueling is no problem. I can't do that with an EV. And even if I find a charging station, it might
630.
▲
by
pkolaczk
6y ago
As I said, lower fuel costs is quite debatable and heavily depends on the region and what you will use the car for. If you can't charge it at home like many people living in dense city areas, or if you drive long distances, then you&#x
More ›