Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pkolaczk
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
20 ms
·
241.
▲
by
pkolaczk
3y ago
There is not enough data to conclude that. There are 3 Java implementations slower than the faster Rust one, and there are 2 Java implementations faster. But there are only 2 data points for Rust in total. Also, technically there is nothing
242.
▲
by
pkolaczk
3y ago
Depends on the application. In area of compilers, databases, CAD, game engines, simulation, distributed analytics, machine learning the only code that isn't on the critical path is some configuration / control plane / UI - w
243.
▲
by
pkolaczk
3y ago
> Java has a ridiculously fast new operator. Much faster than the one in C++. Can you point us to some benchmarks? I don't doubt it is faster, but I doubt the "ridiculously" part. Last time I measured it was only a tad fas
244.
▲
by
pkolaczk
3y ago
I noticed people have very low expectations about modern application performance. My mom finds it completely reasonable that her TV or car audio need 5-10 seconds to boot. I guess that because almost everything is a web-page now (including
245.
▲
by
pkolaczk
3y ago
I don't think replacing one bad idea with another bad idea is a good idea ;) I'm also not sure if Java would be less bad in that case. At least JS has years of research that went into making it start fast, not only run fast after
246.
▲
by
pkolaczk
3y ago
> If the allocations die trivially (the extreme/vast majority do) in the young gen Low pause GCs (ZGC, Shenadoah) for Java are not generational yet. Also, even if they were, a very high temporary object allocation rate increases you
247.
▲
by
pkolaczk
3y ago
> It is quite common that you only need to optimize very small parts of a program to this level. It's a quite common myth developers believe about performance. Hotspots do happen sometimes, but once they have been optimized you quic
248.
▲
by
pkolaczk
3y ago
The problem of GC pauses is solved only if you can afford to waste 5x-20x more memory than the app is really using. Otherwise those low-pause modern collectors can burn a significant number of CPU cycles or even fall into emergency STW path
249.
▲
by
pkolaczk
3y ago
Sure, you can write Java like C and get performance typically within 0.3x to 1x of C. But Java written in this style is even less ergonomic than C is, so if you have to do do it, there is not much point in using Java.
250.
▲
by
pkolaczk
3y ago
> but in general JIT should really out-perform "native" statically compiled compilers on most real-world workloads. In theory, yes, but in practice I've never seen it happen. Best I ever saw was matching C speed at toy ben
251.
▲
by
pkolaczk
3y ago
func firstName[T AsBytes](name T) T Ok, I stand corrected. Can you define AsBytes for string then?
252.
▲
by
pkolaczk
3y ago
> Please don't respond by saying "this API was badly designed in the first place!" Most languages don't give you the opportunity to design APIs badly in this particular way. If all APIs were perfectly designed on day
253.
▲
by
pkolaczk
3y ago
By writing: first_name<'a>(name: &'a str) -> &'a str you promised the caller that the output is built directly from the input slice. That is your choice. I'll show you later that you didn't
254.
▲
by
pkolaczk
3y ago
> If version 1 of your library has a function that returns a reference to T, then that constrains your choices of implementation for the underlying data structures containing Ts more than they would be constrained in a garbage-collected
255.
▲
by
pkolaczk
3y ago
> A libraries next version which switches up some internal representations memory handling should ideally not mess up your application It doesn't have to because internal memory representation can and should be abstracted out, and R
256.
▲
by
pkolaczk
3y ago
> It has some syntactic sugar for it in the form of a compiler-enforced RAII, but that is still manual memory management for all practical purposes. Then you've got a different definition of "manual" than mine. Manual mea
257.
▲
by
pkolaczk
3y ago
> there are tools that don't require manual memory management or being pedantic about the different types of strings. You could just use Go, Java, Haskell, Python, etc. 1. Rust doesn't force you to do manual memory management.
258.
▲
by
pkolaczk
3y ago
> Do you have any plans on adding the gui to FlatHub as well? Yup, why not. I just need to learn how to do it first. :)
259.
▲
Show HN: Fclones-GUI – a fast duplicate file finder with GTK4 interface
(github.com)
4 points
by
pkolaczk
3y ago
|
3 comments
260.
▲
by
pkolaczk
3y ago
> You build safe abstractions around the ugly low-level pointer handling, you just don't have a keyword for a clear delineation. The main difference is they are not really safe. It is trivial to accidentally invoke UB with incorrect
261.
▲
by
pkolaczk
3y ago
> Everyone just started using unchecked exceptions because they provide an easier coding experience. This is because checked exceptions, contrary to Result, are much more limited/annoying e.g. they don't compose well with lambd
262.
▲
by
pkolaczk
3y ago
> It's better to get something to work first and then optimize performance later than the other way around. I see it repeated a lot without any justification. And I observe that in practice a reverse statement is true. If you make s
263.
▲
by
pkolaczk
3y ago
> Go is for Google, Google uses many languages beside Go, and I doubt Go is used much outside of cloud infrastructure stuff. E.g. Fuchsia/Android/Chrome add a lot of Rust code recently, but not Go. In Fuchsia, Rust already surp
264.
▲
by
pkolaczk
3y ago
Not sure why you're downvoted. DevOps is definitely a place where I see Go used most often. Go has a fast compiler giving it a scripting-like feel, very low memory and disk footprint overhead, it is also easy to learn and easy to deplo
265.
▲
by
pkolaczk
3y ago
> It adds mental overhead. The borrow checker removes the mental overhead of borrow-checking. You don't have to do it by yourself, you can lean on the borrow-checker to do that for you. In C++ you're all by yourself. You may pr
266.
▲
by
pkolaczk
3y ago
Running Ubuntu LTS and that was the version from the official repo. Will try a newer version then.
267.
▲
by
pkolaczk
3y ago
Yes, again ChatGPT was better than just random search. If writing this blog post teaches me something, then it teaches me to use ChatGPT more not less ;) BTW, I fixed the 1M benchmark and Elixir is included now.
268.
▲
by
pkolaczk
3y ago
Fixed already.
269.
▲
by
pkolaczk
3y ago
> When the implementation detail involves whether or not the function will perform I/O, it is better to let that leak. I guess Haskell is fully based around that idea :)
270.
▲
by
pkolaczk
3y ago
For majority of those benchmarks it produced the right code from the first go. It struggled more with Java VirtualThreads - probably fewer programs in the training set. It also had a tendency to overcomplicate things (adding unncecessary co
More ›