<feed xmlns='http://www.w3.org/2005/Atom'>
<title>evtclib, branch v0.6.0</title>
<subtitle>arcdps EVTC reading/parsing library for Rust</subtitle>
<link rel='alternate' type='text/html' href='https://git.kingdread.de/cgit.cgi/evtclib/'/>
<entry>
<title>add benchmarks to the package</title>
<updated>2021-11-19T19:50:55+00:00</updated>
<author>
<name>Daniel Schadt</name>
<email>kingdread@gmx.de</email>
</author>
<published>2021-11-19T19:50:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kingdread.de/cgit.cgi/evtclib/commit/?id=42068e86611240523ec1d03dd58c8ebcf3b9a385'/>
<id>42068e86611240523ec1d03dd58c8ebcf3b9a385</id>
<content type='text'>
Cargo will complain if the benchmarks that are defined in Cargo.toml are
not found, so we need to include the sources - even if the benchmark
itself cannot be run from the cargo package (due to the missing test
logs).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Cargo will complain if the benchmarks that are defined in Cargo.toml are
not found, so we need to include the sources - even if the benchmark
itself cannot be run from the cargo package (due to the missing test
logs).
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'more-benches'</title>
<updated>2021-11-19T19:49:47+00:00</updated>
<author>
<name>Daniel Schadt</name>
<email>kingdread@gmx.de</email>
</author>
<published>2021-11-19T19:49:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kingdread.de/cgit.cgi/evtclib/commit/?id=b614f8e4798b2c6bbdbdd86e8ec27d5352df8c44'/>
<id>b614f8e4798b2c6bbdbdd86e8ec27d5352df8c44</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bump version to 0.6.0</title>
<updated>2021-11-19T19:32:46+00:00</updated>
<author>
<name>Daniel Schadt</name>
<email>kingdread@gmx.de</email>
</author>
<published>2021-11-19T19:32:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kingdread.de/cgit.cgi/evtclib/commit/?id=287c21cea382b6dfcce6d76a677ce3c8434e50b4'/>
<id>287c21cea382b6dfcce6d76a677ce3c8434e50b4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>small doc typo fixes</title>
<updated>2021-11-19T19:27:16+00:00</updated>
<author>
<name>Daniel Schadt</name>
<email>kingdread@gmx.de</email>
</author>
<published>2021-11-19T19:27:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kingdread.de/cgit.cgi/evtclib/commit/?id=1b88a4c2f738d6c236df42c1b9fa4478e302abc5'/>
<id>1b88a4c2f738d6c236df42c1b9fa4478e302abc5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>update the changelog more</title>
<updated>2021-11-18T19:28:43+00:00</updated>
<author>
<name>Daniel Schadt</name>
<email>kingdread@gmx.de</email>
</author>
<published>2021-11-18T19:28:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kingdread.de/cgit.cgi/evtclib/commit/?id=2ae32528d9f6ffde5c27d923cf51e59ed6cef936'/>
<id>2ae32528d9f6ffde5c27d923cf51e59ed6cef936</id>
<content type='text'>
With a new release being on the way (and long overdue), it's time to get
the CHANGELOG up to date with what actually happened since v0.5.0.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With a new release being on the way (and long overdue), it's time to get
the CHANGELOG up to date with what actually happened since v0.5.0.
</pre>
</div>
</content>
</entry>
<entry>
<title>make EventKind non-exhaustive</title>
<updated>2021-11-18T19:25:04+00:00</updated>
<author>
<name>Daniel Schadt</name>
<email>kingdread@gmx.de</email>
</author>
<published>2021-11-18T19:25:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kingdread.de/cgit.cgi/evtclib/commit/?id=028af389a037a6edc0ff5b26e34abde9ecc1042c'/>
<id>028af389a037a6edc0ff5b26e34abde9ecc1042c</id>
<content type='text'>
There are two reasons for this:

First, we want to implement new events (and arcdps might add new events
themselves) without having to release a new major version. Adding enum
variants is usually a breaking change, because match blocks have to be
adjusted to keep every variant included. This is the same reason why we
made Encounter and Boss non-exhaustive as well.

Secondly, the usual modus operandi is not to iterate through all events
and do something for every event kind that you find, but rather to
iterate through the events and look for the events that you find
interesting. This means that most often, you will use a match with a
"do-nothing" catch-all, an if-let or a matches!() anyway, in which case
this change does not affect the code in a good or bad way.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are two reasons for this:

First, we want to implement new events (and arcdps might add new events
themselves) without having to release a new major version. Adding enum
variants is usually a breaking change, because match blocks have to be
adjusted to keep every variant included. This is the same reason why we
made Encounter and Boss non-exhaustive as well.

Secondly, the usual modus operandi is not to iterate through all events
and do something for every event kind that you find, but rather to
iterate through the events and look for the events that you find
interesting. This means that most often, you will use a match with a
"do-nothing" catch-all, an if-let or a matches!() anyway, in which case
this change does not affect the code in a good or bad way.
</pre>
</div>
</content>
</entry>
<entry>
<title>update changelog</title>
<updated>2021-11-18T19:08:20+00:00</updated>
<author>
<name>Daniel Schadt</name>
<email>kingdread@gmx.de</email>
</author>
<published>2021-11-18T19:08:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kingdread.de/cgit.cgi/evtclib/commit/?id=14bf5eb9e56de631d6dc2e47d6023c742c14b7e2'/>
<id>14bf5eb9e56de631d6dc2e47d6023c742c14b7e2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>speed up Log::is_boss</title>
<updated>2021-11-18T18:52:18+00:00</updated>
<author>
<name>Daniel Schadt</name>
<email>kingdread@gmx.de</email>
</author>
<published>2021-11-18T18:52:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kingdread.de/cgit.cgi/evtclib/commit/?id=681022fb9c6099f187397e70ecc74d90ac03947b'/>
<id>681022fb9c6099f187397e70ecc74d90ac03947b</id>
<content type='text'>
It is way cheaper to retrieve the correct agent first (especially with
the faster agent_by_addr) and then check if it is a boss, rather than
iterating over all bosses (which iterates through all characters), and
then iterate through the found bosses to check if any address matches.

The new code is a bit longer (and doesn't combine the functions as
nicely), but it is still readable and more performant - which is more
important.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is way cheaper to retrieve the correct agent first (especially with
the faster agent_by_addr) and then check if it is a boss, rather than
iterating over all bosses (which iterates through all characters), and
then iterate through the found bosses to check if any address matches.

The new code is a bit longer (and doesn't combine the functions as
nicely), but it is still readable and more performant - which is more
important.
</pre>
</div>
</content>
</entry>
<entry>
<title>speed up Log::agent_by_addr</title>
<updated>2021-11-18T18:46:52+00:00</updated>
<author>
<name>Daniel Schadt</name>
<email>kingdread@gmx.de</email>
</author>
<published>2021-11-18T18:44:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kingdread.de/cgit.cgi/evtclib/commit/?id=817d10634f54631004dc0ac9bee04e22fe4b46b6'/>
<id>817d10634f54631004dc0ac9bee04e22fe4b46b6</id>
<content type='text'>
We know that the way we construct the Log, the agents are always sorted
by their address. This invariant cannot be broken, as the only way to
construct a Log is in evtclib itself, and there is no way to obtain a
mutable view on the agent vector or change the address of an agent.

Since Log::agent_by_addr is used by other functions, this speedup (even
if it is small) can show in a lot of different places.

Note that if we change the interface of Log in the future to allow
creating logs from different sources that processing::process, we need
to make sure we adjust this function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We know that the way we construct the Log, the agents are always sorted
by their address. This invariant cannot be broken, as the only way to
construct a Log is in evtclib itself, and there is no way to obtain a
mutable view on the agent vector or change the address of an agent.

Since Log::agent_by_addr is used by other functions, this speedup (even
if it is small) can show in a lot of different places.

Note that if we change the interface of Log in the future to allow
creating logs from different sources that processing::process, we need
to make sure we adjust this function.
</pre>
</div>
</content>
</entry>
<entry>
<title>switch order of operands in SH analyzer</title>
<updated>2021-11-18T18:37:05+00:00</updated>
<author>
<name>Daniel Schadt</name>
<email>kingdread@gmx.de</email>
</author>
<published>2021-11-18T18:37:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kingdread.de/cgit.cgi/evtclib/commit/?id=ae884762ca300b265355afb6aeaed5010352f167'/>
<id>ae884762ca300b265355afb6aeaed5010352f167</id>
<content type='text'>
Comparing the int is a very cheap operation, and it is also a very good
indicator already that we've found the right event. Due to the short
circuiting behaviour of &amp;&amp;, it is better to check that first before
doing the Log::is_boss check - which is relatively costly. Remember that
we do this check for every buff application event!

This brings a speedup of around 50x:
new:    654.1±25.18µs
old:    34.9±0.69ms
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Comparing the int is a very cheap operation, and it is also a very good
indicator already that we've found the right event. Due to the short
circuiting behaviour of &amp;&amp;, it is better to check that first before
doing the Log::is_boss check - which is relatively costly. Remember that
we do this check for every buff application event!

This brings a speedup of around 50x:
new:    654.1±25.18µs
old:    34.9±0.69ms
</pre>
</div>
</content>
</entry>
</feed>
