<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git, branch pks-config-map-optimization</title>
<subtitle>github.com: libgit2/libgit2.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/'/>
<entry>
<title>config_entries: Avoid excessive map operations</title>
<updated>2020-07-13T19:03:20+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2020-07-13T18:56:08+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=f2400a9c81c1574f7b917bcef90dde7b222fb9a0'/>
<id>f2400a9c81c1574f7b917bcef90dde7b222fb9a0</id>
<content type='text'>
When appending config entries, we currently always first get the
currently existing map entry and then afterwards update the map to
contain the current config value. In the common scenario where keys
aren't being overridden, this is the best we can do. But in case a key
gets set multiple times, then we'll also perform these two map
operations. In extreme cases, hashing the map keys will thus start to
dominate performance.

Let's optimize the pattern by using a separately allocated map entry.
Currently, we always put the current list entry into the map and update
it to get any overridden multivar. As these list entries are also used
to iterate config entries, we cannot update them in-place in the map and
are thus forced to always set the map to contain the new entry. But with
a separately allocated map entry, we can now create one once per config
key and insert it into the map. Whenever appending a new config value
with the same key, we can now just update the map entry in-place instead
of having to replace the map entry completely.

This reduces calls to the hashing function by half and trades the
improved runtime for one more allocation per unique config key. Given
that the refactoring arguably improves code readability by splitting
concerns of the `config_entry_list` type and not having to track it in
two different structures, this alone would already be reason enough to
take the trade.

Given a pathological case of a gitconfig with 100.000 repeated keys and
a section of length 10.000 characters, this reduces runtime by half from
approximately 14 seconds to 7 seconds as expected.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When appending config entries, we currently always first get the
currently existing map entry and then afterwards update the map to
contain the current config value. In the common scenario where keys
aren't being overridden, this is the best we can do. But in case a key
gets set multiple times, then we'll also perform these two map
operations. In extreme cases, hashing the map keys will thus start to
dominate performance.

Let's optimize the pattern by using a separately allocated map entry.
Currently, we always put the current list entry into the map and update
it to get any overridden multivar. As these list entries are also used
to iterate config entries, we cannot update them in-place in the map and
are thus forced to always set the map to contain the new entry. But with
a separately allocated map entry, we can now create one once per config
key and insert it into the map. Whenever appending a new config value
with the same key, we can now just update the map entry in-place instead
of having to replace the map entry completely.

This reduces calls to the hashing function by half and trades the
improved runtime for one more allocation per unique config key. Given
that the refactoring arguably improves code readability by splitting
concerns of the `config_entry_list` type and not having to track it in
two different structures, this alone would already be reason enough to
take the trade.

Given a pathological case of a gitconfig with 100.000 repeated keys and
a section of length 10.000 characters, this reduces runtime by half from
approximately 14 seconds to 7 seconds as expected.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #5547 from pks-t/pks/cmake-modernization-pt2</title>
<updated>2020-07-12T14:01:15+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2020-07-12T14:01:15+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=ae30009e3d1312bf2a3816d40ba3c73587304068'/>
<id>ae30009e3d1312bf2a3816d40ba3c73587304068</id>
<content type='text'>
CMake modernization pt2</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
CMake modernization pt2</pre>
</div>
</content>
</entry>
<entry>
<title>cmake: remove CheckPrototypeDefinition module</title>
<updated>2020-07-12T12:45:47+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2020-06-05T09:37:30+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=9bc6e655e1d10a0fa388e19fe72ee588cd4e2f96'/>
<id>9bc6e655e1d10a0fa388e19fe72ee588cd4e2f96</id>
<content type='text'>
In the past, we've imported the CheckPrototypeDefinition into our own
module directory as it wasn't yet available in all supported CMake
versions. Now that we require at least CMake v3.5, we don't need to
bundle it anymore as it's included with the distribution already.

Let's drop the included modules and always use upstream's version.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the past, we've imported the CheckPrototypeDefinition into our own
module directory as it wasn't yet available in all supported CMake
versions. Now that we require at least CMake v3.5, we don't need to
bundle it anymore as it's included with the distribution already.

Let's drop the included modules and always use upstream's version.
</pre>
</div>
</content>
</entry>
<entry>
<title>cmake: use target-specific compile definitions</title>
<updated>2020-07-12T12:45:47+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2020-06-05T08:49:09+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=4218403e99fd2407dfc7a6f36b3b02bc7073c709'/>
<id>4218403e99fd2407dfc7a6f36b3b02bc7073c709</id>
<content type='text'>
We set up some compile definitions as part of our src/CMakeLists.txt.
While the definitions are global, we really only need them as part of
the git2internal target which compiles all the objects. Let's thus use
`target_compile_definitions` instead of `add_definitions`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We set up some compile definitions as part of our src/CMakeLists.txt.
While the definitions are global, we really only need them as part of
the git2internal target which compiles all the objects. Let's thus use
`target_compile_definitions` instead of `add_definitions`.
</pre>
</div>
</content>
</entry>
<entry>
<title>cmake: use git2internal target to populate sources</title>
<updated>2020-07-12T12:45:47+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2020-06-05T08:24:30+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=53911edd46ea0946c4d6a53f9fd8c8d36a2b5104'/>
<id>53911edd46ea0946c4d6a53f9fd8c8d36a2b5104</id>
<content type='text'>
Modern CMake is usually target-driven in that a target is first defined
and then the likes of `target_sources`, `target_include_directories`
etc. are used to further populate the target. We still use old-style
CMake, where we first set up a set of variables and then populate the
target in a single call.

Let's migrate to modern CMake usage by starting to populate the sources
of our git2internal target piece-by-piece. While this is a small step,
it allows us to convert to target-based build instructions
piece-by-piece.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Modern CMake is usually target-driven in that a target is first defined
and then the likes of `target_sources`, `target_include_directories`
etc. are used to further populate the target. We still use old-style
CMake, where we first set up a set of variables and then populate the
target in a single call.

Let's migrate to modern CMake usage by starting to populate the sources
of our git2internal target piece-by-piece. While this is a small step,
it allows us to convert to target-based build instructions
piece-by-piece.
</pre>
</div>
</content>
</entry>
<entry>
<title>cmake: specify project version</title>
<updated>2020-07-12T12:45:47+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2020-06-05T08:07:33+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=19eb1e4bb740d72ebaddc9eb5084d8e013c68ddc'/>
<id>19eb1e4bb740d72ebaddc9eb5084d8e013c68ddc</id>
<content type='text'>
We currently do not set up a project version within CMake, meaning that
it can't be use by other projects including libgit2 as a sub-project and
also not by other tools like IDEs.

This commit changes this to always set up a project version, but instead
of extracting it from the "version.h" header we now set it up directly.
This is mostly to avoid mis-use of the previous `LIBGIT2_VERSION`
variables, as we should now always use the `libgit2_VERSION` ones that
are set up by CMake if one provides the "VERSION" keyword to the
`project()` call. While this is one more moving target we need to adjust
on releases, this commit also adjusts our release script to verify that
the project version was incremented as expected.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We currently do not set up a project version within CMake, meaning that
it can't be use by other projects including libgit2 as a sub-project and
also not by other tools like IDEs.

This commit changes this to always set up a project version, but instead
of extracting it from the "version.h" header we now set it up directly.
This is mostly to avoid mis-use of the previous `LIBGIT2_VERSION`
variables, as we should now always use the `libgit2_VERSION` ones that
are set up by CMake if one provides the "VERSION" keyword to the
`project()` call. While this is one more moving target we need to adjust
on releases, this commit also adjusts our release script to verify that
the project version was incremented as expected.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #5568 from lhchavez/ubsan</title>
<updated>2020-07-09T22:12:58+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2020-07-09T22:12:58+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=325375e3b6c2c31152b7ee48794aa6a1f73709d5'/>
<id>325375e3b6c2c31152b7ee48794aa6a1f73709d5</id>
<content type='text'>
Make the tests run cleanly under UndefinedBehaviorSanitizer</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make the tests run cleanly under UndefinedBehaviorSanitizer</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #5567 from lhchavez/msan</title>
<updated>2020-07-09T22:02:05+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2020-07-09T22:02:05+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=2ffa426e1dffc78c64112ea8a4a9796be66462a9'/>
<id>2ffa426e1dffc78c64112ea8a4a9796be66462a9</id>
<content type='text'>
Make the tests pass cleanly with MemorySanitizer</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make the tests pass cleanly with MemorySanitizer</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #5561 from A-Ovchinnikov-mx/a-ovchin/windres-rc</title>
<updated>2020-07-09T21:56:44+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2020-07-09T21:56:44+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=6053616393c7a522b94fac573a2ae1fe4ad86cc5'/>
<id>6053616393c7a522b94fac573a2ae1fe4ad86cc5</id>
<content type='text'>
Enable building git2.rc resource script with GCC</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Enable building git2.rc resource script with GCC</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #5571 from lhchavez/ntlmclient-sanitizers</title>
<updated>2020-07-02T10:45:16+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2020-07-02T10:45:16+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=8720ae8a2c9045cb9494d328e3fc6370decbb774'/>
<id>8720ae8a2c9045cb9494d328e3fc6370decbb774</id>
<content type='text'>
Make NTLMClient Memory and UndefinedBehavior Sanitizer-clean</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make NTLMClient Memory and UndefinedBehavior Sanitizer-clean</pre>
</div>
</content>
</entry>
</feed>
