Better HN
topnewbestaskshowjobs
Log inSign up

meisel

645 karma · joined Feb 10, 2020 (6y ago) · 166 submissions

Submissions

comment 1y ago · link · parent

TurboTax and other tax companies don’t just lobby to prevent a free filing solution, they also lobby for more complicated tax laws to create a greater need for their product

comment 1y ago · link · parent

If you’re at the point where the shell might be a bottleneck to your script, it probably should be written in a proper language and not bash

comment 1y ago · link · parent

Got it, so this could not be extended to non-literal strings

comment 1y ago · link · parent

How does this work under the hood? Does Ruby keep a giant map of all strings in the application to check new strings against to see if it can dedupe? Does it keep a reference count to each unique string that requires a set lookup to update on each string instance’s deallocation? Set lookups in a giant set can be pretty expensive!

comment 1y ago · link · parent

What would you call TypeScript’s tsc, which translates TS to JS? Microsoft would say it’s a compiler: https://code.visualstudio.com/docs/typescript/typescript-com...

comment 1y ago · link · parent

I believe there’s no other allocator besides jemalloc that can seamlessly override macOS malloc/free like people do with LD_PRELOAD on Linux (at least as of ~2020). jemalloc has a very nice zone-based way of making itself the default, and manages to accommodate Apple’s odd requirements for an allocator that have tripped other third-party allocators up when trying to override malloc/free.

comment 1y ago · link · parent

What are the advantages of this over using higher order functions? In Ruby I can do list.map { }.select { } …. That feels more natural (doesn’t require special language support), has a very rich set of functions (group_by, chunk_while, etc.), and is something the user can extend with their own methods (if they don’t mind monkeypatching)

comment 1y ago · link · parent

This title should have “How” prepended to it

comment 1y ago · link · parent

I figured it might, but I think that this is a top of mind question for people and would be nice to make clear in the comments of the post too. So often there’s some theoretical improvement on multiplication that isn’t actually practical. Regardless, they don’t seem to have posted results for CUDA, which is arguably more important than CPU multiplication which is what they tried

comment 1y ago · link · parent

Is this like the Karatsuba algorithm, where it's theoretically faster but not actually faster when run on real hardware?

Btw, it's worth noting that if you know that the result will be symmetric (such as is the case for X * X^T), you can make things faster. For example in cuBLAS, cublas*syrk (the variant optimized for when the result is symmetric) IME isn't faster than gemm, so what you can do instead is just do smaller multiplications that fill in one of the two triangles piece by piece, and then copy that triangle to the other one.

comment 1y ago · link · parent

Aren't there some scripting languages designed around seamless interop with Rust that could be used here for scripting/prototyping? Not that it would fix all the issues in that blog post, but maybe some of them.

comment 1y ago · link · parent

I’m surprised this isn’t getting more love. My experience with other debuggers with Rust was quite poor, I hope this one can fare much better. For example, I couldn’t call functions with previous debuggers

comment 1y ago · link · parent

These variable-length arrays are getting quite advanced

comment 1y ago · link · parent

Aside from sanitization, this also allows replication of Ruby’s %W[…] syntax

comment 1y ago · link · parent

The template error messages look great. I wonder if it’s worth writing a translator from clang/gcc messages to these ones, for users of clang and older gcc (to pipe one’s error messages to)

comment 1y ago · link · parent

Looking forward to it!

comment 1y ago · link · parent

Personally I prefer bfs (https://github.com/tavianator/bfs) because it does a breadth-first search

comment 1y ago · link · parent

One of the big bottlenecks of plotting libraries is simply the time it takes to import the library. I’ve seen matplotlib being slow to import, and in Julia they even have a “time to first plot” metric. I’d be curious to see how this library compares.

comment 1y ago · link · parent

The fastest thing I would think is to process 255 vectors at a time, using an accumulation vector with the k-th byte in the vector representing the # of evens seen for the k-th byte of the vectors in that 255-vector chunk. But, I don’t know how to make autovectorization do that. I could only do that with intrinsics.

comment 1y ago · link · parent

Seems like you can do this sort of speed up even without the 256 constraint. Just run this sped up version, but after each set of 256 iterations, dump all the 8-bit counters to the 64-bit final result.

comment 1y ago · link · parent

This article presents a readable overview of today’s NBA trends, but IMO is too absolute in its judgment. Basketball is not a solved sport. There is still innovation, for example with OKC’s historically good defense that relies on playing 5 smaller but faster players. There are still good all-around players. There are still people that hit a lot of mid range shots. We have trends going the other way, sure, but they have their own set of tradeoffs and are neither a total solution nor totally embraced in the NBA. Teams will continue to evolve based on the talents of people at their disposal and their own innovative ideas.

comment 1y ago · link · parent

Would allocating a 640-byte string initially really be the right tradeoff? It seems like it could result in a lot of memory overhead if many small strings are created that don’t need that space. But it does save a copy at least

As for the int-to-string function, using the division result to do a faster modulus (eg with the div function) and possibly a lookup table seem like they’d help (there must be some good open source libraries focused on this to look at).

comment 1y ago · link · parent

Do you expect that Apple’s bigger security initiatives, like pointer authentication and writing the OS in a memory safe language, will improve the situation?

comment 1y ago · link · parent

Take a look at SAX parsers

comment 1y ago · link · parent

All of the would be a big savings in code complexity and a win for reliability, compared to doing new untested optimizations. If memory usage is a concern, I’m sure there’s a fast C SAX parser out there (or maybe one within yyjson)

comment 1y ago · link · parent

yyjson is a very fast C89 compliant C parser that can both parse and generate JSON

comment 1y ago · link · parent

Very fun read! I’m curious though, when it comes to non-Ruby-specific optimizations, like the lookup table for escape characters, why not instead leverage an existing library like simdjson that’s already doing this sort of thing?

comment 1y ago · link · parent

It could be improved even more, performance wise. The potentially expensive modulo could be avoided entirely with an if statement. Or, only use powers of 2 for the capacity, and then you can also use bit wise ops

comment 2y ago · link · parent

I refuse to believe they didn’t notice a key difference in the phones - the iPhone 16 will feel much, much snappier. Games aside, just opening any old app will be much faster. I notice this every time I upgrade, even when it’s just going up 3 versions, not 8.
123456