performance discrepency in binary scan
From: Aamer Akhter (aakhter_at_gmail.com)
Date: 02/23/05
- Next message: Andreas Leitgeb: "Re: line buffering while reading from command pipe"
- Previous message: Darren New: "Re: What does Tcl lack?"
- Next in thread: Don Porter: "Re: performance discrepency in binary scan"
- Reply: Don Porter: "Re: performance discrepency in binary scan"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 23 Feb 2005 09:06:43 -0800
Folks,
I'm using the tcllib ip package, and added these to procs:
proc ::ip::ToInteger {ip} {
binary scan [ip::Normalize4 $ip] I out
return $out
}
proc ::ip::ToHex {ip} {
binary scan [ip::Normalize4 $ip] H8 out
return "0x$out"
}
I then timed the difference:
% time {ip::ToInt 0.0.0.1} 100000
97 microseconds per iteration
% time {ip::ToHex 0.0.0.1} 100000
12 microseconds per iteration
% info patchlevel
8.4.6
Thoughts?
- Next message: Andreas Leitgeb: "Re: line buffering while reading from command pipe"
- Previous message: Darren New: "Re: What does Tcl lack?"
- Next in thread: Don Porter: "Re: performance discrepency in binary scan"
- Reply: Don Porter: "Re: performance discrepency in binary scan"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|