Skip to content

Introduction of a ce_namelen field

Thomas Gummerer git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest3 patches 3 repliesIn review

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3read-cache.c: Handle long filenames correctlyread-cache.c t/t0007-long-filenames.sh+69 -22 replies
2/3Strip namelen out of ce_flags into a ce_namelen fieldbuiltin/apply.c builtin/blame.c builtin/checkout.c +5 more+63 -510 replies
3/3Replace strlen() with ce_namelen()read-cache.c unpack-trees.c+3 -31 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/3] Introduction of a ce_namelen field

Thanks to Junio for reviewing v2 of this patch series.

The speedup coming from introducing the field exists, but is minimal, here are the times for 1000 runs of git ls-files on the Webkit index, first without the ce_namelen field, and then with the ce_namelen field.

$ time ./test.sh

real 4m40.895s
user 3m39.642s
sys 0m40.159s

$ time ./test.sh

real 4m34.872s
user 3m37.176s
sys 0m40.401s

1/3 is a bugfix for very long files which share at least 4096 characters in their filename. It also includes a test, tough I'm not sure I have put it in the right place.

The other two patches are rerolls from v2 of this series.

[PATCH v3 1/3] read-cache.c: Handle long filenames correctly [PATCH v3 2/3] Strip namelen out of ce_flags into a ce_namelen field [PATCH v3 3/3] Replace strlen() with ce_namelen()

builtin/apply.c           |    3 ++-
builtin/blame.c           |    3 ++-
builtin/checkout.c        |    3 ++-
builtin/update-index.c    |    9 ++++++---
cache.h                   |   19 ++++++-------------
read-cache.c              |   62 +++++++++++++++++++++++++++++++++++++++-----------------------
t/t0007-long-filenames.sh |   62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
tree.c                    |    7 ++++---
unpack-trees.c            |    5 +++--
9 files changed, 126 insertions(+), 47 deletions(-)