Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are Angular date pickers so slow?

Why do Angular JS date pickers use so much CPU? When you have a few of them on a page they significantly slow a site down.

Is there any way to mitigate this?

For example, the official Angular for Bootstrap directive:

enter image description here

And the mobinni/material-date-picker:

enter image description here

like image 333
Richard Avatar asked May 30 '26 00:05

Richard


1 Answers

Since I couldn't find an efficient AngularJS datepicker I switched to using a standalone one that doesn't block the AngularJS digest: https://github.com/dbushell/Pikaday. My application is now much faster.

As for the suggestions in the comments, I don't see how a wrapper would make anything faster (more code = less speed), and I can't change the code of an external component safely.

I guess maybe people just write components badly. Or perhaps this type of frustration is inherent in AngularJS and why people are switching to React.

like image 199
Richard Avatar answered May 31 '26 15:05

Richard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!