[LEDE-DEV] Call defines for minifying scripting languages

Paul Oranje por at xs4all.nl
Mon Dec 12 02:28:24 PST 2016


> Op 12 dec. 2016, om 10:18 heeft Zefir Kurtisi <zefir.kurtisi at neratec.com> het volgende geschreven:
> 
> (did you remove the CC to LEDE-DEV on purpose?)
no, by accident, corrected that now.

> Depends.
> 
> When the script is used to bring some service up and not used during runtime, they
> are ok. If they are executed regularly, the performance factor of the same binary
> is somewhere in the range of 1000x - why should an embedded system be slowed down
> with interpreting scripts?
True indeed when the code involved is performance critical, but it most times isn’t.
When criticality is an issue, then that, as well the achieved improvement by using compiled code in stead, should be shown, *not* assumed.
Unwarranted changed introduce errors, that’s a proven fact.

> The other - and more important thing - is that binaries are syntax checked. Once
> after you brick your system because you forgot a space or put the semicolon in a
> wrong place in your sysupgrade script, you'll start to hate them ;)
True, again, but as a long time C programmer I can assure you that correct syntax still allows for disaster.
E.g. on devices with limited memory resources, spilling memory is likely to be detrimental whereas run-time interpreted languages tend to be much safer in that respect.
OTOH If the invocation is short lived, then termination of the proces would normally free any memory allocated, and so the danger of spilled memory is more an issue with processes that run longer.

> 
> 
> Cheers,
> Zefir
-- 
s.y. Paul

 
> 
> On 12/09/2016 07:50 PM, Paul Oranje wrote:
>> When functionality can be build with just scripts i.s.o. binaries without suffering to much performance loss, then using scripts is all right.
>> Binary is not always better (even if I would find C easier to read then sh scripts).
>>>> Paul
>> 
>> 
>>> Op 4 okt. 2016, om 12:10 heeft Zefir Kurtisi <zefir.kurtisi at neratec.com> het volgende geschreven:
>>> 
>>> On 10/03/2016 01:00 PM, Jan-Tarek Butt wrote:
>>>> Hi,
>>>> 
>>>> My Idea ist to create calldefs to minify all scriptes there are 
>>>> interpreted by run time.
>>>> 
>>>> As example see the mail "[PATCH] LuaSrcDiet call define for lua 
>>>> code Minifying".
>>>> 
>>>> I plan to write also calldefs for shellscripts, python and perl.
>>>> 
>>>> [...]
>>>> 
>>> When it comes to shell-scripts, I'd start at a prior step: why does an embedded
>>> system need to run and interpret so many shell-scripts at all?
>>> 
>>> OWRT has been shell-script heavy from the very beginning, but luckily over the
>>> last few years started to move more and more of that scripted functionality into
>>> binaries (e.g. procd, netifd). This transition only started, and imho the goal to
>>> reach is to get rid of all shell-scripts on target (beside init-scripts, maybe).
>>> 
>>> Therefore, instead of optimizing them, I'd opt to treat them as technical debt
>>> which needs to be resolved by replacing scripts with binaries - personally, I
>>> won't spend too much time on something to-become-legacy mid-term.
>>> 
>>> 
>>> 
>>> Cheers,
>>> Zefir
>>> 
>>> 
>>> _______________________________________________
>>> Lede-dev mailing list
>>> Lede-dev at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/lede-dev
>> 
> 





More information about the Lede-dev mailing list