robshakir / pyangbind

A plugin for pyang that creates Python bindings for a YANG model.
Other
204 stars 121 forks source link

Expected file size of generated py #358

Closed preetjuniper closed 3 months ago

preetjuniper commented 3 months ago

Hi, this is an observation and not necessarily a bug report. With pyang==2.6.1 and pyangbind==0.8.6, I cloned this repo and ran the generate_bindings.sh script in docs/example/oc-network-instance. The resulting binding.py file was 58M in size. The rest of the example worked, I tried serializing to JSON, etc. I also tried with some older versions of pyangbind and pyang and got a similar file size. Even with some smaller yang modules I tried, I see fairly large files. Is the large file size expected?

xavier-contreras commented 3 months ago

network-instance is a pretty heavy model and the generated file is ~700K lines, and although I didn't check all it's the worse case of all that I checked. Others are not so heavy though. This project uses generated models, the generated system.py is only 2MB as an example, but others are in the KB range.

https://github.com/google/gnxi/tree/master/oc_config_validate/oc_config_validate/models

preetjuniper commented 3 months ago

Thanks for the reply/confirmation