[FlexJS] empty constructors in SDK

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[FlexJS] empty constructors in SDK

Justin Mclean
Administrator
Hi,

We seem to have a number of empty constructors in the SDK. Is there any reason for this as? Performance wise there’s going to be a cost with this.

On the other hand we also have a number of constructors that are not light weight. AS doesn’t JIT code in constructors so best practice is to move the code to a another method and call it from the constructor. Any reason this isn’t being done?

Thanks,
Justin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] empty constructors in SDK

Christofer Dutz
I remember always having warnings reported by the old compiler, if there are no constructors, so I started adding constructor blindly. Eventually that’s a pattern others have been following?

Chris

Am 23.05.17, 12:22 schrieb "Justin Mclean" <[hidden email]>:

    Hi,
   
    We seem to have a number of empty constructors in the SDK. Is there any reason for this as? Performance wise there’s going to be a cost with this.
   
    On the other hand we also have a number of constructors that are not light weight. AS doesn’t JIT code in constructors so best practice is to move the code to a another method and call it from the constructor. Any reason this isn’t being done?
   
    Thanks,
    Justin

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] empty constructors in SDK

Josh Tynjala
In reply to this post by Justin Mclean
I don't think the empty constructors will have a performance impact. The
way we create classes in JavaScript, a constructor is required because
that's where the prototype is stored, so it will be generated anyway. In
SWF, I believe I remember reading that it's similar: bytecode is still
generated by the compiler when the constructor is omitted.

- Josh

On Tue, May 23, 2017 at 3:22 AM, Justin Mclean <[hidden email]>
wrote:

> Hi,
>
> We seem to have a number of empty constructors in the SDK. Is there any
> reason for this as? Performance wise there’s going to be a cost with this.
>
> On the other hand we also have a number of constructors that are not light
> weight. AS doesn’t JIT code in constructors so best practice is to move the
> code to a another method and call it from the constructor. Any reason this
> isn’t being done?
>
> Thanks,
> Justin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] empty constructors in SDK

Alex Harui-2
In reply to this post by Justin Mclean


On 5/23/17, 3:22 AM, "Justin Mclean" <[hidden email]> wrote:

>Hi,
>
>We seem to have a number of empty constructors in the SDK. Is there any
>reason for this as? Performance wise there’s going to be a cost with this.

AFAICT the compiler will auto-generate an empty constructor for you, so I
don't think there will be an effective cost.  Do folks think this is
important to this release?  I personally don't mind having empty
constructors.

>
>On the other hand we also have a number of constructors that are not
>light weight. AS doesn’t JIT code in constructors so best practice is to
>move the code to a another method and call it from the constructor. Any
>reason this isn’t being done?

I don't want to take the time to go look right now.  What are some
examples?

Thanks,
-Alex

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] empty constructors in SDK

piotrz
Hi Alex,

From my perspective it is not important for this release, but I think it would be good to have jira for this task.

Let see what other thinks.

Piotr
Apache Flex PMC
piotrzarzycki21@gmail.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] empty constructors in SDK

Josh Tynjala
Agreed. This shouldn't hold up the current release, but let's make sure
that there's a JIRA so that we don't forget to discuss it more after the
release.

- Josh

On Tue, May 23, 2017 at 8:29 AM, piotrz <[hidden email]> wrote:

> Hi Alex,
>
> From my perspective it is not important for this release, but I think it
> would be good to have jira for this task.
>
> Let see what other thinks.
>
> Piotr
>
>
>
> -----
> Apache Flex PMC
> [hidden email]
> --
> View this message in context: http://apache-flex-
> development.2333347.n4.nabble.com/FlexJS-empty-constructors-
> in-SDK-tp61772p61797.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>
Loading...