On Mon, Oct 8, 2018 at 1:56 AM Marko Ristin-Kaufmann <marko.ris...@gmail.com> wrote: > > Hi Crhis, > >> Have you tried just generating the docstrings at decoration time and >> applying them? By the sound of it, they won't change after that, and >> the only reason to run it later is performance... but have you >> actually measured a performance hit resulting from that? > > > I did. On my laptop (Intel i7-4700MQ), it takes about 4-12 milliseconds to > parse and reformat a single condition lambda function of a contract. This > quickly adds up to a couple of seconds if you have thousands of condition > functions to parse. This might not be a problem for a limited code base, but > I imagine that it could get inefficient very quickly as soon as the contract > usage would spread to the dependencies as well. Not dead-slow inefficient, > but inefficient enough to consider whether the automatic doc generation is > worth it. >
Thanks. Having actual numbers is helpful. It may be worth looking into this as part of a broader lazy-generation feature, as has recently been rolled out to annotations, and is periodically discussed elsewhere. ChrisA _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/