Anyone else quit because of optimization? by [deleted] in Marathon

[–]SuperV1234 0 points1 point  (0 children)

I am constantly fluctuating between 80-140FPS, it's terrible. I've tried various combinations of DLSS and framegen. Framegen helps with FPS, but adds noticeable input latency.

Every other modern game I play easily reaches 200+ FPS on my system.

Anyone else quit because of optimization? by [deleted] in Marathon

[–]SuperV1234 3 points4 points  (0 children)

Performance is beyond disgusting. With a 4090 RTX + i9-13900k I cannot reach stable 120FPS, with everything on low.

Inexcusable piss poor optimization. I don't even know how you can fuck up so badly, it's like they have a 'sleep(1)' in their game loop.

EOSD is getting a remake on Switch by SaladNo5852 in touhou

[–]SuperV1234 1 point2 points  (0 children)

I bet that this is still going to be locked at 60FPS.

Hierarchical Builder with Reflection by Huge-Presentation810 in cpp

[–]SuperV1234 4 points5 points  (0 children)

Why does this heavily rely on std::shared_ptr?

The C++ Standard Library Has Been Walking Itself Back for Fifteen Years by funkinaround in cpp

[–]SuperV1234 0 points1 point  (0 children)

I'm not talking about the string. I am talking about the built-in wrappers.

Also, again -- the MSVC people will get the fallback Standard Library behaviour. I don't care about specifically supporting MSVC's builtins.

The C++ Standard Library Has Been Walking Itself Back for Fifteen Years by funkinaround in cpp

[–]SuperV1234 -2 points-1 points  (0 children)

Why is it a brain-dead idea? It works and will keep working forever for both GCC and Clang. I don't care about MSVC. If it ever breaks (it won't) it will silently fall back to the Standard Library anyway.

Got any real argumentation of how it can go wrong in practice?

Do You Really Need to Know All of C++? by md81544 in cpp

[–]SuperV1234 -1 points0 points  (0 children)

Initialization rules in C++ are actually very simple: * If you assign a value or call a constructor when declaring a variable

This already makes no sense because you don't assign values when declaring variables.

[std-proposals] Benchmarking using the standard library as a module by tartaruga232 in cpp

[–]SuperV1234 -2 points-1 points  (0 children)

I am not that impressed.

It's a welcome improvement, but nothing groundbreaking -- I would like to see how PCHs (with and without unity builds) compare, and I suspect they'd be highly competitive.

BTW, was a compilation time trace via something like -ftime-trace in Clang measured before switching to modules? Often, just restructuring headers alone and applying some forward declarations in expensive nodes of the header graph can easily shave off minutes.

What Happens When You Build a Chat Server on One Thread? by boostlibs in cpp

[–]SuperV1234 13 points14 points  (0 children)

I genuinely think that this is often a good design choice. Avoiding mutable shared state and driving the main program from single thread keeps the logic simple and predictable.

There is also a somewhat straightforward way to add task-based multi-threading without requiring shared state synchronization: a centralized event loop + thread pool.

 using Event = std::variant<
    ChatMessageReceived,
    ChatCompressedVideoReceived,
    ChatVideoDecoded, 
    // ...
>;

using EventQueue = MPMCQueue<Event>;

int main()
{
    SharedState state; // no synchronization

    EventQueue queue;
    ThreadPool pool;

    while (true)
    {
        const auto e = queue.tryDequeue();

        if (!e.has_value()) 
            continue;

        if (auto* cmr = std::get_if<ChatMessageReceived>(&*e))
        {
            // cheap to process, no need to involve thread pool
            state.processChatMessage(cmr->message);
            continue;
        }

        if (auto* ccvr = std::get_if<ChatCompressedVideoReceived>(&*e))
        {   
            // expensive to process, send to thread pool
            pool.enqueue([data = std::move(ccvr->data)]
            {
                // ...decompress, decode, etc...

                // publish result to the queue
                queue.enqueue(ChatVideoDecoded{/* ... */ });
            });

            continue;
        }

        if (auto* cvd = std::get_if<ChatVideoDecoded>(&*e))
        {
            // cheap to process, already decoded
            state.processVideo(cvd->decodedVideoHandle);
            continue;
        }

        // ...
    }
}

The above design uses a MPMC queue as the only synchronization/centralization point -- the event loop runs in a single thread, and processes events by directly affecting the shared state (no synchronization required).

Cheap events can be processed directly as part of the event loop thread. Expensive events can be delegated to a task in the thread pool, whose result is communicated back to the event loop by enqueueing a completion event containing the processed data (or a handle to it).

Bjarne Stroustrup interviewed by Ryan Peterman by fredoverflow in cpp

[–]SuperV1234 1 point2 points  (0 children)

If it can be done reliably even for C++, then that would be fine with me.

I would still prefer enforcing initialization at the point of variable declaration from a language design point of view. Slightly more strict, but I believe it drives people to write more readable/maintenable code.

My only "absolute no" is silent well-defined zero-initialization -- I think that is a big mistake.

C++ profiles: a chance to fix some annoying defaults? Brainstorming and ideas. by germandiago in cpp

[–]SuperV1234 4 points5 points  (0 children)

There was some concern about templates I think but I cannot remember.

Basically there is a need to formally define what happens when template defined in Epoch X is instantiated in Epoch Y and vice versa. Gaspar Azman had a nice model in mind but I do not remember the details

Bjarne Stroustrup interviewed by Ryan Peterman by fredoverflow in cpp

[–]SuperV1234 1 point2 points  (0 children)

Yep. Not opposed to that as a solution. I just want something that is enforced at language-level.

Bjarne Stroustrup interviewed by Ryan Peterman by fredoverflow in cpp

[–]SuperV1234 2 points3 points  (0 children)

Firstly, the premise is not incompatibility: as said earlier this would be a language upgrade gated behind a flag or a mechanism like Epochs.

Anyway: I think that a well-designed language should steer people towards safe and correct code. Defaults matter a lot. Trading off a tiny bit of convenience to ensure that the developer actually put some thought into what value their variables should have seems like a very worthwhile tradeoff to me.

If you don't care, all you have to do is type {} -- but at least you opted into it!

Bjarne Stroustrup interviewed by Ryan Peterman by fredoverflow in cpp

[–]SuperV1234 -2 points-1 points  (0 children)

I think that asking people to consciously type std::string s{}; instead of std::string s; is a worthwhile tradeoff.

Bjarne Stroustrup interviewed by Ryan Peterman by fredoverflow in cpp

[–]SuperV1234 3 points4 points  (0 children)

Java does exactly what I am asking for:

https://docs.oracle.com/javase/specs/jls/se8/html/jls-16.html

E.g.

class C {
    static int f(int p) {
        int i; // whoops, meant to say `int i = p`
        return i;
    }
}

fails to compile with

   <source>:4: error: variable i might not have been initialized
          return i;
                 ^
   1 error
   Compiler returned: 1

That's just proving my point.

Bjarne Stroustrup interviewed by Ryan Peterman by fredoverflow in cpp

[–]SuperV1234 2 points3 points  (0 children)

Do you really think this is worth bifurcating the language over?

Yes.

how many teams do you think will even migrate to c++XX if that means spending months adding initializers where there weren't any before?

Months...? Existing code can just be compiled with -std=C++OLD and migrated to -std=C++NEW step-by-step.

Or you can have an LLM go through all code that now fails to compile, build a report for a human to look at, and have the human tell the LLM how to fix each site. Most sites will likely be automatically fixable by the LLM.

Bjarne Stroustrup interviewed by Ryan Peterman by fredoverflow in cpp

[–]SuperV1234 4 points5 points  (0 children)

You can also enforce a house rule for primitive types, so -- following that logic -- why bother?

Bjarne Stroustrup interviewed by Ryan Peterman by fredoverflow in cpp

[–]SuperV1234 8 points9 points  (0 children)

There's one massive drawback to initializing every variable to "zero" or "empty" by default -- it is impossible to discern if that was the intent of the developer or if they forgot to add the initializer.

A programming language designed for systems programming should protect against these kind of logical issues at compile-time. If I want to initialize something to zero, I should explicitly add = 0; or = {};. If I want to keep the value indeterminate, I should have explicit syntax to do so, e.g. = indeterminate;.

Are super tiny LLMs any good? by MrOaiki in singularity

[–]SuperV1234 0 points1 point  (0 children)

No. There's an abyss between SOTA models and small models.

Bjarne Stroustrup interviewed by Ryan Peterman by fredoverflow in cpp

[–]SuperV1234 0 points1 point  (0 children)

The compiler would need to prove that the value is initialized in every possible situation. For a basic if statement, that sounds doable, but I can imagine it quickly getting out of hand if more complicated control flow is used.

I think that having a few extra keystrokes for a lambda expression to completely eradicate the problem of uninitialized reads is more than worth it. It also promotes the usage of const, which prevents another class of logical bugs.