Re: [AngularJS] Re: Performance issue on any event like button click, mouse over, typing in angular-7

2020-06-21 Thread maninder singh Kumar
Performance is a matter of leaner code

Maninder Kumar
about.me/maninder.s.kumar



On Sat, Jun 20, 2020 at 11:54 PM ajit dash  wrote:

> Thank you so much Sander,
> Agreed, I will try your approach.
>
>
> Thanks,
> Ajit
>
> On Sat, Jun 20, 2020 at 12:05 AM Sander Elias 
> wrote:
>
>> Ajit,
>>
>> I can repeat my previous reply. Using functions in templates is an
>> antipattern in Angular, and should be a last-stop solution. Each of those
>> functions is called numerous times. This will cause a performance hit. What
>> you can do is some memorization in the functions itself.
>> A better solution would be adding the needed data to the rows itself.
>> In cases like this I usually so something in my controller like this:
>> rows.forEach(row=>row[className]=calculate(...))
>>
>> and use the className in the template. This will only run once when the
>> data comes in. after that, it is a simple lookup in the template.
>>
>> regards,
>> Sander
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Angular and AngularJS discussion" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to angular+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/angular/df539074-0cc8-4510-aea9-9bf8183394bfo%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Angular and AngularJS discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to angular+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/angular/CAGSnwRd0zm6NDim6uNoCV4OWfgtyb0Wk1wfo5TvSp9wDd_9_VQ%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/CABOHK3R_GkF8NLFMwdgLaexoLcg6yMK4Uayf62vmrzh%3D4CXebA%40mail.gmail.com.


Re: [AngularJS] Re: Performance issue on any event like button click, mouse over, typing in angular-7

2020-06-20 Thread ajit dash
Thank you so much Sander,
Agreed, I will try your approach.


Thanks,
Ajit

On Sat, Jun 20, 2020 at 12:05 AM Sander Elias  wrote:

> Ajit,
>
> I can repeat my previous reply. Using functions in templates is an
> antipattern in Angular, and should be a last-stop solution. Each of those
> functions is called numerous times. This will cause a performance hit. What
> you can do is some memorization in the functions itself.
> A better solution would be adding the needed data to the rows itself.
> In cases like this I usually so something in my controller like this:
> rows.forEach(row=>row[className]=calculate(...))
>
> and use the className in the template. This will only run once when the
> data comes in. after that, it is a simple lookup in the template.
>
> regards,
> Sander
>
> --
> You received this message because you are subscribed to the Google Groups
> "Angular and AngularJS discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to angular+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/angular/df539074-0cc8-4510-aea9-9bf8183394bfo%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/CAGSnwRd0zm6NDim6uNoCV4OWfgtyb0Wk1wfo5TvSp9wDd_9_VQ%40mail.gmail.com.


[AngularJS] Re: Performance issue on any event like button click, mouse over, typing in angular-7

2020-06-19 Thread Sander Elias
Ajit,

I can repeat my previous reply. Using functions in templates is an 
antipattern in Angular, and should be a last-stop solution. Each of those 
functions is called numerous times. This will cause a performance hit. What 
you can do is some memorization in the functions itself.
A better solution would be adding the needed data to the rows itself.
In cases like this I usually so something in my controller like this:
rows.forEach(row=>row[className]=calculate(...))

and use the className in the template. This will only run once when the 
data comes in. after that, it is a simple lookup in the template.

regards,
Sander

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/df539074-0cc8-4510-aea9-9bf8183394bfo%40googlegroups.com.


[AngularJS] Re: Performance issue on any event like button click, mouse over, typing in angular-7

2020-06-18 Thread Ajit
Any help or suggestion on this?

On Monday, 15 June 2020 00:44:43 UTC-5, Ajit wrote:
>
> Thank you Sander for your response.
>
> One example of my schenario is:
>
> Template calling function(e.g. [ngClass] = "getClass(parameter1, 
> parameter2)") which resides in the component class. I am unable to make 
> this without callinga function as I have multiple rows and each row css 
> class wouold be different based on the row data. This is one example and 
> like this there ae many.
>
> I am trying to avoid refactoring as I have to do for the whole application 
> and it would be lot of effort required and again the whole app need to be 
> retested. 
> Hence I am trying to see is there any alternate approach available to 
> improve the performance. 
>
> Again the application is fully developed and I am the new one to the 
> application. So to refactor I need to understand the whole application 
> which will take time.
>
>
>
> Thanks,
> Ajit Dash
>
>
> On Monday, 15 June 2020 00:05:46 UTC-5, Sander Elias wrote:
>>
>> Hi Ajit,
>>
>> It sound like you are doing too much logic inside the template. Move 
>> most, if not all of the logic to the controller and it will get better. 
>> Also, are you also sure you need to all your choices on a mouseClick? 
>> perhaps refactor your app so, that it only "recalculates" when data-changes 
>> occur.
>>
>> Regards
>> Sander
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/d57413f5-6cbc-40b3-8582-47373a5d7e75o%40googlegroups.com.


[AngularJS] Re: Performance issue on any event like button click, mouse over, typing in angular-7

2020-06-14 Thread Ajit
Thank you Sander for your response.

One example of my schenario is:

Template calling function(e.g. [ngClass] = "getClass(parameter1, 
parameter2)") which resides in the component class. I am unable to make 
this without callinga function as I have multiple rows and each row css 
class wouold be different based on the row data. This is one example and 
like this there ae many.

I am trying to avoid refactoring as I have to do for the whole application 
and it would be lot of effort required and again the whole app need to be 
retested. 
Hence I am trying to see is there any alternate approach available to 
improve the performance. 

Again the application is fully developed and I am the new one to the 
application. So to refactor I need to understand the whole application 
which will take time.



Thanks,
Ajit Dash


On Monday, 15 June 2020 00:05:46 UTC-5, Sander Elias wrote:
>
> Hi Ajit,
>
> It sound like you are doing too much logic inside the template. Move most, 
> if not all of the logic to the controller and it will get better. 
> Also, are you also sure you need to all your choices on a mouseClick? 
> perhaps refactor your app so, that it only "recalculates" when data-changes 
> occur.
>
> Regards
> Sander
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/f3703d2a-8464-46d9-b8f8-ad3086c79c6eo%40googlegroups.com.


[AngularJS] Re: Performance issue on any event like button click, mouse over, typing in angular-7

2020-06-14 Thread Sander Elias
Hi Ajit,

It sound like you are doing too much logic inside the template. Move most, 
if not all of the logic to the controller and it will get better. 
Also, are you also sure you need to all your choices on a mouseClick? 
perhaps refactor your app so, that it only "recalculates" when data-changes 
occur.

Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/f0bb9115-ca61-4e38-84c2-173dbcf7abd3o%40googlegroups.com.


Re: [AngularJS] Re: Performance Issue

2019-08-15 Thread Tito
https://code.angularjs.org/1.7.8/angular.min.js

On Thursday, August 15, 2019 at 5:54:31 PM UTC-7, Fariza Tajuddin wrote:
>
> I already try to minified my code and it's still the same 
> performance.Maybe more fast but not much as expected?is it because the 
> browser version not supported or maybe ram,cpu of the box?
>
> On Fri, Aug 16, 2019 at 8:06 AM Tito > 
> wrote:
>
>> are you using the full blown angular js or minified?
>>
>> https://gist.github.com/Restuta/cda69e50a853aa64912d
>>
>> On Thursday, August 15, 2019 at 3:34:05 AM UTC-7, Fariza Tajuddin wrote:
>>>
>>> Hi..
>>> I am developer for STB , previously we just used js for our code but for 
>>> new version we upgrade using angularjs.
>>> But the preformance for older box become worst using the new code.it's 
>>> it because the browser not supported the angular js?for your info, STB box 
>>> for linux box STB EC2108E: webkit version 3.0.0.2888 STB EC2108EB : webkit 
>>> version 3.0.0.2890
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Angular and AngularJS discussion" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ang...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/angular/ba57007e-11f5-4b48-8fb1-7f11804e4a25%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/96cac8df-4abd-4782-bef3-8f9882c45184%40googlegroups.com.


Re: [AngularJS] Re: Performance Issue

2019-08-15 Thread Tito
not minified your code, but minified  angularJS 

On Thursday, August 15, 2019 at 5:54:31 PM UTC-7, Fariza Tajuddin wrote:
>
> I already try to minified my code and it's still the same 
> performance.Maybe more fast but not much as expected?is it because the 
> browser version not supported or maybe ram,cpu of the box?
>
> On Fri, Aug 16, 2019 at 8:06 AM Tito > 
> wrote:
>
>> are you using the full blown angular js or minified?
>>
>> https://gist.github.com/Restuta/cda69e50a853aa64912d 
>> 
>>
>> On Thursday, August 15, 2019 at 3:34:05 AM UTC-7, Fariza Tajuddin wrote:
>>>
>>> Hi..
>>> I am developer for STB , previously we just used js for our code but for 
>>> new version we upgrade using angularjs.
>>> But the preformance for older box become worst using the new code.it's 
>>> it because the browser not supported the angular js?for your info, STB box 
>>> for linux box STB EC2108E: webkit version 3.0.0.2888 STB EC2108EB : webkit 
>>> version 3.0.0.2890
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Angular and AngularJS discussion" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ang...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/angular/ba57007e-11f5-4b48-8fb1-7f11804e4a25%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/5817339f-cecf-4260-9818-752aab6890d1%40googlegroups.com.


Re: [AngularJS] Re: Performance Issue

2019-08-15 Thread Fariza Tajuddin
I already try to minified my code and it's still the same performance.Maybe
more fast but not much as expected?is it because the browser version not
supported or maybe ram,cpu of the box?

On Fri, Aug 16, 2019 at 8:06 AM Tito  wrote:

> are you using the full blown angular js or minified?
>
> https://gist.github.com/Restuta/cda69e50a853aa64912d
>
> On Thursday, August 15, 2019 at 3:34:05 AM UTC-7, Fariza Tajuddin wrote:
>>
>> Hi..
>> I am developer for STB , previously we just used js for our code but for
>> new version we upgrade using angularjs.
>> But the preformance for older box become worst using the new code.it's
>> it because the browser not supported the angular js?for your info, STB box
>> for linux box STB EC2108E: webkit version 3.0.0.2888 STB EC2108EB : webkit
>> version 3.0.0.2890
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Angular and AngularJS discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to angular+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/angular/ba57007e-11f5-4b48-8fb1-7f11804e4a25%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/CAGw61-ZZbbOjHfvvamPmyjFdA6Ue8RjrcyYoZsrfbd3e_cB_7w%40mail.gmail.com.


[AngularJS] Re: Performance Issue

2019-08-15 Thread Tito
are you using the full blown angular js or minified?

https://gist.github.com/Restuta/cda69e50a853aa64912d

On Thursday, August 15, 2019 at 3:34:05 AM UTC-7, Fariza Tajuddin wrote:
>
> Hi..
> I am developer for STB , previously we just used js for our code but for 
> new version we upgrade using angularjs.
> But the preformance for older box become worst using the new code.it's it 
> because the browser not supported the angular js?for your info, STB box for 
> linux box STB EC2108E: webkit version 3.0.0.2888 STB EC2108EB : webkit 
> version 3.0.0.2890
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/ba57007e-11f5-4b48-8fb1-7f11804e4a25%40googlegroups.com.


[AngularJS] Re: Performance issue accessing Angular 2 application on Internet explore

2018-04-30 Thread Sander Elias
Hi Suraj,

Every computer that can run IE11, can run a proper browser too. I would 
show the user they are using an outdated browser and that there are 
consequences for that.
It is really about time we stopped supporting ancient tech.
Explain your boss/customer that fixing this issue for IE11 will cost almost 
as much as creating the product in the first place. Your not even lying 
when you do that. Usually, that will make them switch.

For real, solving this problem means you have to profile your app in IE, 
and then address the pain points in there. (probably making it slower in 
every other browser, so then you need to take care of that too, leaving you 
with 2 code-paths that are there to do the same thing) 

Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Performance Issue

2014-08-22 Thread Mashhood Rastgar
Hey guys,

I am having a similar problem with a site I have 
made: http://mynewcompany.com/order

The website works fine on desktop, but takes more than 15s to switch 
between views on mobile (iPod5, Moto G).

I have tried removing the ng-repeats, but they did not improve the 
performance by much, the page however does has many form input fields.

What would be the best way to profile the application and get to know what 
exactly is causing the issue?

Thanks!

On Friday, 7 February 2014 12:17:42 UTC+5, Bob James wrote:
>
> HI, We are using angular 1.1.x version and we are seeing the slow 
> performance in mobile browser. once we hit the desktop browser it look 
> fine. is any thing we are making wrong for mobile browser or we should take 
> care? we are using many ng-directive on those pages also.some is any 
> limitation with angular for mobile browser?
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.