[Sugar-devel] [PATCH Browse] Error page SL #3500

Martin Langhoff martin.langhoff at gmail.com
Fri Sep 21 19:32:18 EDT 2012


On Fri, Sep 21, 2012 at 6:56 PM, Manuel Kaufmann <humitos at gmail.com> wrote:
> I'm not sure to understand what you are saying here. I'm not doing
> this each time the function is called. Here, I just showed what I did
> to get the base64 file encoded. I mean, I did this just once and I put
> the result inside the HTML file. Epiphany does the same: it has
> hardcoded the image inside the html. Is that a bad idea?

Yeah, it's a wasteful approach. Probably doesn't matter much.

You have the file on disk, correct? So you have the file path. You
know that the webkit engine can read the file, too (it's on the same
machine, in a readable directory, etc).

So just put <img src="file:///path/to/file" >. That saves a some of
pointless CPU cycles, some RAM.

This old man doesn't like inefficient code, even in small details.
Mostly because that means that when you code some that is hot (ie: is
exercised a lot, so is a potential bottleneck or memory hog if
inefficient) you have the right instincts.

I've spent many years fixing performance issues in large systems where
people coded without much care to efficiency (or error handling). So
there's a gnome in the back of my mind that kicks me if I write
careless code...

cheers,


m
-- 
 martin.langhoff at gmail.com
 martin at laptop.org -- Software Architect - OLPC
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff


More information about the Sugar-devel mailing list