Questions about the network implementation

Posted on
Page
of 2
Prev
/ 2
  • Will check that out. I've just this minute got my fermentation script measuring temp, controlling two 433Mhz sockets, reporting actual temp over MQTT and listening for targetTemp adjustment commands over MQTT also. It's running on an "OUT OF MEMORY" knife edge, and had to strip most of the console progess logging, and I doubt will stay up long. So I'll be sure to look at all the above suggestions. Thanks again!

  • @gordon, thanks for reply in other post on the object vs extending prototype piece. Looking at the above commits, you've made some prototyped methods into generic functions? Is the benefit here solely compactness of the script so less to load or is there more to and by not making them part of the MQTT object you're saving memory?

  • A bit of both... If they're not using this. and don't need to be public then there's not much need for them to be in the prototype.

    While that itself doesn't save any space (iirc), having them out gives the minifier free reign to shorten their names (and sometimes even inline) them.

  • Nice, thank you for pointers. This is all new to me - and I thought I knew a bit of javascript - shows how lazy can be when space and memory not at a premium!

    Just the first of your suggestions - binding the onData function late only pushed the module size up marginally, but saved 32 jsvars! Looking at the commits now.

    Apologies for momentarily hijacking this thread, I know this was a bit off topic. Thanks again.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Questions about the network implementation

Posted by Avatar for tve @tve

Actions