Re: [naviserver-devel] Quest for malloc

2007-01-16 Thread Zoran Vasiljevic
Am 15.01.2007 um 22:37 schrieb Zoran Vasiljevic: Am 15.01.2007 um 22:22 schrieb Mike: Zoran, I believe you misunderstood. The "patch" above limits blocks allocated by your tester to 16000 instead of 16384 blocks. The reason for this is that Zippy's "largest bucket" is configured to be

Re: [naviserver-devel] Quest for malloc

2007-01-16 Thread Stephen Deasey
On 1/16/07, Zoran Vasiljevic <[EMAIL PROTECTED]> wrote: Am 15.01.2007 um 22:37 schrieb Zoran Vasiljevic: > > Am 15.01.2007 um 22:22 schrieb Mike: > >> >> Zoran, I believe you misunderstood. The "patch" above limits blocks >> allocated by your tester to 16000 instead of 16384 blocks. The >> re

Re: [naviserver-devel] Quest for malloc

2007-01-16 Thread Gustaf Neumann
This is most probably the best variabt so far, and not complicated, such a optimizer can do "the right thing" easily. sorry for the many versions.. -gustaf { unsigned register int s = (size-1) >> 3; while (s>1) { s >>= 1; bucket++; } } if (bucket > NBUCKETS) { bucket = NBU

Re: [naviserver-devel] Quest for malloc

2007-01-16 Thread Zoran Vasiljevic
Am 16.01.2007 um 10:46 schrieb Gustaf Neumann: This is most probably the best variabt so far, and not complicated, such a optimizer can do "the right thing" easily. sorry for the many versions.. -gustaf { unsigned register int s = (size-1) >> 3; while (s>1) { s >>= 1; bucket++; }

Re: [naviserver-devel] Quest for malloc

2007-01-16 Thread Zoran Vasiljevic
Am 16.01.2007 um 10:46 schrieb Gustaf Neumann: s = (size-1) >> 3; while (s>1) { s >>= 1; bucket++; On Linux and Solaris (both x86 machines) the "long" version: s = (size-1) >> 4; while (s > 0xFF) { s = s >> 5; bucket += 5; } while (s > 0x0F) { s

Re: [naviserver-devel] Quest for malloc

2007-01-16 Thread Gustaf Neumann
Zoran Vasiljevic schrieb: Am 16.01.2007 um 10:46 schrieb Gustaf Neumann: This is most probably the best variabt so far, and not complicated, such a optimizer can do "the right thing" easily. sorry for the many versions.. -gustaf { unsigned register int s = (size-1) >> 3; while (s>1)

Re: [naviserver-devel] Quest for malloc

2007-01-16 Thread Zoran Vasiljevic
Am 16.01.2007 um 11:24 schrieb Gustaf Neumann: if all cases are used, all but the first loops are executed mostly once and could be changed into ifs... i will send you with a separate mail on such variant, but i am running currently out of battery. Guess what: it is _slower_ now then the

Re: [naviserver-devel] Quest for malloc

2007-01-16 Thread Zoran Vasiljevic
Am 16.01.2007 um 10:37 schrieb Stephen Deasey: Can you import this into CVS? Top level. You mean the tclThreadAlloc.c file on top-level of the naviserver project?

Re: [naviserver-devel] Quest for malloc

2007-01-16 Thread Gustaf Neumann
Zoran Vasiljevic schrieb: Guess what: it is _slower_ now then the s = (size-1) >> 3; while (s>1) {s >>= 1; bucket++;} I tend to like that one as it is really neat. It will also better illustrate what is being done. this is the last for today. It is the unrolled variant, with l

Re: [naviserver-devel] Quest for malloc

2007-01-16 Thread Stephen Deasey
On 1/16/07, Zoran Vasiljevic <[EMAIL PROTECTED]> wrote: Am 16.01.2007 um 10:37 schrieb Stephen Deasey: > > Can you import this into CVS? Top level. > You mean the tclThreadAlloc.c file on top-level of the naviserver project? The whole thing: README, licence, tests etc. By top level, I ju

Re: [naviserver-devel] Quest for malloc

2007-01-16 Thread Zoran Vasiljevic
Am 16.01.2007 um 12:18 schrieb Stephen Deasey: vtmalloc <-- add this It's there. Everybody can now contribute, if needed.

Re: [naviserver-devel] Quest for malloc

2007-01-16 Thread Stephen Deasey
On 1/16/07, Zoran Vasiljevic <[EMAIL PROTECTED]> wrote: Am 16.01.2007 um 12:18 schrieb Stephen Deasey: > vtmalloc <-- add this It's there. Everybody can now contribute, if needed. Rocking. I suggest putting the 0.0.3 tarball up on sourceforge, announcing on Freshmeat, and cross-posting

Re: [naviserver-devel] Quest for malloc

2007-01-16 Thread Stephen Deasey
On 1/16/07, Stephen Deasey <[EMAIL PROTECTED]> wrote: On 1/16/07, Zoran Vasiljevic <[EMAIL PROTECTED]> wrote: > > Am 16.01.2007 um 12:18 schrieb Stephen Deasey: > > > vtmalloc <-- add this > > It's there. Everybody can now contribute, if needed. > Rocking. I suggest putting the 0.0.3 tarball

Re: [naviserver-devel] Quest for malloc

2007-01-16 Thread Zoran Vasiljevic
Am 16.01.2007 um 15:41 schrieb Stephen Deasey: I suggest putting the 0.0.3 tarball up on sourceforge, announcing on Freshmeat, and cross-posting on the aolserver list. You really want random people with their random workloads on random OS to beat on this. I don't know if the pool of people h

Re: [naviserver-devel] Quest for malloc

2007-01-16 Thread Vlad Seryakov
Yes, it is combined version, but Tcl version is slightly different and Zoran took it over to maintain, in my tarball i include both, we do experiments in different directions and then combine best results. Also the intention was to try to include it in Tcl itself. Stephen Deasey wrote: On 1/1

Re: [naviserver-devel] Quest for malloc

2007-01-16 Thread Zoran Vasiljevic
Am 16.01.2007 um 15:52 schrieb Zoran Vasiljevic: You see, even we (i.e. Mike) noticed one glitch in the test program that make Zippy look ridiculous on the Mac, although it wasn't. Hmhmhmh... I must have done something very wrong :-( When I now repeat the tests on Mac/Zippy, even with the s

Re: [naviserver-devel] Quest for malloc

2007-01-16 Thread Jeff Rogers
Gustaf Neumann wrote: This is most probably the best variabt so far, and not complicated, such a optimizer can do "the right thing" easily. sorry for the many versions.. -gustaf { unsigned register int s = (size-1) >> 3; while (s>1) { s >>= 1; bucket++; } } if (bucket >

Re: [naviserver-devel] Quest for malloc

2007-01-16 Thread Gustaf Neumann
Hi Jeff, we are aware that the funciton is essentially an integer log2. The chosen C-based variant is acually faster and more general than what you have included (it needs only max 2 shift operations for the relevant range) but the assembler based variant is hard to beat and yields another 3% for