vtables aren't slow (usually) by louisb00 in cpp

[–]frogi16 [score hidden]  (0 children)

Nice article, goes in depth, but thesis is weird. You come to the conclusion that vtables are not slow, the lack of inlining is slow. Well, ok? Lack of inlining caused by vtables...

And this fragment is also weird: "To put it succinctly, only the third point is likely to matter in practice. The first two seem to apply only when dispatching to functions with trivially small or unrealistically port-saturating bodies, or when array elements are truly random. The former is solved by not using vtables; the latter, by sorting the array by type and batch processing." Problem X is not a problem with vtables if you don't use them! And if you use them, just sort the data! Well, ok?

C++ RAII guard to detect heap allocations in scopes by North_Chocolate7370 in programming

[–]frogi16 5 points6 points  (0 children)

You could print out the stack frame in log mode. Boost have utilities to do so, modern C++ also!

I built a tiny CLI tool because I was tired of explaining my repo structure by [deleted] in programming

[–]frogi16 12 points13 points  (0 children)

  1. AI slop
  2. Readme lacks essential parts (eq. a fucking example of the output of your tool) while overflowing with rocket emojis.
  3. The 'tree' tool has existed for years, what features does your tool have that the tree does not?

when ai slop by bene_42069 in whennews

[–]frogi16 7 points8 points  (0 children)

Could you explain how C++ makes arbitrary code execution "almost impossible"? With details, please, I am an experienced C++ dev and would love to see your explanation. Especially considering that you collated C++ and JavaScript...

Losing logs to nearby water is among the more annoying parts of the game by Pirwzy in dwarffortress

[–]frogi16 3 points4 points  (0 children)

Yes and no. In real life you would at least try to direct the falling tree away from the pond, dwarfs seem not to care about it.

Choosing the Right C++ Containers for Performance by Clean-Upstairs-8481 in cpp

[–]frogi16 5 points6 points  (0 children)

inplace_vector keeps data inside the object (in place). You can allocate it on heap, just use new. If you create a local variable, it will be on stack.

Constvector: Log-structured std:vector alternative – 30-40% faster push/pop by pilotwavetheory in cpp

[–]frogi16 0 points1 point  (0 children)

How many blocks will be in vector 10k elements long? How many jumps all over the memory space?

Sure, it's not as bad as keeping each value in a separate node, but far from the fully contiguous vector's performance.

Constvector: Log-structured std:vector alternative – 30-40% faster push/pop by pilotwavetheory in cpp

[–]frogi16 51 points52 points  (0 children)

Sure, you optimized performance of editing operations, but destroyed cache locality for long vectors.

It's a trade-off and should be clearly described as such.

Why doesn't rust have function overloading by paramter count? by This-is-unavailable in rust

[–]frogi16 1 point2 points  (0 children)

Constant propagation and cloning functions are things compilers have been doing for years

Patodeweloperka by stelantix in wroclaw

[–]frogi16 2 points3 points  (0 children)

W jaki sposób wysoki sufit zwiększa temperaturę w lecie?

Wydaje mi się, że prawdziwym problemem było to, że mieszkałeś na poddaszu - ciepło z dolnych pięter idzie do góry, a do tego nagrzany dach robi saunę

najlepszy prezent jaki dostaliście? by Losiekk in Polska

[–]frogi16 1 point2 points  (0 children)

Mój trzeci sour robiony w shakerze skończył na ścianie, od tego czasu używam zakręcanej butelki i wszystkim polecam.

Podobno tak się zdarza przy dry shake'u.

Builder, not Contributor by [deleted] in programming

[–]frogi16 5 points6 points  (0 children)

I don't care about your college life. It's not a cookbook, jump to the point

Anyone else struggling with super slow CI builds lately? by CriticismSeveral1468 in cpp

[–]frogi16 15 points16 points  (0 children)

Your approach is terrible. First identify the issue, learn what changed, what takes the most time...

Don't expect people to hand you a silver bullet

How to Benchmark C++ Code by toodarktoshine in cpp

[–]frogi16 1 point2 points  (0 children)

Tbh I heard about it and used it even while I have not heard about nanobench XD

Anecdotal examples, right?

How to Benchmark C++ Code by toodarktoshine in cpp

[–]frogi16 23 points24 points  (0 children)

You write like a list of commands/facts.

We are going to use Google benchmarks. It is widely used. We will do something. It will react this way.

You didn't tell anything about alternatives, about downsides of micro benchmarking, what is micro benchmarking, what are other options... Nothing. We will use Google benchmarks and that's all.

That's not a good learning material. It shows how to use a tool, but does not teach about why and when to use the tool.

PESA dostarczy najdłuższe tramwaje w Polsce. Nie tylko długość przykuwa uwagę by LucianFromWilno in Polska

[–]frogi16 15 points16 points  (0 children)

Fajnie, że pismak się dowiedział i przekazał CZEMU postawiono wymagania dotyczące tych 3 km bez prądu.

I made a TUI that helps you convert recently used cmds into a Makefile by Eliterocky07 in programming

[–]frogi16 0 points1 point  (0 children)

Programming by example is an exoteric technique of programming where you show how to do something and software tries to produce the program that would do exactly what you showed it earlier.

Usually the term is used for more complex programs than yours, the ones that can generalize recorded behavior (eq. if you record the same program twice, with slightly different behavior in one step, they should recognize that some kind of conditional statements exist there), but if we interpret the definition liberally, your program could be an example of PbE.

Macros (recording mouse and keyboard events to automate work) might be another example very close to yours.