git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/3] add basic lua infrastructure

From
Jeff King <peff@peff.net>
Date
Sep 25, 2012, 04:53 UTC
Message-ID
<20120925045345.GA5708@sigill.intra.peff.net>
In-Reply-To
<CACsJy8ArwPq=YRAddVtC+m8X0+=tndb2-=tmiMS=m2VX3TWGYg@mail.gmail.com>
On Tue, Sep 25, 2012 at 08:55:23AM +0700, Nguyen Thai Ngoc Duy wrote:
Show 10 quoted lines
> On Tue, Sep 25, 2012 at 7:25 AM, Jeff King <peff@peff.net> wrote:
> > +ifdef USE_LUA
> > +       BASIC_CFLAGS += -DUSE_LUA `pkg-config --cflags lua5.2`
> > +       EXTLIBS += `pkg-config --libs lua5.2`
> > +endif
> > +
> 
> I remember we paid noticeable penalty when linking with libcurl to
> main git binary and Linus removed libcurl from main git, moving it to
> git-http-*. Do we pay similar penalty linking to liblua?

I don't think so. The real problem with libcurl is that it brings in a ton of other libraries:

  $ ldd /usr/lib/x86_64-linux-gnu/libcurl.so | awk '{print $1}'
  linux-vdso.so.1
  libidn.so.11
  libssh2.so.1
  liblber-2.4.so.2
  libldap_r-2.4.so.2
  librt.so.1
  libgssapi_krb5.so.2
  libssl.so.1.0.0
  libcrypto.so.1.0.0
  librtmp.so.0
  libz.so.1
  libc.so.6
  libgcrypt.so.11
  libresolv.so.2
  libsasl2.so.2
  libgnutls.so.26
  libpthread.so.0
  /lib64/ld-linux-x86-64.so.2
  libkrb5.so.3
  libk5crypto.so.3
  libcom_err.so.2
  libkrb5support.so.0
  libdl.so.2
  libkeyutils.so.1
  libgpg-error.so.0
  libtasn1.so.3
  libp11-kit.so.0
Compare with lua:
  $ ldd /usr/lib/x86_64-linux-gnu/liblua5.2.so | awk '{print $1}'
  linux-vdso.so.1
  libm.so.6
  libdl.so.2
  libc.so.6
  /lib64/ld-linux-x86-64.so.2
The original timings from Linus are here:
  http://article.gmane.org/gmane.comp.version-control.git/123946

The main issue is really hitting all those libraries on a cold cache. Here are before-and-after timings of:

  echo 3 >/proc/sys/vm/drop_caches && git

which should basically just measure startup time. All times are best-of-five.

  [before]
  real    0m0.065s
  user    0m0.000s
  sys     0m0.004s
  [after]
  real    0m0.063s
  user    0m0.000s
  sys     0m0.004s

So we actually did better, though the difference is well within the run-to-run noise. I don't think it's a big deal.

-Peff
Previous: Nguyen Thai Ngoc DuyNext: Robin H. Johnson
Message 5 of 15 in “git log --pretty=lua”
  1. 0/3 git log --pretty=luaJeff King, Sep 25, 2012
  2. 1/3 pretty: make some commit-parsing helpers more publicJeff King, Sep 25, 2012
  3. 2/3 add basic lua infrastructureJeff King, Sep 25, 2012
  4. Nguyen Thai Ngoc DuySep 25, 2012
  5. Jeff KingSep 25, 2012
  6. Robin H. JohnsonSep 25, 2012
  7. Jeff KingSep 25, 2012
  8. Junio C HamanoSep 25, 2012
  9. 3/3 add a "lua" pretty formatJeff King, Sep 25, 2012
  10. Jeff KingOct 6, 2012
  11. Nguyen Thai Ngoc DuySep 25, 2012
  12. Stephen BashSep 25, 2012
  13. Matthieu MoySep 25, 2012
  14. Junio C HamanoSep 25, 2012
  15. Nguyen Thai Ngoc DuySep 30, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.