• 0 Posts
  • 113 Comments
Joined 2 years ago
cake
Cake day: June 30th, 2023

help-circle
  • It’s generally not as heavy because the layer is just reinterpreting API calls while the user code still runs natively. On a browser running JavaScript, it’s using an interpreter for every line of code. Depending on the specifics, it could be doing string processing for each operation, though it probably only does the string processing once and converts the code into something it can work with faster.

    Like if you want to add two variables, a compiled program would do it in about 4 cpu instructions, assuming it needed to be loaded from memory and saved back to memory. Or maybe 7 if everything had a layer of indirection (eg pointers).

    A scripting language needs to parse the statement (which alone will take on the order of dozens of cpu instructions, if not hundreds), then look up the variables in a map, which can be fast but not as fast as a memory load or two, then do the add, and store the result with another map lookup. Not to mention all of the type stuff being handled at run time, like figuring out what the variables are and what an add of those types even means, plus any necessary conversions. I understand that JavaScript can be compiled and that TypeScript is a thing, but the compiled code still needs to reproduce all of the same behaviour the scripting language does, so generic functions can still be more complex to handle calling and return conventions and making sure they work on all possible types that can be provided. And if they are using eval statements (or whatever it is to process dynamically generated code), then it’s back to string processing.

    Plus the UI itself is all html and css, and the JavaScript interacts with it as such, limiting optimizations that would convert it into another format for faster processing. The GPU doesn’t render HTML and CSS directly; it all needs to be processed for each update.

    For D3D to Vulkan, the GPU handles the repetitive work while any data that needs to be converted only needs to happen once per pass through the API (eg at load time).

    That browser render stuff can all be done pretty quickly on today’s hardware, so it’s generally usable, but native stuff is still orders of magnitude faster and the way proton works is much closer to native than a browser.



  • I’m never buying another Logitech device again because that problem that happened with my G7 back in the 00s still happened with my G900 in the 20s.

    With my G7, I’d open it up when it started happening, and open up the switch to re-bend the metal piece to give it some spring back. Kept doing this until one day the plastic button that presses down on that metal part fell on carpet and was gone forever.

    With my G900, I said fuck it and just bought some better mouse button switches and replaced the left mouse button. Was actually kinda glad I needed to because the battery had become a danger pillow so I replaced that, too.

    But with the button issue existing for so long and being fixed by a part that cost a trivial amount compared to what I paid in the first place, you can’t convince me that Logitech isn’t deliberately using switches that fail quickly to drive up demand for mice.





  • Actually, there is one thing that is an annoyance that I haven’t been able to resolve. I use dvorak as my main layout.

    Sometimes games get the keyboard right and keys are remapped to qwerty layout (and typing still uses dvorak). This case works better than on windows, since playing a game there either required the game itself to recognize keyboard layouts (best case), or remapping the controls (annoying case), or switching to qwerty (frustrating for typing because I’m stronger with dvorak now).

    But sometimes instead it does the opposite and remaps the qwerty bindings to dvorak. As in, even if I swap layouts, wasd are all over the keyboard instead of all together. I need to exit the game, swap layouts to qwerty on the desktop, then relaunch for controls to work properly (and then I can sometimes swap back to dvorak in game and they continue to work). Often, the next time I launch the game, I’ll forget to switch it but it will just work this time.

    And sometimes it behaves like windows did where I can swap the layout in game and keys change as you’d expect.

    I have no idea why it’s inconsistent between these three options or where the “preserve key location despite the layout” feature is even coming from. Anyone have any idea about this?


  • I upgraded my gpu this weekend. Shut down, switched the psu off, swapped the old one out and new one in, booted into bios no issue (to check if I has left pcie on auto or needed to update it), then booted into the desktop (fedora cinnamon). Bam, after login only saw wallpaper, no mouse cursor or other UI.

    Well, at least it’s kinda working. Time to figure out what’s going on. Terminal works. There’s some errors in the log but nothing to do with amdgpu or firmware failed to upload or anything. Software render just shows up as black screen. Reset my cinnamon session and boot back to the same thing. Fuck.

    Then I try moving my mouse way over to the right and it shows up! Oh right. I have my TV plugged in for streaming to it sometimes and it ended up defaulted to the primary display, so my main desktop was only showing up there (and it was off). Right click, display properties, swap my monitor to primary, disable the TV until I turn it on.

    This is about the magnitude of the average problem I need to deal with on Linux. Something isn’t working like I want it to, half the time it’s actually working but I misunderstood something or the default doesn’t match my intent and I need to adjust settings and then it’s perfect or close enough.

    Or the other problem I had yesterday, tried monster hunter world for the first time and it wouldn’t launch. Played satisfactory for a bit instead (new gpu is noticeably smoother yay), then did a quick search, found that a specific version of proton works, switched to that version and it played. That’s the first game that has had such trouble for me.


  • Tbf that could have been done by tenants who figured the landlord would use that damage to argue they should lose their entire deposit despite not costing nearly that much to repair properly.

    Not that it wouldn’t be plausible that the landlord did it themselves or hired someone who didn’t know what they were doing but were willing to do it cheap, like Ricky.


  • It sounds like you might have some network places set up for windows to use but that are no longer reachable (or something along those lines) because that shouldn’t be taking so long so you might have things timing out in the background.

    Or your internet is slow and it’s taking a long time to communicate with one drive or send its screenshots of your document to their creep department.

    Or maybe a print driver that no longer exists still has an orphaned entry in the registry and it spends some time trying to locate it.

    Or malware has set up hooks for any new window that pops up but the print to pdf dialog is set up in such a way that it churns very inefficiently on that window specifically.

    I joke but any one of those might actually be what’s going on.





  • That’s the worst when your cycle time is very long. You fix a bug in the code, start your test running again and come back to check the next day only to see the exact same bug again and might think that your fix didn’t work and something more esoteric is going on (“maybe it’s a compiler or hardware bug!” (It almost never is)).

    Then you add a bunch of debug prints to really get a good idea of what’s going on and rerun the test. Either you remembered to save and suddenly the mystery bug is gone because the fix is still in the code. Or maybe you forgot to save again and now it looks like it’s not even reaching any of the code you added the prints to.


  • Thing is, if it just guesses what you meant instead of sticking to the standard, you can end up with ambiguous meanings. Like what if you forgot a character that wasn’t a semicolon but inserting a semicolon would turn it into valid code?

    Like:

    x = y z++;

    Inserting a semicolon would turn that into set x to the value of y and then increment z. But maybe the line is missing a plus instead of a semicolon and the intent was to set x to y plus z and then increment z.

    It’s a pain but strict syntax helps avoid frustrating to debug bugs.

    Taking it a step even further, you can make your code more robust by treating warnings similarly to errors. Even though the general cases usually still work despite warnings, they are great for avoiding edge cases that can also be difficult to debug. At least if you take the time to understand what the warning is really about and don’t just google “how to get rid of warning x” and add some casts or something you don’t understand to make the message go away.




  • Buddahriffic@lemmy.worldtoProgrammer Humor@lemmy.mlLearn to code
    link
    fedilink
    arrow-up
    28
    arrow-down
    2
    ·
    6 months ago

    Yeah, that’s something a shitty developer who is bad at debug would say.

    Bugs frustrate me more because I can often guess at why they are happening and how to fix them but can’t just apply the fix myself. Even more frustrating when there’s an update and I’ll think, “oooh maybe they finally fixed that annoying bug!” and then see it again shortly after installing the update.


  • A part that complicates it is nutrition. Nutrients are related to food cravings, but if you don’t have access to food that has the nutrients your body is craving, you might eat other things in an attempt to satisfy that craving. But since they don’t contain what your body needs, the craving doesn’t go away, so the drive to eat more remains.

    It’s like the difference between being satisfied and full. For the first one, your body decides it doesn’t need anything more and the desire to eat just isn’t urgent (comfort/habit eating can still be a thing though). When you’re full, it just means your stomach is full and you can’t eat more without discomfort. But once there’s room again, the hunger might return.

    It was something I’d always notice with McDonald’s. One big Mac never felt like it was enough. I’d eat the food and then be disappointed because it was all gone but I still wanted to eat.

    But a good meal with a variety of ingredients can satisfy even if the volume of food isn’t high. Like I’ve only tried fine dining once and went in to the 9 course meal expecting to need to stop for a burger or something afterwards because I knew the portions of each course would be tiny. I walked out of that restaurant with room in my belly but no desire to fill it with anything else.

    It’s also why pregnancy cravings are so strong. The body needs more nutrients when building another body, plus the timing of accessing those nutrients is more important.