Live data from Hacker News

How is Ultrassembler so fast?

jghuff.com

11–20 of 53 posts

Re: How is Ultrassembler so fast?

#11
post #10
post #3

Hi everyone, I'm the author of this article. Feel free to ask me any questions to break the radio silence!

What's the difference between a Programming Furu and a Programming Guru? Is there a joke I'm missing?

Furus are "fake gurus." It comes from the Fintwit space where "furus" share their +1000% option trades as if they're geniuses in order to get you to sign up for their expensive Substack.

Re: How is Ultrassembler so fast?

#12
I wonder if you thought about perfect hashing instead of that comparison tree. Also, flex (as in flex and bison) can generate what amounts to trees like that, I believe. I haven't benchmarked it compared to a really careful explicit tree though.

Re: How is Ultrassembler so fast?

#13

I wonder if you thought about perfect hashing instead of that comparison tree. Also, flex (as in flex and bison) can generate what amounts to trees like that, I believe. I haven't benchmarked it compared to a really careful explicit tree though.

I thought about hashing, but found that hashing would be enormously slow to compute compared to a perfectly crafted tree.

Re: How is Ultrassembler so fast?

#14

I wonder if you thought about perfect hashing instead of that comparison tree. Also, flex (as in flex and bison) can generate what amounts to trees like that, I believe. I haven't benchmarked it compared to a really careful explicit tree though.

I thought about hashing, but found that hashing would be enormously slow to compute compared to a perfectly crafted tree.

But did you think about using a perfect hash function and table? Based on my prior research, it seems like they are almost universally faster on small strings than trees and tries due to lower cache miss rates.

Re: How is Ultrassembler so fast?

#15
post #3

Hi everyone, I'm the author of this article. Feel free to ask me any questions to break the radio silence!

isn't your MemoryBank already somewhere in std::pmr?

If I'm honest, I've never looked into pmr, but I always thought that that's where std has arena allocators and stuff

https://en.cppreference.com/w/cpp/header/memory_resource.htm...

Re: How is Ultrassembler so fast?

#16
post #14

Earlier quoted context omitted.

I thought about hashing, but found that hashing would be enormously slow to compute compared to a perfectly crafted tree.

But did you think about using a perfect hash function and table? Based on my prior research, it seems like they are almost universally faster on small strings than trees and tries due to lower cache miss rates.

Ditto. Perfect hashing strings smaller than 8 bytes has been the fastest lookup method in my experience.

Re: How is Ultrassembler so fast?

#17
post #3

Hi everyone, I'm the author of this article. Feel free to ask me any questions to break the radio silence!

You might look into using memory mapped IO for reading input and writing your output files. This can save some memory allocations and file read and write times. I did this with a project where I got more than 10x speed up. For many cases file IO is going to be your bottleneck.

Re: How is Ultrassembler so fast?

#18
post #16
post #14

Earlier quoted context omitted.

But did you think about using a perfect hash function and table? Based on my prior research, it seems like they are almost universally faster on small strings than trees and tries due to lower cache miss rates.

Ditto. Perfect hashing strings smaller than 8 bytes has been the fastest lookup method in my experience.

Problem is, there are a lot of RISC-V instruction way longer than that (like th.vslide1down.vx) so hashing is going to be slow.
Post reply on HN