Readit News logoReadit News
bogdan-lab commented on Shift-to-Middle Array: A Faster Alternative to Std:Deque?   github.com/attilatorda/Sh... · Posted by u/AttilaT
bogdan-lab · a year ago
The main benefit list gives you comparing to vector is a stable memory. This is often an important property. But lists are slow with an element access. This problem is solved by deque.

Therefore, I argue that alternative to deque has to have a stable memory property. Otherwise, you can just use a vector.

This implementation is trying to do so, btw, but for some reasons it operates with a raw memory under the hood instead of just holding a vector and rotating it here and there. Such approach is unnecessary complicated and error-prone

bogdan-lab commented on How bloom filters made SQLite 10x faster   avi.im/blag/2024/sqlite-p... · Posted by u/avinassh
kebsup · a year ago
You don't go through entire loops everywhere because if there isn't a match in the first two tables, you don't have to check the match with the third table.

It's better to check A x C before A x B if you know that A x C has less matching rows, because the final loop will be shorter.

bogdan-lab · a year ago
Ah, I see the numbers in the example are the numbers of matched rows, not a total number of rows... Make sense. I do not work with databases, did not know that you should pay attention to the order here.
bogdan-lab commented on How bloom filters made SQLite 10x faster   avi.im/blag/2024/sqlite-p... · Posted by u/avinassh
bogdan-lab · a year ago
The article states that order of join matters because then nest loops differently. But we still go through entire loops everywhere. Where do those numbers in the example come from? If we have 1000, 20 and 200 elements in 3 loops, algorithmically, it does not matter in which order you iterate. Complexity is always 1000×20×200.

What am I missing?

bogdan-lab commented on Profiling with Ctrl-C   yosefk.com/blog/profiling... · Posted by u/jstanley
dzaima · a year ago
For something more systematic/reproducible, it's possible to use rr[1] to record the program, and in a replay run to the end (or whatever boundaries you care about), run "when-ticks", and do various "seek-ticks 123456789" below that number to seek to various points in the recording.

I've made a thing[2] that can display that within a visual timeline (interpolated between ticks of the nearest syscalls/events, which do have known real time), essentially giving a sampling flamegraph that can be arbitrarily zoomed-in, with the ability to interact with it at any point in gdb.

Though this is not without its issues - rr's ticks count retired conditional branches, so a loop with a 200-instruction body takes up the same amount of ticks, and thus visual space, as one with a 5-instruction body; and of course more low-level things like mispredicts/stalls/IPC are entirely lost.

[1]: https://rr-project.org/

[2]: https://github.com/dzaima/grr

bogdan-lab · a year ago
rr looks interesting. It should be useful for debugging race conditions or something "random based": once you record the issue it becomes 100% reproducible in your debugger.

Will try it next time when I have such issue. Thank you!

bogdan-lab commented on Founder Mode   paulgraham.com/foundermod... · Posted by u/bifftastic
bogdan-lab · a year ago
This is what I understood from this article:

Manger mode is "hire good people and give them space to do their job". Founders mode is Steve Job's way "<same as manager mode> + make those good people feel important".

There are many founders, who failed to scale their sturtups, because they did something wrong. But it is not because they ALL in fact did the same mistake. It is just many of them can match their particular mistake with the vague concept of "bad manager mode advice".

bogdan-lab commented on Things I've learned building a modern TUI Framework (2022)   textualize.io/blog/7-thin... · Posted by u/willm
bogdan-lab · 2 years ago
This TUI looks pretty, but I cannot imagine situation, when I would actually use it and be ready to pay for it. Probably I am not living in a right environment for it. But in my experience, either people are happy with something truly minimalistic or they try to please a user with GUI right away.

For example, YouTube link in the article showed a possibility to display table with highlighting cells. Why would I need that as TUI? Probably if I want to navigate through table with highlighting active cell I would also need a bunch of other stuff and eventually I would need a proper GUI.

bogdan-lab commented on Clang vs. Clang   blog.cr.yp.to/20240803-cl... · Posted by u/dchest
ndesaulniers · 2 years ago
Compile your code with `-O0` and shut up already.
bogdan-lab · 2 years ago
I would put it differently:

If you want your code to contain specific assembly instructions, code in assembly. Programming language by design is an abstraction of a higher level and when you use it you shouldn't care that much about actual assembly it produces.

bogdan-lab commented on About 130 million adults in the U.S. have low literacy skills (2022)   apmresearchlab.org/10x-ad... · Posted by u/newzisforsukas
viraptor · 2 years ago
While it's going to apply to some specific communities:

> When you migrate to a new country you just naturally get into a bubble of your nationals.

Just keep in mind that's a really bad generalisation. There's different groups migrating for different reasons with/without a family. You don't "naturally" get into any bubble unless you seek one, or have an existing connection to.

bogdan-lab · 2 years ago
When I say "naturally" I imagine the situation, when you stand in a "social desert" and there are two people in front of you. They are the same age, the same profession etc. But the first one is from your native country and the second one is local. In order to communicate with the second person you need to use language you are not native in. There is also some cultural/mentality difference, naively you are not sure which topics you should avoid in discussions. Obviously you will feel a lot of pressure, at least in the beginning, speaking with the second person. When there are no such hurdles between you and your person. You can use your language, you know where the social borders are etc.

In order to make a connection and support it with the second person you need to overcome those hurdles. They may be not big for you. But my point is that they are there. And if human has a choice they naturally chose the easy past.

My point is that if you migrate you rather need to seek (work on) making friends with locals. When, surrounding yourself with people from your country will happen by itself.

Of course I do not know what is the situation for everybody. But this is what I see around me.

bogdan-lab commented on About 130 million adults in the U.S. have low literacy skills (2022)   apmresearchlab.org/10x-ad... · Posted by u/newzisforsukas
bogdan-lab · 2 years ago
In the article they talk so much about funding schools which will improve immigrant literacy. But I think, that funding is not the problem. When you migrate to a new country you just naturally get into a bubble of your nationals. Its much easier to make a connection with other people from your country because of your common experience and culture. Then you just live in this bubble. You are in US, but all your free time you are still talking in your native language with your friends and family. Probably, read news and books in your native language too. So English language just needs to be on the bare minimum to give you a job. Hence low English literacy results.
bogdan-lab commented on Use a work journal   fev.al/posts/work-journal... · Posted by u/charles_f
senkora · 2 years ago
I keep a stack. Whenever I am interrupted, I push a task onto the stack. When I finish a task, I pop it from the stack. Each task has an associated journal file. Sometimes I reorder the stack.
bogdan-lab · 2 years ago
Yes, stack is much better than long-long log. After some time you're log becomes too big and if it contains some points you want to return to, then they are just lost. And if you lose something in it you stop trusting it and do not use it. At least this is my story.

u/bogdan-lab

KarmaCake day21November 15, 2023
About
I am a software engineer, mainly specialized in C++ with huge background in physics
View Original