COMPANY

BLOGS

  • user warning: Unknown column 'u.signature_format' in 'field list' query: SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.signature_format, u.picture, u.data, c.thread, c.status FROM comments c INNER JOIN users u ON c.uid = u.uid WHERE c.nid = 23462 AND c.status = 0 ORDER BY c.cid LIMIT 0, 50 in /var/www/www.4d.com/docs/modules/comment/comment.module on line 991.
  • warning: file_get_contents(http://www.telize.com/geoip/54.81.178.153) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/www.4d.com/docs/includes/common.inc(1762) : eval()'d code on line 4.

Yee-Ha!

09.30.2011
by Thibaud Arguillère

 

New transatlantic travel: I’m flying to the US. San Jose, California, to be exact. I will work with the US team to prepare the 4D Summit and Wakanday! This happens from October 12 to 15 in Boston, and we are going to finish what needs to be done: Tune the keynote demos, the keynote slides, the keynote announcements. In short, we’ll be working on the keynotes.

 

 

This year, I’m not traveling alone, Jérôme is with me. Jérôme is a colleague of mine, the 4D v13 project manager. Suffice to say that guy is important. A 4D developer from the start. He joined the company years ago.

 


Thibaud & Jérôme

With Jérôme, happy to go to work on a plane


Right now, as I write this, I’m on the plane. We’ll be in San Francisco in about 40 minutes. Or in Tonopath in one minute if the plane crashes.

 

San Francisco or Tonopath?
San Francisco or Tonopath?

 

...


Ok. It looks like the plane didn’t crash. I can go ahead.

 

Our trip is going well. As always, I was at the airport three hours in advance. Once the border control stuff was completed, I found myself totally alone at boarding gate 73. Really alone. For a minute, I thought it was the wrong day.

 

But it was not: Here I am, seated and writing this paper.

 

Not really properly seated however. You may know about economy class. Practically speaking, it is the class where once seated, you must be Houdini to get out. And I was very disappointed about this. Once all passengers had boarded, the seat near me was empty. So I was less disapopinted!

All alone

Alone

 

But in fact, not all passengers had boarded. A lady walked from the front of the plane. I still can see her, like in a movie. Slow motion. She walks down the corridor, then stops near me, checks the seat number, smiles, and sits in this no-longer-empty seat.


Not alone.

Not alone

 

During the trip, I mainly worked on my “Optimization” session. And here is a part of it.

 

As a question.

 

Following is some classical code, that strict-compares two strings. “Strict-compare” means that the comparison is diacritical and case sensitive.

 

C_TEXT($1;$2)
C_BOOLEAN($0)

C_LONGINT($i;$L_max)

$L_max:=Length($1)
If ($L_max=Length($2))
   $0:=True
   For ($i;1;$L_max)
       If (Character code($1[[$i]])#Character code($2[[$i]]))
         $0:=False
         $i:=$L_max
      End if
   End for
End if

 

Once this code is optimized, here are the results of benchmarks. They are performed on a string whose length is from 0 to 5,000, by 100:

 

Benchmark, interpreted

Awesome optimization in interpreted mode

 

Benchmark. Compiled.

Still awesome optimization in compiled mode


The question is: How did I get this result? Without using a plug-in.

 

Here are two clues: This optimization is only possible since v11, and it significantly reduces the number of lines of code.

 

You’ll get the response after the Summit, after my session.

 

OK. We’re ready to land. I’ve put my seat in the upright position, stored my tray table away and fastened my belt. (I know it’s fastened or I would have lost my pants while walking).

 

The captain says he is speaking.

 

Which is good news. If the voiced started with “Here is the recorded voice of your captain,” we may have worried a bit.

 

See you soon!

 

RSS 0 comment(s) to this post