[poppler] Why does Gfx::opTab need to be built at runtime?

Krzysztof Kowalczyk kkowalczyk at gmail.com
Mon Sep 24 20:14:44 PDT 2007


I'm looking at optimizing poppler in  various ways and just noticed
something I don't understand. I hope someone will be able to enlighten
me.

In Gfx.h there is:

struct Operator {
  char name[4];
  int numArgs;
  TchkType tchk[maxArgs];
  void (Gfx::*func)(Object args[], int numArgs);
};

and in Gfx.cc a table is filled out like this:

Operator Gfx::opTab[] = {
  {"\"",  3, {tchkNum,    tchkNum,    tchkString},
          &Gfx::opMoveSetShowText},

According to a profiler, at least on Windows, the single biggest
function in poppler (~9k) is anonymous function constructed by the
compiler to fill out Gfx::opTab.

What I don't understand is why it cannot be constructed at compile time?

Can it be that filling out char name[4] with a string is the cause of that?

-- kjk


More information about the poppler mailing list