Simon Wright <[email protected]> writes:
> On 15 Jun 2014, at 00:53, Stephen Leake <[email protected]>
> wrote:
>
>> 3) C-M-; (time-it 'wisi-parse-buffer 1)
>
> Here, it’s M-:
>
>> on my machine, this gives 1.248 seconds (+- 0.02)
>
> In gnatcoll-gpl-2014, gnatcoll-projects.adb is 8652 lines.
>
> 7.2s, subsequent call 7.6s. (This was after byte-recompile-directory;
> it took 5.5s before recompilation!)
That makes no sense; it should be faster after byte-compile, and much
slower on the second iteration.
When running the mtn code, it would be best to use
ada-mode/build/wisi/Makefile, target 'byte-compile', to do the
byte-compilation.
I believe the slowdown on the second iteration is due to storing the
text properties; that causes the buffer text to be represented as a
many-node tree, which is slower to navigate. Initially, it's a tree with
one node; after parsing, it has many nodes.
I ran the elisp profiler, and discovered that wisi-set-end was scanning
the same text repeatedly for nested declarations. I implemented a new
algorithm for wisi-set-end in 78ca9696a723824aaf8f777722bd449f5ad44c8f;
it no longer scans the text at all, thus avoiding the issue of the
many-node tree.
My times for parsing gnatcoll-projects.adb are now:
first: 1.046000
later: 1.295000
before, it was:
first: 1.264000
later: 2.402000
so during editing, it's about twice as fast.
I still want to try caching the parser state to speed up parsing after
edits.
--
-- Stephe
_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org