Channels ▼

Cameron and Tracey Hughes

Dr. Dobb's Bloggers

19 E-mails, How Many Lines of Javascript Per Instruction Does it Take?

October 16, 2009

On one hand it's funny. On the other hand, well ... it's funny. It's probably a matter of poetic justice being served up. Something I did or something Tracey did in a past life. But recently we seem unable to escape conversations that end up in questions (which we normally evade) about what we do.

Maybe it's just Karma, but somehow we end up in conversations with some happy lad that has just developed some nifty little IPhone app or some web-based, google-earth-enabled-recommender page and he's absolutely excited about it, and we're excited for him.

We think these conversations might be prompted by the fact that when they happen we tend to be sitting somewhere with our notebook computers open and puzzled looks on our faces. The person will unabashedly look at one or both of our screens and then say "I develop software too. That looks like some kind of Javascript you're working on there" and then they proceed to share their enthusiasm about their newly finished app. This has been a recurring theme for the past year or so. Well it happened again yesterday while we were sitting in the cafe of one of our local booksellers and this time I decided to really share what we were working on. After listening to an almost salesman quality presentation on how this guy's app is Windows 7 ready and it will provide seamless access to the power of cloud computing and all the cores in a computer, he asked what were we working on. He said , "That looks a little like Javascript. Is it server side or client side?"

I said actually its C++. It's part of some code that implements a rational agent. We're trying to get this agent to help us solve a problem. I then proceeded to explain the problem (well a version of the problem that wouldn't violate any agreements we had signed). I said we have these 19 emails. The problem is we have no header information for them and no time date stamp information at all for any of them. These e-mails were originally sent between multiple individuals over a 3 or 4 year period. The order that they were sent in has been lost. The emails contain very sensitive information and that sensitive information is only completely visible if we look at the e-mails in the original order they were sent. I then let him know that we measure our agent's work in how many logical inferences some task takes. In this case our agent does 1 Logical Inference per second (LIPS) and it takes approx 3000 LIPS to put the e-mails into one potential order. He asked well how does LIPS compare to the speed on his 3G IPhone? Not knowing exactly how to respond, I said well 1 LIP is approximately equal to 100 machine instructions. He then said you mean to tell me you need 100 lines of Javascript just to do one LIP. Again, I wasn't quite sure how to respond. So I just stated what the real problem was. I said pal, we have 19 emails. We don't know what the original order was. We have to find out what the original order was without the benefits of date or time stamp information of any kind. Presently we are using the computer to arrange the e-mails in some arrangement of 19. Then we ask the computer to read the e-mails from start to finish to see whether our sensitive information becomes visible. If its not visible then the computer comes up with another sequence. It takes the computer about 3000 seconds to do one group of 19. So the lad asked how many groups of 19 does the computer have to look through before finding the information. I said don't know maybe all of them. He said how many is that? So I opened up MuPad typed in fact(19) and back came the number 121,645,100,408,832,000 (without the commas of course). He said naw. I said yeah. He said naw ... I said trust me. One agent can process 1 arrangement every 3000 seconds. I asked him if I could dedicate one agent per every core in my notebook, how many cores would I need in my notebook to guarantee the return of the sensitive information in under 30 seconds. At that point I was about to make some snappy remark about checking the answer on his 3G IPhone but I didn't. He looked at me and said "I see you have your work cut out for you", and I said, 'Yep and I have no idea how many lines of Javascript per instruction I'm gonna need.'

Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 


Video