CLI very slow
I'm just wondering whether it is normal behavior that a built quicktype takes around 15-20 seconds to actually generate a class from a json file. Is this normal behavior and if so, is it because of all the dependencies? I'm trying to generate C# classes with json schema's as input and its really slow.
Could you share your schema with us? What is the file size at least? This is very slow for JSON schema input.
I don't think it's the dependencies—quicktype has relatively few.
If you just invoke quicktype without any options, how long does that take?
When invoking QuickType without parameters it takes ages. Doesn’t matter with or without so my guess was something in the initialization of QuickType
How did you install quicktype? Via NPM?
What version of node and what OS?
i run it in my own container and basically followed the readme on github to install. node version v8.9.4 and its a container running ubuntu version 16.04 LTS
also ran quicktype through NPM yes
Can you please give us much more information? What is the host OS? Docker version? Host RAM? Docker RAM?
Well actually I’m running it in AKS (Azure managed Kubernetes environment) with no restrictions set on resources on Docker level. The Nodes that it is running on are standard Dv3 vms on azure (standard on AKS).
It’s running on a self hosted VSTS Agent which in turn uses Ubuntu as its base image. This it the link
The environment doesn’t affect it though. I have the same issue running the same container locally on my i7 32GB desktop with all the default preinstalled Docker settings
appcenter-cli is a similar JavaScript CLI on npm — what do you get for time appcenter help?
i have the same issue if i get your docker image from the hub and try it locally or on Azure. It takes between 12-15 seconds to show the help. Appcenter though, both on my own created image as well as your own docker image shows help instantly.
I see the problem. This is not how you run quicktype. For some reason you are running our development script that reinstalls dependencies and compiles quicktype whenever you run it, as least in these screenshots.
Here is how to run quicktype:
$ npm install -g quicktype
$ quicktype
Or to run from source, which you appear to be doing:
$ npm install # build quicktype
$ node dist/cli.js
How did you come to use quicktype this way? What are you trying to do with quicktype? Perhaps I can suggest a better way to run it as a local npm dependency.
I basically want to use it to generate C# poco classes based on Json or json schema input through cli on my vsts Agent. That’s the goal. What would be the best approach to do that? Simply download and install the npm package and run it on the Agent in your first example ?
Yes, install it as a global dependency with npm install -g — I don't see any reason for you to build it from source.
Is it fast now? 😄
yeah. it's fast now. from the source out, i was looking on the wrong place apparently. I overlooked the cli.js and went straight to the quicktype script. Thanks for the quick reply! 👍