Re: Method call profiler?
scott-y6qSm6YX8/[email protected]
| Newsgroups | gmane.comp.audio.supercollider.devel |
|---|---|
| Message-ID | <CANmfHJ9VCRvpLyM6Yhe=Ac8M6-G4Gy_zJvuHwjuEogS-iCqJtg@mail.gmail.com> |
I agree about WSLib - great library, but a constant disruption to have a million obscure add-on methods floating around. I tried to solve the implicit dependency problem in the QuarkEditor quark ( https://github.com/scztt/QuarkEditor.quark), by doing a static analysis on symbols, as you suggested, to determine if any non-library dependencies have crept in to your quark. I believe I'm ONLY doing it on classes, not method invocations - there *is* code to do the method searching required in DependencyWalker, but It's REALLY slow to run - and because of dispatch, as james mentioned, obviously it can't *deterministically* find dependencies, only provide warnings about possible problems. I've got plans to add back a check for method invocations that have implicit dependencies to QuarkEditor, in a way that's manually user-invocable (because it takes some time). DependencyWalker is somewhat oriented towards operating on .sc files, but it would be an easy addition to add support for checking dependencies of arbitrary SC functions, or even something like all functions defined in global scope plus the current environment, or whatever. I'd be happy to accept a PR that adds this functionality. - S On Fri, Mar 30, 2018 at 4:40 AM <[email protected]> wrote: > > > > On 30/03/2018, at 11:04 , [email protected] wrote: > > > > Currently, there is no way to know which quarks and other extensions are > required for a given block of code. It may be possible to parse out method > selectors, but there's no way to know which implementations of those > selectors are actually invoked. > > I once wrote up something that put all class and method names in a given > quark into a text file within that quark folder, > so one could load it, and figure out that way which quark an unknown > method call may need. > Can try to find that if you like. > > > What if there were a debug mode that kept a table of every method > invocation? E.g. class, method, number of calls, perhaps execution time. It > would have a lot of calls to core methods, but it wouldn't be hard to > search for extension directories. > > > > One use case: sharing code. To share code, you also need to share > extensions on which the code depends. It's very easy to use some method in > a quark that you installed ages ago and forgot about, and you're > "absolutely sure" you're using only main library methods, but then it > breaks when your friend runs it. As of now, we not only don't have a good > way to handle this -- we have *no* way. You're totally on your own. > > For that use, you can always get a list of which quarks you have installed > when you test whether your patch to be shared runs, with: > Quarks.installed.collect(_.name).cs; > and then you have a known good config, which you can put that in the > codefile you hand to your friend: > ["mylib","etc"].do(Quarks.install(_); > > Or copy your current config and prune it down to see what the minimum > working set of quarks is... > > best adc > > > > _______________________________________________ > sc-dev mailing list > > info (subscription, etc.): > http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx > archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/ > search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/ >