[Win32utils-devel] Speeding up win32-eventlog

Heesob Park phasis at gmail.com
Sat Aug 25 22:58:14 EDT 2007


Hi,

2007/8/26, Daniel Berger <djberg96 at gmail.com>:
>
> Hi all,
>
> I released win32-eventlog 0.4.5 today. It's still a bit on the slow
> side. The profiler (and general testing) indicates that it's line 696
> that's the major culprit:
>
> va_list = str.split(0.chr)[0...num]
>
> Other than changing 0.chr to a literal "\0", does anyone have a way to
> speed this up?
>
> It's not crucial, but I thought it might make a nice benchmarking
> challenge for folks on the list. :)
>
> Regards,
>
> Dan


How about this?

va_list = str.unpack('Z*' * num)

In my test, it is faster thousandfold than split.

Regards,

Park Heesob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20070826/53f587e0/attachment.html 


More information about the win32utils-devel mailing list