lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>> All I'll need is some automated statistics gatherer... Or at least we,
>> here on list, should come up with description of how it should work.

Writing such a program is not a simplest task in the world ;-)

Just consider:

a.f(b.g())

Is it a variadic function callsite with fixed number of arguments or not?

In general we need to perform a complex data-flow analysis to build a good approximation...

Unfortunately we are short on frameworks, so we have to build a whole data-flow infrastructure from scratch.

Other approach is just to count call-sites with argument lists ending with non-call _expression_ (such callsites definetely has fixed number of arguments) and compare the number to the total number of call-sites. But I am not sure to interpret results.

--
e.v.e


On Thu, Nov 26, 2009 at 7:03 PM, Alexander Gladysh <agladysh@gmail.com> wrote:
>> Unrolling usually only helps if the trip count is low and
>> constant. The latter is often not the case with varargs.

> I was explicitly reasoning about callsites with _fixed_ number of
> arguments.

> I presume that callsites for vararg functions usually have fixed number of
> arguments. I do not have any statistics, so I might be wrong.

If it'll help, I can help with statistics (for my specific code style,
of course, but over a lot of code).

All I'll need is some automated statistics gatherer... Or at least we,
here on list, should come up with description of how it should work.

Also we can extract some stats from publicly available code (say, find
all Lua files on codesearch.google.com, download code, and run
analyzer over them.)

I feel that analysis of existing Lua code can yield some revealing
results in general. People on the list (including myself) keep talking
about what is "usual" for Lua and what is not, but there is no actual
research done (that I know of -- or is there?).

Alexander.