HNHacker News
TopNewBestAskShowJobs

dr_zoidberg

1,856 karma · joined September 24, 2014

submissionscomments
dr_zoidberg··on Python strings are immutable, but only sometimes
I'll admit that:

a) that surprises me, because in my short experience with it, I found that PyPy is more about simpler idioms if you are aiming for performance, a bit C-ish in style

b) it's been something like... 3 years (I think) since I last used PyPy for some serious performance testing of code. And even then it was a horrible proof of concept that barely ran, but helped me point out that "hey, we optimized it to 3.5x times faster with CPython and PyPy is getting to 4.5x over the original code, but it's throwing a thousand errors and warnings on screen and we can't be sure it'll work in production"[0].

Probably things have changed a bit on the PyPy side, though I don't think RPython has changed much in concept.

Also I see I never got to explain the pythonic note on my previous comment: basically, whatever "pythonic" means to the team. In general I try to go for the definition that is "it's easy to read and understand what's going on with the code, and provides easy-to-use interfaces for programmers". Not an easy to do thing, but at least trying to do it helps a lot.

[0] the job was that there was a large program that was bottlenecking a process in a lab, and somebody threw the idea of "oh we should use pypy because it'll surely make things run faster". And then it was my responsibility to pick that skeleton up and take care of it.

Oh and the code was pretty inefficient to begin with, which is why we got to speed it up so much without even going into C. A quick test with Cython put it in the 7-10x range of speedups, but the client wasn't willing to handle that, so they just kept it in CPython.

dr_zoidberg··on Python strings are immutable, but only sometimes
You can write python to be performant for either CPython or for PyPy. It's very difficult to write code that is performant on both. If you are targetting PyPy, be explicit about it and go full RPython on it.

If you are targetting CPython, try to be "pythonic"[0] and then drop to C/++ (through numba, cython, nuitka, pure C or whatever way you like best) if your performance requirements need it.

I'm not familiar with Jython and IronPython innards to know what's the best way to handle performance for them. Most probably it's very different than CPython and PyPy.

So like you said, keep things reasonable and don't depend on implementation details--unless you are explicit in your target/supported interpreter and you absolutely need to squeeze the performance out of the code.

dr_zoidberg··on Godot Shaders: View and Share Shaders for Godot
> I also question the decisions to try to compete with them on a graphic fidelity level but it's probably a decent move for the long term.

I always understood this as Linietsky having some very interesting ideas about 3d engines that weren't seen in other ways, and the whole 3d thing being just his curiosity exploring those ideas. And it certainly looks impressive.

I used Godot 2.0 a few years back and madea few toy games. It was very fun to use, but since game dev is not my thing, I left it at the side. Nice to see they've been improving so many things and how it has changed in so many (better) ways!

dr_zoidberg··on Apple Silicon M1 supports “billion of colors” a.k.a. HDR 10-bit output
Okay, this is second hand as I don't own a mac, but a friend who does noticed that on his macbook, macOS reports file sizes with megabyte being 10^6 bytes, whereas windows follos the 2^20 convention.

He was going crazy over a file being shown as 600Mb on Windows and 629Mb on mac. When he compared the bytes values, they were the same (around 629,145,600 bytes) and that settled it.

dr_zoidberg··on 2 times 3 can sometimes equal 7 with Android's Neural Network API
> I’m getting a bit tired of these overhyped cherry-picked samples with seemingly nothing solid to ever back it up.

Most of the times a "fantastic GPT-3 result" is shown, you have to dig a bit and then you'll find out how it was primed[0] and how many different texts they had it generate. Then the one(s) carrying out the experiment go on and pick the most shocking writings. If you read all of the outputs (there are a few articles around that show you 5 or 6 different outputs) you'll see the variations that it took duing those. I understand that 5 or 6 is actually small, to get shocking results they usually go into de dozens of tries.

[0] usually the priming phrases are given, but depending on how much of a snake-oil-salesman the person writing/giving a talk is, they may even hide this part

dr_zoidberg··on 2 times 3 can sometimes equal 7 with Android's Neural Network API
In my university there's a professor that has an awful attitude towards students when taking exam, outright making them feel stupid (without saying anything, just from gestures and body language)... The plot twist is he does this on purpose. Many times he'll just give a passing grade, but the experience of taking an exam with him is terrible.
dr_zoidberg··on I wrote a Raytracer for DOS, 16 VGA colors (2011) [video]
That matmul instruction seemed oddly specific, so I had to google that, and lo and behold, indeed there was such a thing! [0]

Do you remember what kind of speed ups that thing gave you? I wonder if you could play to backport some modern AI algorithms to it and run them at reasonable speeds -- however being a 286 I imagine it'd be quite a challenge.

[0] https://books.google.com/books?id=RD0EAAAAMBAJ&pg=PA89&lpg=P...

dr_zoidberg··on JingOS: Linux Distro Inspired by the iPad
I found it amusing how on the one side we're being told is a full-fledged Linux under the hood, and on the other side they felt it was worth noting that it comes with a native calculator app.
dr_zoidberg··on ‘YouTube recommendations are toxic,’ says dev who worked on the algorithm (2019)
> I play Fortnite with my kids casually. I looked up a howto a few weeks ago, and my recommendations are still 25% Fortnite related content, even though I only watched one video one time.

In general I've noticed that YouTube favors your "newest outliers" (let's call them) over stuff you've historically looked at. Probably the rationale (optimization metric?) is trying to capture you into content that might add to your total watch time on the platform.

dr_zoidberg··on What I wish someone had told me about tensor computation libraries
My coworker said that he basically started from this article[0] and then adapted a few things to his workflow. He also said that learnopencv "covers like 70% of what you really have to do and you have to figure the rest out, not hard but may take you some time".

[0] https://www.learnopencv.com/pytorch-to-tensorflow-model-conv...

dr_zoidberg··on What I wish someone had told me about tensor computation libraries
Here's my take about TF (in general, not particularly 1.x or 2.x):

Like many things from Google, I always had the impression that the library, while better than alternatives at the time, is too tailored to Google use cases. And if you fall outside of them, bad luck.

Still, at work we find it easier to deploy and interoperate with other tools than Pytorch. Hell, we have a guy working in Pytorch who converts his work to ONNX so that we can then connect those to some tooling we already have from back when TF was our only backend.

Could there be a better way? Perhaps. But we have to ship models and TF "just* works" (with a big asterisk, yeah).

dr_zoidberg··on Is deep learning a new kind of programming?
Historically, this was solved in the 80's with the multi-layer perceptron, but it seems it still gets repeated.
dr_zoidberg··on FTC Sues Facebook for Illegal Monopolization
The situation reminds me of when Google bought Motorola[0], and then the Android phone manufacturers pushed for them to sell it again. Which eventually happened. Main difference here would be that it's the government pushing now, instead of (indirect?) competitors (which also happen to be customers).

[0] Good old times, I still have a Moto G3 from back then that works like a charm, except it can't "speak" to the 4G technology that got deployed in the country where I live.

dr_zoidberg··on Linus Torvalds' good taste argument for linked lists, explained
> I'd say the biggest advantage of a standard linked list is that it can be intrusive.

That's one big benefit. I teach operating systems and, when the semester has been good, we dig into physical memory dumps with a few python scripts, and show the students how to parse Windows process list following _EPROCESS structures.

That's one of the big things they find themselves surprised every year: that the process list is a chain of LIST_ENTRY structures embedded within the _EPROCESSes[0] (or any other structure that is doubly-linked in memory). And LIST_ENTRY is just 2 pointers going hand in hand with list_entry->flink and list_entry->blink attributes and nothing more.

[0] You can read some about this structures here https://www.nirsoft.net/kernel_struct/vista/index.html but beware this is based on Vista and a bit old. Kernel data structures vary with versions of the OS (and not even major versions at that) and target processor (x86, x86-64, ARM too would be reasonable).

dr_zoidberg··on Apple Silicon M1: A Developer's Perspective
Okay, I'm not finding any benchmark that supports the idea of a slowdown, so probably I remembered some rumour I read on twitter or reddit.

What I am finding now is that python is working more than fine on M1, be it through rosetta or native code, which is consistent with your experience.

Also to clear things a bit, I parsed your "3.6 -> 3.9" as meaning that you had moved from Py36 on intel to Py39 on apple, which is why I asked if maybe there were speedups or differences from moving to 3.9.

dr_zoidberg··on Apple Silicon M1: A Developer's Perspective
Going by TSMCs claim of 30% better power consumption at iso-speed would put the battery of the G14 at 11-12 hours. So that places the Apple system on a 25-36% better battery range, instead of 80-100%.

And still, there are more catches: Apple is probably driving the screen at 60Hz instead of 120Hz for the G14, and the screen tends to be one of the main drivers of battery life.

What I'm trying to say is that the talks revolve around the M1 vs x86 for battery consumption, but the big savings can probably come from other components in the system.

dr_zoidberg··on Apple Silicon M1: A Developer's Perspective
Do you think moving from python 3.6 to 3.6 had any impact whatsoever? I'm surprised by such a large improvement in performance as other reports I read indicated similar-to-slightly-worse python performance of M1 vs x86.
dr_zoidberg··on 1.5 is the midpoint between 0 and infinity in Ruby
I'm left wondering if this is real behavior, or you're doing a Douglas Adams joke...
dr_zoidberg··on Nvidia Announces A100 80GB GPU for AI
Okay, gonna take a look at that once it's available.
dr_zoidberg··on Nvidia Announces A100 80GB GPU for AI
Linux only support is a bit of a letdown for me. My clients insist on using Windows, so I'm left without choice there, it's nvidia or nvidia.
dr_zoidberg··on Nvidia Announces A100 80GB GPU for AI
I've noticed that, lately, YT recommends mostly based on my last week/days of video history with them. Which is ok-ish, but certainly some content that I haven't been following lately gets relegated to oblivion.
dr_zoidberg··on Intel's disruption is now complete
Not just Linux, but windows also has Large Pages support. Back in the day where CPU cryptocurrency mining was still a thing (and for some cryptocurrencies which are aimed towards CPU-mining still is), some mining programs would ask to enable large page support.
dr_zoidberg··on A visual comparison of macOS Catalina and Big Sur
You're forgetting that "it looks better than before" or "it looks more modern" (for whatever definition of modern) have been selling points of many things (computers included) for the past 50 years. Same features, different looks, "new" product (for which you charge again).
dr_zoidberg··on Rehex – Reverse Engineers' Hex Editor
Are you sure that weird byte at the begining is not a Unicode BOM (Byte-Order-Mark)? I've seen a few programs do that (or expect it) and other programs ignore it or go crazy on it.
dr_zoidberg··on GFXBench: Apple M1
The memory bandwith, amount of shader units, TMUs, fill rate, etc is different (slower) on the MX350. While they are surely the same archiecture, the MX350 is lower tier than the 1050.

And in this case, it'd make for a larger difference between Apples GPU and the nvidia. But then again, the M1 is a mobile SoC and the 1050 is a desktop GPU. So we shouldn't even be comparing them to being with.

dr_zoidberg··on PRET – Printer Exploitation Toolkit
Right, but in theory the black ink cartridge should be enough? I mean, we used to have B&W inkjets (I don't know if there still are just B&W ones, haven't bought a printer in over 10 years, and last one was a laser anyway).
dr_zoidberg··on GFXBench: Apple M1
Half the battery on a higher powered CPU (the 4800H is 45W and the 4900HS is 35W if I recall correctly), plus a discrete graphics GPU (on top of the iGPU) and active cooling vs passive cooling, plus a 120Hz display on the G14 (and probably Apples is 60Hz).

So a more power-hungry notebooks battery lasts half as long, but still in the double digits. Not quite a surprise there.

dr_zoidberg··on GFXBench: Apple M1
Comparisson could be against either an MX250/MX350 if they wanted to compare to nvidia (however that's not integrated in a SoC-like manner) or the AMD Vega on Renoir, or Intel Graphics on Ice/Tiger Lake (I honestly lost track of what intel calls their iGPUs these days, they went back and forth between confusing naming conventions, but it's the CPU gen/model that's important anyway).
dr_zoidberg··on PRET – Printer Exploitation Toolkit
OP meant to get the printer to print in black and white when there's no cyan/magenta/yellow ink. Many color inkjets have the bad habit of not allowing you to print anything if one of the cartrigdes is empty -- even if you don't need said cartridge.
dr_zoidberg··on Apple Silicon M1 chip in MacBook Air outperforms high-end 16-inch MacBook Pro
The power of vertical integration means that Apple could sell their hardware at a loss, to get you inside the Walled Garden TM and then keep 30% of all you spend inside it.

I'm not saying they do that, considering how much their products cost, I'm saying they could. That's what vertical integration brings to their table, above all else.

← PreviousPage 7 of 32Next →