Home > Archive > Tcl > August 2006 > How Fast is TCL?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| Dear Experts,
I am in the middle of writing a program which is suppose to decode
ASN.1 coded binary data. For this purpose , I am using Tree structure
as well as ASN.1 built in lib . So far, I am just in the process of
writing codes and all is going fine. However, the sole purpose of this
exercise is to gain speed as well as put the decoded data in sqlite3
db, both of which lags in existing tools.
So, my questions are:
1. Does usage of ASN.1 libs or anyother lib supplied with TCL has
impact ? Although I can imagine that this could be the best code?
2. What kind of commands should any programmer try to avoid which could
cause slow performace?
The existing tool takes 20 mins and to decode 40,000 RECORDs while each
record has approx 40 ASN.1 coded field.
Processor will be P-III and RAM is 512 .
Any idea or advice ?
Regards,
Wajih
| |
| Gerald W. Lester 2006-08-22, 7:02 pm |
| Wajih wrote:
> ...
> The existing tool takes 20 mins and to decode 40,000 RECORDs while each
> record has approx 40 ASN.1 coded field.
>
> Processor will be P-III and RAM is 512 .
>
> Any idea or advice ?
First, spend the $500-$1000 and get a 3GHz box with at least 2GB of memory
and one or more fast disk -- then if you still have a performance problem
start burning programming time.
--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
| |
| Michael Schlenker 2006-08-22, 7:02 pm |
| Wajih schrieb:
> Dear Experts,
>
> I am in the middle of writing a program which is suppose to decode
> ASN.1 coded binary data. For this purpose , I am using Tree structure
> as well as ASN.1 built in lib .
I assume your talking about the ASN.1 BER decoder/encoder lib in tcllib?
http://tcllib.sourceforge.net/doc/asn.html
> So far, I am just in the process of
> writing codes and all is going fine. However, the sole purpose of this
> exercise is to gain speed as well as put the decoded data in sqlite3
> db, both of which lags in existing tools.
If you really need speed, some C-code thrown in at the right place may
be the way to go.
> So, my questions are:
>
> 1. Does usage of ASN.1 libs or anyother lib supplied with TCL has
> impact ? Although I can imagine that this could be the best code?
The ASN.1 package in Tcllib is not optimized for speed and there
currently is no C-based accelerator available (like for example for the
md5 code in tcllib), but a C-coded accelerator would be possible in
principle, using critcl.
> 2. What kind of commands should any programmer try to avoid which could
> cause slow performace?
See the http://wiki.tcl.tk/performance category or start at:
http://wiki.tcl.tk/348
> The existing tool takes 20 mins and to decode 40,000 RECORDs while each
> record has approx 40 ASN.1 coded field.
Do you have some test data you could share? Contact me via email, then i
can give you an estimate. The 40 ASN.1 coded fields could be anything,
so an estimate is hard to give.
My advice:
1. Get some representative test data
2. Use the tcl [time] command to get a good estimate how slow or fast
things are
The tcllib CVS repository contains some currently trivial benchmark
scripts for the asn package. (see the asn.bench file), you could extend
those with your test data to get some better insight.
For a very simple record of a sequence consisting of 40 integer fields i
get around 800 microseconds per record for decoding on my Athlon64 X2
3800 machine using Tcl 8.4.12, which would be less than a minute for
40.000 of those simple records.
Michael
| |
|
| Thanks! It sounds very technical :o)
Gerald W. Lester wrote:
> Wajih wrote:
>
> First, spend the $500-$1000 and get a 3GHz box with at least 2GB of memory
> and one or more fast disk -- then if you still have a performance problem
> start burning programming time.
>
> --
> +--------------------------------+---------------------------------------+
> | Gerald W. Lester |
> |"The man who fights for his ideals is the man who is alive." - Cervantes|
> +------------------------------------------------------------------------+
| |
|
| Dear Michael,
Thank you very much. I can share some data with you. In fact, I am a
new to TCL and have not done much work .
Many thanks again for your help
Wajih
Michael Schlenker wrote:
> Wajih schrieb:
> I assume your talking about the ASN.1 BER decoder/encoder lib in tcllib?
> http://tcllib.sourceforge.net/doc/asn.html
>
>
> If you really need speed, some C-code thrown in at the right place may
> be the way to go.
>
>
> The ASN.1 package in Tcllib is not optimized for speed and there
> currently is no C-based accelerator available (like for example for the
> md5 code in tcllib), but a C-coded accelerator would be possible in
> principle, using critcl.
>
>
> See the http://wiki.tcl.tk/performance category or start at:
> http://wiki.tcl.tk/348
>
> Do you have some test data you could share? Contact me via email, then i
> can give you an estimate. The 40 ASN.1 coded fields could be anything,
> so an estimate is hard to give.
>
> My advice:
> 1. Get some representative test data
> 2. Use the tcl [time] command to get a good estimate how slow or fast
> things are
>
> The tcllib CVS repository contains some currently trivial benchmark
> scripts for the asn package. (see the asn.bench file), you could extend
> those with your test data to get some better insight.
>
> For a very simple record of a sequence consisting of 40 integer fields i
> get around 800 microseconds per record for decoding on my Athlon64 X2
> 3800 machine using Tcl 8.4.12, which would be less than a minute for
> 40.000 of those simple records.
>
> Michael
| |
| Gerald W. Lester 2006-08-23, 8:02 am |
| Wajih wrote:
> Thanks! It sounds very technical :o)
Not technical, but managerial -- programmer time is expensive, hardware is
cheap. Try the cheap solution before implementing the hard solution.
>
> Gerald W. Lester wrote:
>
--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
| |
| Michael Schlenker 2006-08-23, 7:03 pm |
| Wajih schrieb:
> Dear Michael,
>
> Thank you very much. I can share some data with you. In fact, I am a
> new to TCL and have not done much work .
>
Ok, if you have some reasonable test data you can share, please contact
me via email.
Michael
|
|
|
|
|