[Top][All Lists]

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

Re: Patch to allow make to load plugins that add new functions.

From: Eldar Abusalimov
Subject: Re: Patch to allow make to load plugins that add new functions.
Date: Wed, 11 Apr 2012 01:52:39 +0400


2012/4/10 Eric Melski <address@hidden>
So there's definitely interest in collaboration on our end; is there any interest from the gmake devs?

I'm currently working on improving performance of gmake variable expansion engine. In particular, I have rewritten the way of handling 'call' arguments and iteration variable of 'foreach' function, hereby achieving O(1) complexity of variable look up when being inside such contexts (instead of O(depth), where depth is number of nesting $(call ...) or $(foreach ...)). Now the patched version shows more than 2x speed up on a benchmark based on gmsl-tests and even more in case of deep call recursion, e.g. it is 7x faster on reversing a list of 1000 x'es.

The patch also involves different memory management optimizations such as allocating as mush as possible on the stack and avoiding unnecessary memcpy'es, but the first thing that I have rewritten was "variable_buffer". Instead of using a single global pointer and swapping it when necessary, a special "struct vbuffer" object was introduced, which is passed in every 'func_xxx' function and other variable expansion routines. Practically, it is possible to create a local buffer, and perform an expansion into it, without interfering with any global structure. So, I think, such interface could be a part of gmake-/emake-independent API for plugins.

Now the patch is mostly done, but I didn't send it because some parts of code are still poorly documented. I planned to complete in a few weeks, but I have no time right now, so you could take a look at draft version here: http://pastebin.com/UGs6aawV
I would appreciate any comments.

Best regards,
Eldar Sh. Abusalimov

reply via email to

[Prev in Thread] Current Thread [Next in Thread]