ionic-example icon indicating copy to clipboard operation
ionic-example copied to clipboard

TypeORM slow down startup time of ionic app

Open thibaud-sanchez opened this issue 7 years ago • 2 comments

I can reproduce it on a new project, If I add TypeORM according to the Readme file to my project, my app start normally in about 4sec (prod mode).

But if somewhere in my app I use an entity created for typeORM (without creating database connection and without inserting it, just a new), like : let user = new TestUser();

I noticed that my app take 2 seconds more to start even if my new is never called nowhere... Is it possible to do this job in background and not at startup, because I don't really need TypeORM at startup.

Do you know why does it slow down the app startup ? I can give you a step to reproduce if you tell me it's abnormal.

thibaud-sanchez avatar Nov 14 '18 11:11 thibaud-sanchez

@thibaud-sanchez Did you ever get this figured out? I suspect this is a large reason by app takes so long to launch. I want to use TypeORM but I'll just use key:value storage if it's going to speed up my startup significantly...

joshstrange avatar Jun 30 '19 14:06 joshstrange

I just faced the same challenge, I tried the Ionic Demo App (super simple blank app) and the launch time is about 10 seconds on my machine, just by adding TypeOrm. (only checked in the browser)

HeikoKanzler avatar Aug 18 '20 15:08 HeikoKanzler