Updates on prototype of new Leo data model

44 views
Skip to first unread message

vitalije

unread,
May 29, 2018, 5:09:42 PM5/29/18
to leo-editor
For the last ten days or so, I have made almost no progress on the prototype, being very occupied by other stuff.

Today, I have made importer for python files. New model now handles at-auto for python files. Benchmark comparison with the present Leo's python importer gave the following results:

# importing pydoc.py from the Python Standard Library
import_py_new avg
:40.0ms
import_py_legacy avg
:552.5ms

# importing difflib.py from the Python Standard Library
import_py_new avg:24.9ms

import_py_legacy avg:420.1ms

# importing BaseHTTPServer.py from the Python Standard Library
import_py_new avg:9.3ms

import_py_legacy avg:137.2ms


It seems the new code is somewhat between 13 and 15 times faster.

The prototype needs more code polishing, documenting,... In its current state it is not very readable, at least some parts. I am not sure that it is a good idea to show it before it is ready. OTOH, I won't be able to work on it in the next two weeks.

The new auto_py function, which reads python source file and builds outline, is written at first using leoNodes.VNode class, and then adapted to use the new data model. It can be easily set as a replacement for the current python importer. It comes in pair with the new p_to_autolines function which returns a generator of text lines generated from an at-auto node. 

I would like very much to delay publishing of all this code until it is fully polished and ready. But if you want to test the new code, I can share it in its current state as an alpha version. However, in that case, I must urge Edward not to make any decisions about the new code until it is fully ready. I am almost certain that it would be possible for both models to coexist for a while. The new model doesn't require any change in the Leo legacy code. Legacy code can delegate some tasks to the new model, where convenient. The new data model can be just one more plugin or core python file in Leo installation.

Vitalije

Edward K. Ream

unread,
May 29, 2018, 5:32:56 PM5/29/18
to leo-editor
On Tue, May 29, 2018 at 4:09 PM, vitalije <vita...@gmail.com> wrote:
It seems the new code is somewhat between 13 and 15 times faster.
​..​

The prototype needs more code polishing, documenting,... In its current state it is not very readable, at least some parts. I am not sure that it is a good idea to show it before it is ready.

​You big tease, you :-)

Edward

Edward K. Ream

unread,
May 29, 2018, 5:48:48 PM5/29/18
to leo-editor
​To be clear, I would like to see what you have, polished or not.

Edward

vitalije

unread,
May 29, 2018, 6:12:13 PM5/29/18
to leo-editor

I hope google will accept this attachment.

Vitalije
leo-data-model.zip

Edward K. Ream

unread,
May 29, 2018, 7:15:41 PM5/29/18
to leo-editor
On Tue, May 29, 2018 at 5:12 PM, vitalije <vita...@gmail.com> wrote:

I hope google will accept this attachment.

​Yes.  I have it.  Thanks for sending it.

Edward
Reply all
Reply to author
Forward
0 new messages