Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
attractivechaos
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
31.
▲
by
attractivechaos
2y ago
You are implementing a closed hash table with linear probing. You need tombstones to mark deleted items, or better, move other items to replace deleted items [1]. Currently your library doesn't have either mechanism. [1] https:/&
32.
▲
by
attractivechaos
2y ago
If you double a memory block with realloc, the memory may be relocated to a different address (at least on MacOS). Then all pointers pointing to the old block will be invalid. This can be addressed by adding new blocks to a list. It will be
33.
▲
by
attractivechaos
2y ago
In my limited experiences in both languages, it is easier to write inefficient programs in swift. With rust, follow your instinct. As long as it compiles, the performance is usually close to your expectation. With swift, the result may surp
34.
▲
by
attractivechaos
2y ago
The "node" binary on my laptop is 45MB in size. I guess the browser component may take more disk space than JS runtime. Similarly, I am not sure whether JS runtime or webpage rendering takes more RAM. If it is the latter, an AOT c
35.
▲
by
attractivechaos
2y ago
> there's quite a lot that can be improved in JS during compile time I wonder how much performance gain you expect to achieve. For simple CPU-bounded tasks, C/Rust/etc is roughly three times as fast as v8 and Julia, whic
36.
▲
by
attractivechaos
3y ago
> Opera has been bundling in a mail client, rss reader, calendar app etc for ages now No longer the case since they switched to Blink. Nonetheless, Opera still comes with more built-in functionality than other browsers, such as ad bloc
37.
▲
Possibly the fastest online Sudoku solver
(emerentius.github.io)
3 points
by
attractivechaos
3y ago
|
0 comments
38.
▲
by
attractivechaos
3y ago
The V devs have promised a lot, have missed a lot but have also achieved a lot. I have written a few short programs in V. IMHO, the V syntax is concise and intuitive and the performance is good. It is lightweight and easy to install and to
39.
▲
by
attractivechaos
3y ago
> Do many in academia advocate that? That was my impression whenever paid review was mentioned. Nonetheless, it is also possible that more who dislike the idea were not voicing themselves.
40.
▲
by
attractivechaos
3y ago
This is also why I think paid review won't work although many in academia advocate that. If paper mill remains a problem now, review mill will be much worse when journals start to pay reviewers.
41.
▲
by
attractivechaos
3y ago
Actually the awk solution in the blog post doesn’t load the entire dataset into memory. It is not limited by RAM. Even if you make the input 100x larger, mawk will still be hundreds of times faster than Hadoop. An important lesson here is s
42.
▲
by
attractivechaos
3y ago
I think the analogy is more like: why open a can with a better screwer when you can open it with a can opener. Use the right tool for the right task.
43.
▲
by
attractivechaos
3y ago
> D went from a language that I remember back in 2015 was often promoted on places like reddit and here as a fresh alternative to C++ that was constantly evolving I wrote a blog post in 2012 about D [1]. In my personal experience, the
44.
▲
by
attractivechaos
3y ago
PyPy is only twice as slow as v8 and is about an order of magnitude faster than CPython. It is quite an achievement. I would be very happy if CPython could get this performance but I doubt.
45.
▲
by
attractivechaos
3y ago
> There were no noticeable performance improvements in the course of the last two years. In fairness, Python did get faster. Python 3.9 took 82 seconds for sudoku solving and 62 seconds for interval query. Python 3.11 took 53 and 43 se
46.
▲
by
attractivechaos
3y ago
I wouldn't be so enthusiastic. Look at other languages that have JIT now: Ruby and PHP. After years of efforts, they are still an order of magnitude slower than V8 and even PyPy [1]. It seems to me that you need to design a JIT impleme
47.
▲
by
attractivechaos
3y ago
The nim syntax only looks like python on the surface. It actually feels quite different when more complex language features are involved. Nim is more restrictive than python and harder to write. IMHO, nim is not the language that common pyt
48.
▲
by
attractivechaos
3y ago
Figure updated. Now swift is pretty fast on nqueen+matmul but it has the longest green bar (i.e. longest running time for sudoku). This looks ... interesting. There are only 20 thousand array allocations in total, not a lot. Javascript also
49.
▲
by
attractivechaos
3y ago
System.Numerics.Tensors is disqualified because it uses a different algorithm. If you have a faster matmul implementation in Vector<T>, a PR will be much appreciated. Thank you in advance.
50.
▲
by
attractivechaos
3y ago
Of course! Please implement at least nqueen and matmul as they have been implemented in every language in the benchmark.
51.
▲
by
attractivechaos
3y ago
> What is this supposed to demonstrate? It is supposed to show the performance of a language when you have to implement a new algorithm in the language. This may happen if you can't find the algorithm in existing libraries. If you
52.
▲
by
attractivechaos
3y ago
Clarification: the examples are not taken from Rosetta code. Only the n-queens algorithm is inspired by (but still different from) an Rosetta code implementation; otherwise this benchmark has nothing to do with Rosetta code.
53.
▲
by
attractivechaos
3y ago
FYI: rust has been updated to avoid unnecessary bound check in PR #4. It now matches the C version in performance.
54.
▲
by
attractivechaos
3y ago
Just come here to say this has been fixed in PR #2. The figure has been updated accordingly.
55.
▲
Benchmarking 20 programming languages on N-queens and matrix multiplication
(github.com)
163 points
by
attractivechaos
3y ago
|
186 comments
56.
▲
Benchmarking C/C++ hash table libraries for small keys
(github.com)
2 points
by
attractivechaos
3y ago
|
0 comments
57.
▲
by
attractivechaos
3y ago
A main advantage of trees is that keys are ordered. Data structures in this post are not. In this case, an open addressing hash table will be smaller and times faster. If rehashing is a concern, a standard AVL or red-black tree is still the
58.
▲
by
attractivechaos
3y ago
This! I hate iOS’ flat design and the trend after that. When that UI first came out, texts and buttons looked so similar that I often had to poke to distinguish them. Now iOS is not as bad but I still prefer its original 3D design. I guess
59.
▲
by
attractivechaos
3y ago
On your github release page [1], there are both "bun-darwin-x64.zip" and "bun-darwin-x64-baseline.zip". What is the difference between them? Why the "aarch64" binaries don't have the baseline versions? In
60.
▲
by
attractivechaos
3y ago
> There are many earlier papers describing different methods for arriving at similar conclusions. The paper under your link is claiming a recent second bottleneck (in addition to the out-of-Africa one at ~60kya) but the Science paper i
More ›