Click here to Skip to main content
15,886,963 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Wordle.Hurdle Pin
Cp-Coder25-Apr-22 3:15
Cp-Coder25-Apr-22 3:15 
GeneralRe: Wordle.Hurdle Pin
FreedMalloc25-Apr-22 5:57
FreedMalloc25-Apr-22 5:57 
Generaleastern east meets the eastern west ? amazing video Pin
BillWoodruff24-Apr-22 10:18
professionalBillWoodruff24-Apr-22 10:18 
GeneralRe: eastern east meets the eastern west ? amazing video Pin
David O'Neil24-Apr-22 11:52
professionalDavid O'Neil24-Apr-22 11:52 
GeneralRe: eastern east meets the eastern west ? amazing video Pin
BillWoodruff24-Apr-22 14:23
professionalBillWoodruff24-Apr-22 14:23 
GeneralRe: eastern east meets the eastern west ? amazing video Pin
David O'Neil24-Apr-22 16:17
professionalDavid O'Neil24-Apr-22 16:17 
GeneralRe: eastern east meets the eastern west ? amazing video Pin
David O'Neil25-Apr-22 13:31
professionalDavid O'Neil25-Apr-22 13:31 
GeneralI'm being too clever for my own good but I'm really not: analysis paralysis Pin
honey the codewitch24-Apr-22 3:37
mvahoney the codewitch24-Apr-22 3:37 
For a long time, I've wanted my graphics library GFX to be able to use temporary RAM to cut down on bus traffic.

How it works is, it takes a lot of traffic to even write a single pixel. There's very little overhead however, for writing a bitmap.

So what I intend to do is back some of my drawing operations with bitmaps - at least where it's possible. It gets tricky though, because I'm constantly dealing with memory pressure. So what I do is I try to allocate a bitmap to hold the entire draw. If there's not enough memory, I keep dividing the height of the bitmap by half and trying until I'm down to a single line. If I still can't do it I go pixel by pixel. This works because the little heap - at least on the ESP32 - is blazing fast - maybe because it deals with so little RAM?

I feel good about this because to the degree that I've got it working it really speeds things up, but gosh is it going to be hard to maintain and it's really hard to code.

Putting on my design hat, I'm torn. This is a graphics library so some allowances must be made for performance reasons in terms of writing maintainable code. On the other hand, holy elephant this is difficult, and that makes alarm bells ring.

I learned most of the development skills that serve me in the IoT realm when I was a kid banging out code on 8-bit and 16-bit systems. However, not having the professional experience I didn't care about readability or maintenance.

Years of professional development have on one hand given me an advantage in that department, but it sort of paralyzes me in situations like this where the pull from my professional experience is STOP BEING CLEVER and yet any significant optimization I do pays for itself down the line because of the nature of the library. Graphics need to be as fast as they can reasonably be. I mean, I'm not banging out hand optimized ASM and I never would for IoT - too many different processors to target even on the ESP32 line - but algorithm level improvements are always fair game.

I eventually work through it but the point is my experience is actually slowing me down here. In some ways working on massive servers and desktops with gobs of RAM has spoiled me - and I'm quickly learning that sometimes readable code is a luxury.

Edit: I made it go, figured out a way to cut maintenance to 1/3rd and then decided to blow it up again by making it capable of doing all this asynchronously by alternately writing to one bitmap while sending the other in the background, and then flipping the pointers and alternating them until the end of the run. This blows up complexity but increases framerates by maybe 30% if the hardware is DMA capable.
To err is human. Fortune favors the monsters.


modified 24-Apr-22 13:17pm.

GeneralRe: I'm being too clever for my own good but I'm really not: analysis paralysis Pin
Greg Utas24-Apr-22 5:01
professionalGreg Utas24-Apr-22 5:01 
JokeRe: I'm being too clever for my own good but I'm really not: analysis paralysis Pin
0x01AA24-Apr-22 6:46
mve0x01AA24-Apr-22 6:46 
GeneralRe: I'm being too clever for my own good but I'm really not: analysis paralysis Pin
honey the codewitch24-Apr-22 7:13
mvahoney the codewitch24-Apr-22 7:13 
GeneralRe: I'm being too clever for my own good but I'm really not: analysis paralysis Pin
RedDk24-Apr-22 9:57
RedDk24-Apr-22 9:57 
GeneralRe: I'm being too clever for my own good but I'm really not: analysis paralysis Pin
jmaida24-Apr-22 10:54
jmaida24-Apr-22 10:54 
GeneralRe: I'm being too clever for my own good but I'm really not: analysis paralysis Pin
honey the codewitch24-Apr-22 15:47
mvahoney the codewitch24-Apr-22 15:47 
GeneralRe: I'm being too clever for my own good but I'm really not: analysis paralysis Pin
jmaida24-Apr-22 15:53
jmaida24-Apr-22 15:53 
GeneralRe: I'm being too clever for my own good but I'm really not: analysis paralysis Pin
jochance24-Apr-22 16:34
jochance24-Apr-22 16:34 
GeneralRe: I'm being too clever for my own good but I'm really not: analysis paralysis Pin
honey the codewitch24-Apr-22 16:43
mvahoney the codewitch24-Apr-22 16:43 
GeneralRe: I'm being too clever for my own good but I'm really not: analysis paralysis Pin
jochance24-Apr-22 17:50
jochance24-Apr-22 17:50 
GeneralRe: I'm being too clever for my own good but I'm really not: analysis paralysis Pin
jmaida24-Apr-22 17:54
jmaida24-Apr-22 17:54 
GeneralReally? Pin
Kornfeld Eliyahu Peter23-Apr-22 23:10
professionalKornfeld Eliyahu Peter23-Apr-22 23:10 
GeneralRe: Really? Pin
OriginalGriff23-Apr-22 23:35
mveOriginalGriff23-Apr-22 23:35 
GeneralRe: Really? Pin
DerekT-P23-Apr-22 23:58
professionalDerekT-P23-Apr-22 23:58 
GeneralRe: Really? Pin
dandy7225-Apr-22 4:33
dandy7225-Apr-22 4:33 
GeneralMy German Shepherd passed today Pin
Randor 23-Apr-22 16:00
professional Randor 23-Apr-22 16:00 
GeneralRe: My German Shepherd passed today Pin
jmaida23-Apr-22 18:54
jmaida23-Apr-22 18:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.