David, Richard, Graham, Jan,
On Fri, Dec 7, 2012 at 3:07 PM, Joao E. Pereira Jr <[email protected]> wrote:
> David,
>
> On Fri, Dec 7, 2012 at 2:10 PM, David Kastrup <[email protected]> wrote:
>> "Joao E. Pereira Jr" <[email protected]> writes:
>>
>>> Hi team,
>>>
>>> Most lilypond GUI projects (Frescobaldi, Denemo) I have seen implement
>>> a wrapper in lilypond. I am investigating the possibility to transform
>>> lilypond in a more interactive compiler. I have little understanding
>>> of the code for now, and noticed that before start to parse
>>> Lily_parser executes a huge amount of code loading init.ly and his
>>> sons. Could that loading process be isolated, pre executed and
>>> maintained in memory to serve posterior requests?
>>
>> You might want to look at how LilyPond deals with multiple files on the
>> command line and the -djob-count option.
>
> I haven't noticed difference in the output of the following comands,
> maybe wasn't exactly what you meant:
>
> out/bin/lilypond ../input/regression/clef-octavation.ly
> ../input/regression/chromatic-scales.ly
>
> out/bin/lilypond -djob-count ../input/regression/clef-octavation.ly
> ../input/regression/chromatic-scales.ly
>
I figured out. I was missing the value of job-count attribute. My
attached gdb session shows that both childs start to execute the
init.ly loading code. I know that job-count saves the repeated
execution of main_with_guile(). My goal now is understand how many
percent of whole parsing process this loading code represent, and how
the complexity of isolating this and maintain in memory. Why this
loading init.ly is called from parse_file() ? and why it should be
called for every file to parse?
>>
>>> Following the same thinking line could the data structure (contexts,
>>> music, property, graphical objects) be maintained in memory and
>>> changed as user input changes. Some user changes would affect only one
>>> graphical object and maybe trigger a reformatting, others would affect
>>> a property object and trigger a partial recompiling, others would
>>> affect the ly file and require compiling from scratch.
>>
>> The bookkeeping for that kind of thing would likely be prohibitively
>> expensive.
This is almost becoming a Ph.D research plan. It's about how a backend
to Scorio.com is supposed to be. I think that it would need many big
machines to achieve scalable human interactive time response. I'll
take a more detailed look in Denemo, Schikkers-List, and Firelily if a
have agenda. For now I'm worrying about daemonize lilypond, my first
concern is acquire as many architectural knowledge as I can. The
research will not include the frontend, maybe not even the lilypond
formatter plugin, as in my opinion it would spend another research
itself.
>
> Appears that I'll have to convince some investors.
>
>>
>>> I may be saying a lot of non sense, but I would like to know in
>>> details why is this a bad (very bad) idea!
>>
>> The only way to know in detail is to try.
>>
> That's good news, I'll improve the idea.
>
>> --
>> David Kastrup
>>
>>
>> _______________________________________________
>> lilypond-devel mailing list
>> [email protected]
>> https://lists.gnu.org/mailman/listinfo/lilypond-devel
>
>
>
> --
> João E. Pereira Jr
--
João E. Pereira Jr
joaoepj@jmobile /mnt/docs/empresa/lilypond-2.17.6/build (staging)$ gdb
out/bin/lilypond
...
(gdb) run -djob-count=2 ../input/regression/chromatic-scales.ly
../input/regression/clef-octavation.ly
...
Breakpoint 1, scm_apply_0 (proc=0x7ffff4118840, args=0x404) at eval.c:4700
4700 return scm_apply (proc, args, SCM_EOL);
(gdb) info inferiors
Num Description Executable
* 1 process 5991
/mnt/docs/empresa/lilypond-2.17.6/build/out/bin/lilypond
(gdb) ps args
()
$1 = void
(gdb) c
Continuing.
[New process 5998]
...
lilypond-main-joblist: 1
lilypond-main-files: (../input/regression/chromatic-scales.ly)
[Switching to Thread 0x7ffff7fc7720 (LWP 5998)]
Breakpoint 1, scm_apply_0 (proc=0x7ffff4118840, args=0x404) at eval.c:4700
4700 return scm_apply (proc, args, SCM_EOL);
(gdb) info inferiors
Num Description Executable
* 2 process 5998
/mnt/docs/empresa/lilypond-2.17.6/build/out/bin/lilypond
1 process 5991
/mnt/docs/empresa/lilypond-2.17.6/build/out/bin/lilypond
(gdb) c
Continuing.
Breakpoint 1, scm_apply_0 (proc=0x7fffeece0d80, args=0x7fffeee0cf60) at
eval.c:4700
4700 return scm_apply (proc, args, SCM_EOL);
(gdb) ps args
(#<Lily_parser #<Lily_lexer (#<module 7ffff3ae7760>) > > #<location
/mnt/docs/empresa/lilypond-2.17.6/build/out/share/lilypond/current/ly/music-functions-init.ly:935:19>
#<Music function #<procedure #f (location parser type once)>> (#f apart))
$2 = void
(gdb) c
Continuing.
Breakpoint 1, scm_apply_0 (proc=0x7fffeece0d80, args=0x7fffeee0aef0) at
eval.c:4700
4700 return scm_apply (proc, args, SCM_EOL);
(gdb) ps args
(#<Lily_parser #<Lily_lexer (#<module 7ffff3ae7760>) > > #<location
/mnt/docs/empresa/lilypond-2.17.6/build/out/share/lilypond/current/ly/music-functions-init.ly:936:23>
#<Music function #<procedure #f (location parser type once)>> (#t apart))
$3 = void
(gdb) c
Continuing.
Breakpoint 1, scm_apply_0 (proc=0x7fffeece0d80, args=0x7fffeee0f010) at
eval.c:4700
4700 return scm_apply (proc, args, SCM_EOL);
(gdb) ps args
(#<Lily_parser #<Lily_lexer (#<module 7ffff3ae7760>) > > #<location
/mnt/docs/empresa/lilypond-2.17.6/build/out/share/lilypond/current/ly/music-functions-init.ly:937:20>
#<Music function #<procedure #f (location parser type once)>> (#f chords))
$4 = void
(gdb) c
Continuing.
Breakpoint 1, scm_apply_0 (proc=0x7fffeece0d80, args=0x7fffeee0d540) at
eval.c:4700
4700 return scm_apply (proc, args, SCM_EOL);
...
(gdb) thread 1
[Switching to thread 1 (Thread 0x7ffff7fc7720 (LWP 5991))]
#0 0x00007ffff51079c6 in __libc_fork () at
../nptl/sysdeps/unix/sysv/linux/fork.c:131
131 ../nptl/sysdeps/unix/sysv/linux/fork.c: No such file or directory.
in ../nptl/sysdeps/unix/sysv/linux/fork.c
(gdb) c
Continuing.
[New process 6025]
...
lilypond-main-joblist: 0
lilypond-main-files: (../input/regression/clef-octavation.ly)
[Switching to Thread 0x7ffff7fc7720 (LWP 6025)]
Breakpoint 1, scm_apply_0 (proc=0x7ffff4118840, args=0x404) at eval.c:4700
4700 return scm_apply (proc, args, SCM_EOL);
(gdb) ps args
()
$5 = void
(gdb) c
Continuing.
Breakpoint 1, scm_apply_0 (proc=0x7fffeece0d80, args=0x7fffeee0cf60) at
eval.c:4700
4700 return scm_apply (proc, args, SCM_EOL);
(gdb) ps args
(#<Lily_parser #<Lily_lexer (#<module 7ffff3ae7760>) > > #<location
/mnt/docs/empresa/lilypond-2.17.6/build/out/share/lilypond/current/ly/music-functions-init.ly:935:19>
#<Music function #<procedure #f (location parser type once)>> (#f apart))
$6 = void
(gdb) info thread
Id Target Id Frame
* 3 Thread 0x7ffff7fc7720 (LWP 6025) "lilypond" scm_apply_0
(proc=0x7fffeece0d80, args=0x7fffeee0cf60) at eval.c:4700
2 Thread 0x7ffff7fc7720 (LWP 5998) "lilypond" scm_apply_0
(proc=0x7fffeece0d80, args=0x7fffeee0d540) at eval.c:4700
1 Thread 0x7ffff7fc7720 (LWP 5991) "lilypond" 0x00007ffff51079c6 in
__libc_fork () at ../nptl/sysdeps/unix/sysv/linux/fork.c:131
(gdb) c
Continuing.
Breakpoint 1, scm_apply_0 (proc=0x7fffeece0d80, args=0x7fffeee0aef0) at
eval.c:4700
4700 return scm_apply (proc, args, SCM_EOL);
(gdb) ps args
(#<Lily_parser #<Lily_lexer (#<module 7ffff3ae7760>) > > #<location
/mnt/docs/empresa/lilypond-2.17.6/build/out/share/lilypond/current/ly/music-functions-init.ly:936:23>
#<Music function #<procedure #f (location parser type once)>> (#t apart))
$7 = void
(gdb) thread 2
[Switching to thread 2 (Thread 0x7ffff7fc7720 (LWP 5998))]
#0 scm_apply_0 (proc=0x7fffeece0d80, args=0x7fffeee0d540) at eval.c:4700
4700 return scm_apply (proc, args, SCM_EOL);
(gdb) ps args
(#<Lily_parser #<Lily_lexer (#<module 7ffff3ae7760>) > > #<location
/mnt/docs/empresa/lilypond-2.17.6/build/out/share/lilypond/current/ly/music-functions-init.ly:938:24>
#<Music function #<procedure #f (location parser type once)>> (#t chords))
$8 = void
(gdb) thread 3
[Switching to thread 3 (Thread 0x7ffff7fc7720 (LWP 6025))]
#0 scm_apply_0 (proc=0x7fffeece0d80, args=0x7fffeee0aef0) at eval.c:4700
4700 return scm_apply (proc, args, SCM_EOL);
(gdb) ps args
(#<Lily_parser #<Lily_lexer (#<module 7ffff3ae7760>) > > #<location
/mnt/docs/empresa/lilypond-2.17.6/build/out/share/lilypond/current/ly/music-functions-init.ly:936:23>
#<Music function #<procedure #f (location parser type once)>> (#t apart))
$9 = void
(gdb) c
Continuing.
Breakpoint 1, scm_apply_0 (proc=0x7fffeece0d80, args=0x7fffeee0ecd0) at
eval.c:4700
4700 return scm_apply (proc, args, SCM_EOL);
(gdb) ps args
(#<Lily_parser #<Lily_lexer (#<module 7ffff3ae7760>) > > #<location
/mnt/docs/empresa/lilypond-2.17.6/build/out/share/lilypond/current/ly/music-functions-init.ly:937:20>
#<Music function #<procedure #f (location parser type once)>> (#f chords))
$10 = void
(gdb) c
Continuing.
Breakpoint 1, scm_apply_0 (proc=0x7fffeece0d80, args=0x7fffeee0d140) at
eval.c:4700
4700 return scm_apply (proc, args, SCM_EOL);
(gdb) ps args
(#<Lily_parser #<Lily_lexer (#<module 7ffff3ae7760>) > > #<location
/mnt/docs/empresa/lilypond-2.17.6/build/out/share/lilypond/current/ly/music-functions-init.ly:938:24>
#<Music function #<procedure #f (location parser type once)>> (#t chords))
$11 = void_______________________________________________
lilypond-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-devel