<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pakakeh.go, branch v0.39.0</title>
<subtitle>Collections of packages and tools for working with Go programming language.</subtitle>
<id>http://git.kilabit.info/pakakeh.go/atom?h=v0.39.0</id>
<link rel='self' href='http://git.kilabit.info/pakakeh.go/atom?h=v0.39.0'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/'/>
<updated>2022-07-03T08:07:19Z</updated>
<entry>
<title>Release share v0.39.0 (2022-07-03)</title>
<updated>2022-07-03T08:07:19Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2022-07-03T08:07:14Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=ec8dcf9eba1fc69a3b3369a2494ee8f01ef4f196'/>
<id>urn:sha1:ec8dcf9eba1fc69a3b3369a2494ee8f01ef4f196</id>
<content type='text'>
Breaking changes

* all: move lib/sanitize.HTML to net/html.Sanitize

New features,

* lib/mlog: add method Close to MultiLogger
* lib/clise: implement json.Marshaler on Clise
* net/html: add function NormalizeForID
* lib/http: add function to unmarshal url.Values using tag `form:`
* lib/reflect: implement Set function to set reflect.Value by string
* lib/reflect: add function Unmarshal
* lib/reflect: add function Tag to simplify lookup on struct's field tag

Enhancements,

* lib/memfs: update the template format
* net/html: use inline replacement to clean up white spaces
* lib/mlog: minimize allocation when generating log
* lib/dns: use Shutdown to stop DoH server
* lib/websocket: realign all struct to minimize allocations
</content>
</entry>
<entry>
<title>doc: split changelog files by year</title>
<updated>2022-07-03T07:38:30Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2022-07-03T07:38:30Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=557cf80f27208fad7bf240ed400185e62d0684e8'/>
<id>urn:sha1:557cf80f27208fad7bf240ed400185e62d0684e8</id>
<content type='text'>
Since we release each month, the changelog growth bigger every times.
In order to focus reader to latest changes, we move old changelogs to
another files grouped by year.
</content>
</entry>
<entry>
<title>lib/memfs: update the template format</title>
<updated>2022-07-02T08:02:57Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2022-07-02T08:02:57Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=3a61112d7a4d1124354613a715cc23e5b2f0ab50'/>
<id>urn:sha1:3a61112d7a4d1124354613a715cc23e5b2f0ab50</id>
<content type='text'>
Replace ":=" with "var" and realign the field assignments.
</content>
</entry>
<entry>
<title>net/html: use inline replacement to clean up white spaces</title>
<updated>2022-07-02T05:54:13Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2022-06-27T16:30:03Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=21f2f2f64ab9f846800730003cf83643dd69b066'/>
<id>urn:sha1:21f2f2f64ab9f846800730003cf83643dd69b066</id>
<content type='text'>
Instead of using bytes.Replace, three times, iterate the plain text
manually to clean up the white and multiple spaces.

Benchmark result,

name        old time/op    new time/op    delta
Sanitize-8    4.27µs ±10%    2.64µs ±13%  -38.21%  (p=0.000 n=10+10)

name        old alloc/op   new alloc/op   delta
Sanitize-8    4.84kB ± 0%    4.45kB ± 0%   -7.94%  (p=0.000 n=10+10)

name        old allocs/op  new allocs/op  delta
Sanitize-8      13.0 ± 0%       6.0 ± 0%  -53.85%  (p=0.000 n=10+10)
</content>
</entry>
<entry>
<title>all: move lib/sanitize.HTML to net/html.Sanitize</title>
<updated>2022-06-27T16:04:43Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2022-06-27T16:04:43Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=0f8ba5965c82c2c912f3c937e78917e20cd1eeb7'/>
<id>urn:sha1:0f8ba5965c82c2c912f3c937e78917e20cd1eeb7</id>
<content type='text'>
Since the sanitize package only contains HTML function, and the html
package already exist, we move the function into html package.
</content>
</entry>
<entry>
<title>net/html: convert the NormalizeForID input letters to lower case</title>
<updated>2022-06-27T15:39:32Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2022-06-27T15:39:32Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=a311d39ce9a4172ffd1c2c9ec931a17ac3d92bed'/>
<id>urn:sha1:a311d39ce9a4172ffd1c2c9ec931a17ac3d92bed</id>
<content type='text'>
While at it, minimize allocation by using the input []byte as
output.
</content>
</entry>
<entry>
<title>lib/mlog: minimize allocation when generating log</title>
<updated>2022-06-26T19:35:43Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2022-06-26T19:10:50Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=0e75792d7548c5177aa5fb1822d733288f3a3177'/>
<id>urn:sha1:0e75792d7548c5177aa5fb1822d733288f3a3177</id>
<content type='text'>
Instead of using two bytes.Buffer pool, use one;
and add space after time and prefix by writing to buffer directly instead
of allocating new arguments to Fprintf.

Benchmark result,

name           old time/op    new time/op    delta
MultiLogger-8    3.97µs ± 3%    3.68µs ± 2%   -7.43%  (p=0.008 n=5+5)

name           old alloc/op   new alloc/op   delta
MultiLogger-8      510B ± 1%      300B ± 1%  -41.13%  (p=0.008 n=5+5)

name           old allocs/op  new allocs/op  delta
MultiLogger-8      10.4 ± 6%       3.4 ±18%  -67.31%  (p=0.008 n=5+5)
</content>
</entry>
<entry>
<title>lib/mlog: simplify flushing by using single channel</title>
<updated>2022-06-26T19:35:43Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2022-06-26T16:10:07Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=519a02b5a3a8cfd4801f5d2825f6511db40ca6d7'/>
<id>urn:sha1:519a02b5a3a8cfd4801f5d2825f6511db40ca6d7</id>
<content type='text'>
Instead of using different channel to handle flush, send command
with specific string "__flush__".
</content>
</entry>
<entry>
<title>lib/mlog: minimize checking for new line</title>
<updated>2022-06-26T19:35:43Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2022-06-26T11:13:20Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=e4e820fcb0fd5a1ba1343d697fcbe9fbfce7ac4a'/>
<id>urn:sha1:e4e820fcb0fd5a1ba1343d697fcbe9fbfce7ac4a</id>
<content type='text'>
Since Outf and Errf must end with new line move checking and
adding new line to writeTo, before its being processed.
</content>
</entry>
<entry>
<title>lib/mlog: add method Close to MultiLogger</title>
<updated>2022-06-26T19:34:28Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2022-06-26T11:02:38Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=f87cbcee2f277a295cd1343a95fd6525f5c9cf2e'/>
<id>urn:sha1:f87cbcee2f277a295cd1343a95fd6525f5c9cf2e</id>
<content type='text'>
The Close method flush and close all log forwarders.
Any write to a closed MultiLogger will be ignored.

This changes require adding sync.Mutex to mark if the instance has been
closed or not; which affect createMultiLogger and defaultMLog to return
a pointer to prevent copy on Mutex.
</content>
</entry>
</feed>
