On Friday, January 31, 2014 9:31:49 AM UTC-5, Edward K. Ream wrote:

> 1. A prepass will probably be needed to ensure that all nodes in the 
@file tree have the proper format.

Yesterday I created the infrastructure needed to make this happen.  Rather 
than stupidly creating a separate scanner for most language, the importer 
now contains the following:

    def scanner_for_ext(self,ext):
        '''A factory returning a scanner function for the given file 
extension.'''
        aClass = ext and self.classDispatchDict.get(ext)
        def scanner_for_class(atAuto,parent,s):
            scanner = aClass(importCommands=self,atAuto=atAuto)
            return scanner.run(s,parent)
        return scanner_for_class if aClass else None

The same kind of code can be used to create custom scanners that will be 
used for the prepass.

> In fact, the regularizer prepass will probably be needed whenever writing 
with new_auto enabled.

Yesterday I became quite concerned about the speed of the new @auto code.  
Here are some statistics for the revised leoGlobals.py::

precompute_all_data
  find_imported_organizer_nodes:   0.01 sec
  create_organizer_data:           0.06 sec
  create_actual_organizer_nodes:   0.01 sec
  create_tree_structure:           0.00 sec
  compute_all_organized_positions: 5.34 sec
  create_anchors_d:                0.00 sec
create_organizer_nodes
  pre_move_comments:   0.02 sec
  precompute_all_data: 5.43 sec
  demote:              0.14 sec
  move_nodes:          2.32 sec
  post_move_comments:  0.12 sec
@auto-view moved 349 nodes in 9.21 sec. for @auto 
c:\Users\edreamleo\leoGlobalsMod2.py

The stats for vc.compute_all_organized_positions are obviously the 
culprit.  Imo, it should be possible to make this code run in 0.1 sec. or 
less.  That's next.

Otoh, the time for vc.demote is a pleasant surprise, despite its 
complexity.  Imo, vc.move_nodes should be able to run in 0.1 sec. or less, 
but this will not be easily accomplished.  You could say that the present 
code is an existence proof, but doing better will require careful 
housekeeping.  The problem, as always, is that positions on the work list 
change when moved.  I have some ideas about how to work around this 
problem, but this is not urgent just now.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to