Readit News logoReadit News
mholub commented on Revisiting Knuth's “Premature Optimization” Paper   probablydance.com/2025/06... · Posted by u/signa11
sethammons · 8 months ago
A former boss: an optimization made at a non-bottleneck is not an optimization.
mholub · 8 months ago
it's more nuanced:

you're still releasing resources - so you might not become faster overall but you can compute more in the same time later if necessity arises (althougth that might be somewhat premature but can be good for library code - so it becomes more applicable in different environments)

and there are some rare but tricky scenarios like:

hardware is mobile phone: app seem to be bottlenecked on arithmetics according to the profiler, so it feels obvious to start optimization there

in reality what happens - hardware has limit on power, so it can't give full power to CPU, GPU and memory all at the same time

since app uses too much memory - it has to redirect power there, also memory emits heat, so CPU becomes throttled

By optimizing memory, everything runs colder -> CPU gets more power, can run sustained higher frequencies - app becomes faster

mholub commented on Leaving Rust gamedev after 3 years   loglog.games/blog/leaving... · Posted by u/darthdeus
mr_00ff00 · 2 years ago
Sort of, although Zig certainly pushes itself towards the embedded world. I have tried Zig a bit and like it a lot, and I am sure it would be better for game dev than Rust, but I don't want to pass allocators around all day to all the objects in my game.

Go without GC is more like a Go and Zig baby.

mholub · 2 years ago
nothing really prevents you from defining global allocator in Zig

and having explicit allocator in standard library is actually a good thing, cause it's quite a common case in game development to use arena allocators which are being freed once per frame - so you don't really need to reinvent your data structures in Zig

I do have some concerns about Zig because it also introduces some friction for correctness sake like requiring to always use all variables, explicit casts everywhere - I want some compiler toggle to disable all of that and focus on problem but unfortunately it's not there

I am playing with Zig now and haven't really formed my opinion about game development specifically but I like it a lot so far

mholub commented on Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)   blog.burntsushi.net/ripgr... · Posted by u/subset
JaDogg · 2 years ago
Hello thank you for pointing this out. I hate how slow grep is in Windows :( and I cannot install rg (I have no choice in the OS at work)
mholub · 2 years ago
What’s the nature of your work so you are not allowed to install software?
mholub commented on Unity Software to cut 3.8% of staff in 'company reset'   reuters.com/technology/un... · Posted by u/Philpax
kalleboo · 2 years ago
In the case of this game, the mouths were never open, the teeth were never visible at all. Which is obviously a massive failure of the developers (using a prefab model with a ton of completely unused detail is a waste of everyones bandwidth, storage and memory), but the teeth should at least never be rendered by the engine.
mholub · 2 years ago
this is very computationally expensive to do such operation (to understand that teeth is completely occluded by something else like mouth)

this is called occlusion culling and usually it brings a lot of problems on its own (it's CPU intensive and you need to apply it smartly only where it helps)

and even if this occlusion culling would be cheap, the way how it is usually done requires precomputing a lot of data - so occluders are static geometry

since character head is skinned mesh - so dynamically changes every frame based on joints positions - that will be another level of complexity

game engines are not really helpful here

mholub commented on Dear ImGui – Bloat-free graphical user interface library for C++   github.com/ocornut/imgui... · Posted by u/dragonsh
roytries · 5 years ago
Not sure why this is showing up on HN today. But Dear ImGui is absolutely amazing. And its not just for C++. I use it myself in my C# game engine. (There's a C# port that uses System.Numerics: https://github.com/mellinoe/ImGui.NET) which I've ported to MonoGame https://github.com/roy-t/ImGui.NET)

I've used a lot of different UI frameworks (winforms, WPF, Html/CSS based frameworks, custom game engine frameworks). But for prototyping Dear ImGui and the whole immediate GUI idea is amazing. It even looks quite decent and the new docking support is great :).

mholub · 5 years ago
We recently started to use Dear ImGUI in our custom game engine. Before we used Unity which has its own immediate mode gui solution. And I have hard time to switch. I don't know if I don't understand how Dear ImGui work yet in comparison to Unity's one but it feels so limited.

So main difference is that Unity is multipass (it calls your gui drawing code multiple times per frame) and because of it it supports horizontal layout, vertical layout, custom layout modifiers, styles and it is easy to use

in Dear ImGUI I am struggling to write stuff like:

layout 3 controls horizontally, allocate fixed size for first and last one and use all left space for middle one

or

layout next N controls vertically of unknown height and use this background color for them, then layout another set of controls and use different background style for them

I am not the person who was actively working on integration it into our engine, so maybe it's the problem of not having documentation on our wrapper...or me not understanding very basics of it

mholub commented on Leaving OCaml   blog.darklang.com/leaving... · Posted by u/rbanffy
pbiggar · 5 years ago
OP here. I don't mean this to be negative, this is just my ongoing developer blog to keep the Dark community appraised about what's going on.

There's some really great stuff about OCaml. I don't think we could have gotten through the first 2 years without OCaml, we repeatedly made very large scale changes to what our product was and how it worked, and that would have been 10x harder in something else.

I actually think OCaml stands to be in a great place in the next few years with the work being done by core community members. See https://twitter.com/patricoferris/status/1323330884515356672.

mholub · 5 years ago
so if you already had experience with Rust/etc, why did you decide to choose OCaml?

Also why not to choose F#/Mono (and now .NET core) for example?

mholub commented on Cargo-style dependency management for C, C++ and other languages with Meson   nibblestew.blogspot.com/2... · Posted by u/pabs3
steveklabnik · 5 years ago
Yes, this matters too.

I've been bumping into some tough limitations of Cargo lately, but it's still good enough to stick with it, and paper over them, rather than throw the whole thing out wholesale.

mholub · 5 years ago
what kind of limitations in a few words?
mholub commented on Procedural cityscapes creation: Openstreetmap import in Unity and Houdini Engine   stinaflodstrom.com/projec... · Posted by u/liotier
tarr11 · 6 years ago
Is there a software library that has the same "procedural power" as tools like Houdini? Eg, where I could build something like this demo, but purely in Python.

I've tried using Houdini which was very powerful, but was put off by the "visual node builder". I'd like to be able to do something similar, but purely using code.

mholub · 6 years ago
well..Houdini is scriptable in python too :)
mholub commented on Sitting down too much is doing more harm to your body than you can imagine   elth.co/sedentary-lifesty... · Posted by u/rahulchowdhury
alansammarone · 8 years ago
Every time I read an article like this, I get a bad feeling and I say to myself "I'll definitely exercise more - I don't wanna be all buggy when I get older due to my lifestyle - I'll do this NOW!". Then a couple of hours later, I'm back coding happily seated. I'm sure this is the case for many of us.

I wish our brains could keep this bad, guilty-like feeling that makes us take action around for longer.

mholub · 8 years ago
You just need to find activity interesting for you

I used to do sedentary lifestyle most of my life until I found rock climbing 2 years ago

I go rock climbing to a gym 2-3 times a week now. I go there because I WANT not because I have to. This did tremendous job to my health and overall fitness. And this is sustainable in the long term because I don't have problems with motivation.

So my advice — find your sport, any physical activity you are interested in. If it becomes boring, don't hesitate to change it.

You don't need to be a sportsman and become good at something, you just need consistency to move your body , so care about your motivation. Good body will come naturally after some time.

mholub commented on LinkedIn is now officially blocked in Russia   techcrunch.com/2016/11/17... · Posted by u/DyslexicAtheist
tobltobs · 9 years ago
> Creating a LinkedIn clone is trivial

Sure, but reaching a critical mass isn't. And for Russian freelancers looking for work outside of Russia a Russian LinkedIn isn't helpful. Maybe the problems with this regulation will be more obvious if a service like Github is blocked.

mholub · 9 years ago
We actually had Github banned in Russia once or twice for short periods of time (like hours or days). Because of some repository contained joke text about how to commit suicide.

u/mholub

KarmaCake day22December 19, 2012View Original