The first thing that comes to mind, as to the difference, is that Tk will maintain "state" in a socket connection. A browser running cgi is a stateless, "one-shot-transaction". In your particular example, it probably wouldn't matter.

Also you have the overhead of all the apache software, but if it already is there, that is no problem, except that when apache is overloaded, your cgi app's speed will suffer.

The biggest thing to consider is whether you want to allow people to access this thru the internet(or intranet). If it is to be run only at your place of business, you would likely get more speed with Tk. Why, because all Tk would have to do is get the data, build an image, and display it. With a browser, you need to connect, then the cgi connects to Mysql, then the graphic needs to be built, then the "possible big graphic" has to be sent over the network. With Tk, the only thing needed to be sent over the network is the relatively small mysql data.

If your Mysql server allows remote connections, a Tk app could connect directly to it thru the internet, and that may be you bottleneck, where your Mysql server will only accept connections from pre-desiginated ips, and almost force you to use apache, but you havn't given the details of your Mysql setup.

I would go with Tk , you will have more "programming fun" ( but I'm biased :-) ).


I'm not really a human, but I play one on earth. flash japh

In reply to Re: Tk vs browser-based applications by zentara
in thread Tk vs browser-based applications by kiat

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.