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

Re: [RFC] Convert builin-mailinfo.c to use The Better String Library.

From
WBWalter Bright <boost@digitalmars.com>
Date
Sep 7, 2007, 19:23 UTC
Message-ID
<fbs8es$1cd$1@sea.gmane.org>
In-Reply-To
<46E11CE1.4030209@op5.se>
Andreas Ericsson wrote:
Show 19 quoted lines
> Walter Bright wrote:
>> 1) You wind up having to implement the complex, dirty details of 
>> things yourself. The consequences of this are:
>>
>>    a) you pick a simpler algorithm (which is likely less efficient - I 
>> run across bubble sorts all the time in code)
>>
>>    b) once you implement, tune, and squeeze all the bugs out of those 
>> complex, dirty details, you're reluctant to change it. You're 
>> reluctant to try a different algorithm to see if it's faster. I've 
>> seen this effect a lot in my own code. (I translated a large body of 
>> my own C++ code that I'd spent months tuning to D, and quickly managed 
>> to get significantly more speed out of it, because it was much simpler 
>> to try out different algorithms/data structures.)
>>
> 
> I haven't seen this in the development of git, although to be fair, you
> didn't mention the number of developers that were simultaneously working
> on your project.

On my project, one. But I've seen this problem repeatedly in other projects that had multiple developers. For example, I used to use version 1 of an assembler. It was itself written entirely in assembler. It ran *incredibly* slowly on large asm files. But it was written in assembler, which is very fast, so how could that be?

Turns out, the symbol table used internally was a linear one. A linear symbol table is easy to implement, but doesn't scale well at all. A linear symbol table was implemented because it was just harder to do more advanced symbol table algorithms in assembler. In this case, a higher level language re-implementation made the assembler much faster, even though that implementation was SLOWER in every detail. It was faster overall, because it was easier to develop faster algorithms.

> If it was you alone, I can imagine you were reluctant to
> change it just to see if something is faster.

My point was that when I reimplemented it in D, the cost of changing the algorithms got much lower, so I was much more tempted to muck around trying out different ones. The result was I found faster ones.

> Opensource projects with many contributors (git, linux) work differently,
> since one or a few among the plethora of authors will almost always be
> a true expert at the problem being solved.

That is a nice advantage. I don't think many projects can rely on having the best in the business working on them, though <g>.

Show 8 quoted lines
> The point is that, given enough developers, *someone* is bound to
> find an algorithm that works so well that it's no longer worth
> investing time to even discuss if anything else would work better,
> either because it moves the performance bottleneck to somewhere else
> (where further speedups would no longer produce humanly measurable
> improvements), or because the action seems instantanous to the user
> (further improvements simply aren't worth it, because no valuable
> resource will be saved from it).

Sure, but I suggest that few projects reach this maxima. Case in point: ld, the gnu linker. It's terribly slow. To see how slow it is, compare it to optlink (the 15 years old one that comes with D for Windows). So I don't believe there is anything inherent about linking that should make ld so slow. There's some huge leverage possible in speeding up ld (spreading out that saved time among all the gnu developers).

So while git may have reached a maxima in performance, I don't think this principle is applicable in general, even for very widely used open source projects that would profit greatly from improved performance.

------ Walter Bright http://www.digitalmars.com C, C++, D programming language compilers http://www.astoriaseminar.com Extraordinary C++

Previous: Andreas EricssonNext: David Kastrup
Message 79 of 102 in “[RFC] Convert builin-mailinfo.c to use The Better String Library.”
  1. Lukas SandströmSep 4, 2007
  2. Alex RiesenSep 4, 2007
  3. Pierre HabouzitSep 4, 2007
  4. Kristian HøgsbergSep 5, 2007
  5. Matthieu MoySep 5, 2007
  6. Miles BaderSep 6, 2007
  7. Dmitry KakurinSep 6, 2007
  8. Shawn O. PearceSep 6, 2007
  9. Andreas EricssonSep 6, 2007
  10. Junio C HamanoSep 6, 2007
  11. Andreas EricssonSep 6, 2007
  12. David KastrupSep 6, 2007
  13. Miles BaderSep 6, 2007
  14. Johannes SchindelinSep 6, 2007
  15. Linus TorvaldsSep 6, 2007
  16. Dmitry KakurinSep 7, 2007
  17. Linus TorvaldsSep 7, 2007
  18. Dmitry KakurinSep 7, 2007
  19. Linus TorvaldsSep 7, 2007
  20. Dmitry KakurinSep 7, 2007
  21. David SymondsSep 7, 2007
  22. Theodore TsoSep 7, 2007
  23. Steven BurnsSep 20, 2007
  24. Andreas EricssonSep 20, 2007
  25. Andreas EricssonSep 7, 2007
  26. Dmitry KakurinSep 7, 2007
  27. David KastrupSep 7, 2007
  28. Dmitry KakurinSep 8, 2007
  29. David KastrupSep 8, 2007
  30. Andreas EricssonSep 9, 2007
  31. David KastrupSep 7, 2007
  32. Johannes SchindelinSep 7, 2007
  33. Johannes SchindelinSep 7, 2007
  34. David KastrupSep 7, 2007
  35. Linus TorvaldsSep 7, 2007
  36. alanSep 7, 2007
  37. Walter BrightSep 7, 2007
  38. David KastrupSep 7, 2007
  39. Walter BrightSep 7, 2007
  40. David KastrupSep 7, 2007
  41. Walter BrightSep 7, 2007
  42. David KastrupSep 7, 2007
  43. Walter BrightSep 7, 2007
  44. David KastrupSep 7, 2007
  45. Walter BrightSep 7, 2007
  46. Andreas EricssonSep 8, 2007
  47. Pierre HabouzitSep 9, 2007
  48. Andreas EricssonSep 9, 2007
  49. Wincent ColaiutaSep 7, 2007
  50. Pierre HabouzitSep 7, 2007
  51. Walter BrightSep 7, 2007
  52. David KastrupSep 7, 2007
  53. Walter BrightSep 7, 2007
  54. Pierre HabouzitSep 7, 2007
  55. David KastrupSep 7, 2007
  56. Pierre HabouzitSep 7, 2007
  57. Walter BrightSep 7, 2007
  58. Pierre HabouzitSep 7, 2007
  59. Walter BrightSep 7, 2007
  60. John 'Z-Bo' ZabroskiSep 8, 2007
  61. David KastrupSep 8, 2007
  62. Steven BurnsSep 19, 2007
  63. Wincent ColaiutaSep 7, 2007
  64. Paul WankadiaSep 7, 2007
  65. Nicolas PitreSep 7, 2007
  66. Wincent ColaiutaSep 7, 2007
  67. Andreas EricssonSep 7, 2007
  68. Johannes SchindelinSep 7, 2007
  69. Andreas EricssonSep 7, 2007
  70. Wincent ColaiutaSep 7, 2007
  71. Karl HasselströmSep 7, 2007
  72. Andreas EricssonSep 7, 2007
  73. Wincent ColaiutaSep 7, 2007
  74. Andreas EricssonSep 9, 2007
  75. David KastrupSep 7, 2007
  76. Wincent ColaiutaSep 7, 2007
  77. Walter BrightSep 7, 2007
  78. Andreas EricssonSep 7, 2007
  79. Walter BrightSep 7, 2007
  80. David KastrupSep 7, 2007
  81. Andreas EricssonSep 9, 2007
  82. Bernd JendrissekSep 17, 2009
  83. Wincent ColaiutaSep 7, 2007
  84. Walter BrightSep 7, 2007
  85. Steven BurnsSep 22, 2007
  86. David KastrupSep 7, 2007
  87. Andy ParkinsSep 7, 2007
  88. David KastrupSep 7, 2007
  89. Johannes SchindelinSep 7, 2007
  90. Dmitry KakurinSep 8, 2007
  91. David KastrupSep 8, 2007
  92. Alex RiesenSep 8, 2007
  93. figoSep 24, 2007
  94. David KastrupSep 24, 2007
  95. Steven BurnsSep 25, 2007
  96. David KastrupSep 25, 2007
  97. Syed M RaihanMay 22, 2012
  98. Ian MoltonJun 10, 2010
  99. Jakub NarebskiJun 11, 2010
  100. Dario RodriguezJun 11, 2010
  101. Kristian HøgsbergSep 5, 2007
  102. Lukas SandströmSep 7, 2007

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.