Cutting off Amber to increase load speed (was: Re: [amber-lang] TodoMVC)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Cutting off Amber to increase load speed (was: Re: [amber-lang] TodoMVC)

Herby Vojčík


Norbert Hartl wrote:

>
> Am 24.05.2014 um 21:08 schrieb Herby Vojčík <[hidden email]
> <mailto:[hidden email]>>:
>
>>
>>
>> sebastian wrote:
>>> Well you have to see the whole picture.
>>>
>>> We have 2 environments, dev and production, and potentially a third,
>>> testing.
>>>
>>> Off course it would be great to have smaller code but I don’t care
>>> about loading 2MB local code for the development environment because
>>
>> Dev is more. 2MB was production with compiler before minification.
>>
> Agreed. Did you do any further optimizations? Have a quick view there
> could be at least a few things removed:
>
> - class comments
> - method sources
> - protocols

Class comments don't take too much space, but yes.

Method sources are not needed, but you cannot dismiss other things as
easily. Don't forget introspection. For example, amber cli _uses_ method
protocols, to look for methods that implement amber commands.

> These aren’t needed in an optimized deployed target. To circumvent the
> problem we would need to define an „essential“ core of methods that
> developers can adhere to if they are really after loading speed and
> startup latency.
>
> Norbert

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Cutting off Amber to increase load speed (was: Re: [amber-lang] TodoMVC)

Nicolas Petton
We could do the following (I did it in the past, for a specific app):

Have a compiler option that strips down the resulting js files by
removing:
- method sources
- class comments
- some of the meta-information attached that is not strictly needed
- context information in the compiled code

There are some marginal issues with removing contexts, like the AST
intrepreter being unusable, but that shouldn't be an issue in
production.

If the size of Amber is an issue, adding that option would help
greatly.

Cheers,
Nico

Herby Vojčík <[hidden email]> writes:

> Norbert Hartl wrote:
>>
>> Am 24.05.2014 um 21:08 schrieb Herby Vojčík <[hidden email]
>> <mailto:[hidden email]>>:
>>
>>>
>>>
>>> sebastian wrote:
>>>> Well you have to see the whole picture.
>>>>
>>>> We have 2 environments, dev and production, and potentially a third,
>>>> testing.
>>>>
>>>> Off course it would be great to have smaller code but I don’t care
>>>> about loading 2MB local code for the development environment because
>>>
>>> Dev is more. 2MB was production with compiler before minification.
>>>
>> Agreed. Did you do any further optimizations? Have a quick view there
>> could be at least a few things removed:
>>
>> - class comments
>> - method sources
>> - protocols
>
> Class comments don't take too much space, but yes.
>
> Method sources are not needed, but you cannot dismiss other things as
> easily. Don't forget introspection. For example, amber cli _uses_ method
> protocols, to look for methods that implement amber commands.
>
>> These aren’t needed in an optimized deployed target. To circumvent the
>> problem we would need to define an „essential“ core of methods that
>> developers can adhere to if they are really after loading speed and
>> startup latency.
>>
>> Norbert

--
Nicolas Petton
http://nicolas-petton.fr

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Vag
Reply | Threaded
Open this post in threaded view
|

Re: Cutting off Amber to increase load speed (was: Re: [amber-lang] TodoMVC)

Vag
While generating code for deployment compiler may adhere to the following algorithm:

  1) include in deploy set all methods defined in application (its main package)
  2) from every "library" or "system" package, include every method if: its class is mentioned in body of some already included method AND its selector is mentioned in body of some already included method
  3) repeat step (2) until no such methods left

As an option:
  2) from every "library" or "system" package, include every method if: its class is mentioned in body of some already included method AND (its selector is mentioned in method send OR as a symbol) in body of some already included method


--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Cutting off Amber to increase load speed (was: Re: [amber-lang] TodoMVC)

Nicolas Petton
I've been willing to include a tool that would strip down a deployed
version of an application in Helios from day one. The compiler
architecture would in fact make it easy.

The situation is not that bad, a stripped down version of Amber (not to
mention gzipped) would be rather small. The development version of Amber
contains a lot a information and code used for development only.  

Also, removing context information would also make the deployed app run
at full speed.

The way I see it, the bigger issue is that there's no automated way to
create a stripped down version of an Amber app yet, but that will
come. There are tons of things to do, this is one of them :)

Cheers,
The less depressed guy of this list

[hidden email] <[hidden email]> writes:

> While generating code for deployment compiler may adhere to the following algorithm:
>
>   1) include in deploy set all methods defined in application (its main package)
>   2) from every "library" or "system" package, include every method if: its class is mentioned in body of some already included method AND its selector is mentioned in body of some already included method
>   3) repeat step (2) until no such methods left
>
> As an option:
>   2) from every "library" or "system" package, include every method if: its class is mentioned in body of some already included method AND (its selector is mentioned in method send OR as a symbol) in body of some already included method

--
Nicolas Petton
http://nicolas-petton.fr

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Cutting off Amber to increase load speed (was: Re: [amber-lang] TodoMVC)

Tom Rake
In reply to this post by Herby Vojčík
I remember a version of Smalltalk where a special copy routine was used to thin down the Image for deployment. The deployer wrote a  method that was passed class after class and you decided if that class got included in the copy. I think you could select which methods got dropped as well. In amber's case we would be thinning down the .js that all get concatenated into some type of deployment.js file.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.