9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] resample: improve performance
@ 2021-04-23 13:34 José Miguel Sánchez García
  2021-04-25 10:13 ` cinap_lenrek
  0 siblings, 1 reply; 2+ messages in thread
From: José Miguel Sánchez García @ 2021-04-23 13:34 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 651 bytes --]

Resample is well known for taking a long time to resize an image. This
patch brings an important performance boost (in my test image, time
was reduced from ~2850ms to ~500ms). It does that by extracting FP
multiplication and division out of the innermost loop of
resamplex/resampley.

The results differ slightly from the current implementation: in my
test: ~0.3% of the bytes had a ±2 difference in their value, which I
attribute to rounding errors. I'm personally not concerned with that
deviation, given the performance gains. However, I recommend testing
it just to be sure I didn't overlook anything.

José Miguel Sánchez García

[-- Attachment #2: resample-optimize-fpmath.diff --]
[-- Type: application/octet-stream, Size: 1261 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9front] resample: improve performance
  2021-04-23 13:34 [9front] resample: improve performance José Miguel Sánchez García
@ 2021-04-25 10:13 ` cinap_lenrek
  0 siblings, 0 replies; 2+ messages in thread
From: cinap_lenrek @ 2021-04-25 10:13 UTC (permalink / raw)
  To: 9front

very nice! i'll apply it.

--
cinap

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-25 10:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 13:34 [9front] resample: improve performance José Miguel Sánchez García
2021-04-25 10:13 ` cinap_lenrek

9front - general discussion about 9front

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/9front

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 9front 9front/ http://inbox.vuxu.org/9front \
		9front@9front.org
	public-inbox-index 9front

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.9front


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git