[Win32utils-devel] Speeding up win32-eventlog

Berger, Daniel Daniel.Berger at qwest.com
Mon Aug 27 10:21:29 EDT 2007

Excellent, thanks!
I did some experiments where i sent the event description of each version (split vs unpack) to a file and diff'ed the files. It seems that your version is also better at handling descriptions with leading whitespace/newlines/other stuff.
For example, with the old (split) version I see a description like this:
8ûšScan could not open file
With the unpack version that leading garbage is gone.
To anyone else reading: There is one other potential issue that requires deeper analysis where a few eventlog descriptions did not match what the event viewer showed (on my home laptop), using either split or unpack, possibly related to nested null's. This is being handled offline at the moment, but I'll update the list if necessary. 

	-----Original Message-----
	From: win32utils-devel-bounces at rubyforge.org [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of Heesob Park
	Sent: Saturday, August 25, 2007 8:58 PM
	To: Development and ideas for win32utils projects
	Subject: Re: [Win32utils-devel] Speeding up win32-eventlog
	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. :)

	How about this?
	va_list = str.unpack('Z*' * num)
	In my test, it is faster thousandfold than split.
	Park Heesob


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful.  If you have received this communication 
in error, please immediately notify the sender by reply e-mail and destroy 
all copies of the communication and any attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20070827/bbfc06c3/attachment.html 

More information about the win32utils-devel mailing list