circuitpython/shared-module
Jeff Epler b7f5c277ad _pixelbuf: Increase performance of brightness-scaling
On the Pico, this increases the "fill rate" of
    pixels[:] = newvalues
considerably.  On a strip of 240 RGB LEDs, auto_write=False, the timings
are:

|| Brightness || Before || After || Improvement ||
|| 1.0        || 117 kpix/s || 307 kpix/s || 2.62x ||
|| 0.07       || 117 kpix/s || 273 kpix/s || 2.33x ||

It's worth noting that even the "before" rate is fast compared to the
time to transmit a single neopixel, but any time we can gain back
in the whole pipeline will let marginal animations work a little better.
To set all the pixels in this way and then show() gives a pleasant bump
to the framerate, from about 108Hz to 124Hz (1.15x)

The main source of speed-up is using integer math instead of floating
point math for the calculation of the post-scaled pixel values.  A slight
secondary gain is achieved by avoiding the scaling altogether when
the scale factor is 1.0.

Because the math is not exactly the same, some scaled pixel values may
change by +- 1 RGBW "step".  In practice, this is unlikely to matter.

The gains are bigger on the Pico and other M0 microcontrollers than M4
microcontrollers with floating point math in the hardware.

Happily, flash size is also improved a bit on the Pico build I did,
going from
> 542552 bytes used, 506024 bytes free in flash firmware space out of 1048576 bytes (1024.0kB).

to
> 542376 bytes used, 506200 bytes free in flash firmware space out of 1048576 bytes (1024.0kB).
2021-02-24 09:51:27 -06:00
..
_bleio discovery of Nordic UART service working 2020-08-08 00:29:37 -04:00
_eve Change from fixed-point integer arguments to floating point in EVE API functions 2021-01-22 15:52:46 -08:00
_pixelbuf _pixelbuf: Increase performance of brightness-scaling 2021-02-24 09:51:27 -06:00
_stage modified _stage/__init__.c call to set region to update 2020-09-28 19:10:47 -04:00
adafruit_bus_device Remove adafruit_bus_device.SPIDevice.spi 2021-02-11 10:33:57 -05:00
aesio aesio: add basic AES encryption and decryption 2020-05-06 17:40:06 +08:00
audiocore esp32s2: add I2SOut 2020-12-29 14:46:38 -06:00
audioio bring MixerVoice back to building state; update documentation 2019-08-03 11:20:06 -05:00
audiomixer audiomixer: Fix garbled playback when voice 0 is stopped, audio pops 2020-06-01 19:14:38 -05:00
audiomp3 MP3Decoder: take advantage of background callback 2020-07-15 09:26:47 -05:00
audiopwmio audiopwmio: Add the shared files for this new module 2019-07-26 07:52:37 -05:00
bitbangio Add license to some obvious files. 2020-07-06 19:16:25 +01:00
bitops requested changes 2021-02-18 17:19:34 -06:00
board Fix lost board.SPI and board.I2C after explicitly deiniting them. 2020-10-26 22:44:38 +01:00
busio add timeout keyword to I2C - for bitbangio - ignored for busio 2018-05-13 21:54:44 -04:00
canio CAN: Use mp_obj_t insteaed of canio_message_obj_t, get rid of rtr field 2020-09-28 17:22:00 -05:00
displayio update common_hal_reset_pin() 2020-12-28 20:04:00 +05:30
fontio Move Glyph and BuiltinFont into fontio 2019-03-19 16:22:09 -07:00
framebufferio displayio: further ensure just one start_terminal call 2020-10-15 15:24:19 -05:00
gamepad Gamepad & GamepadShift: Enable ticks while object exists 2020-05-13 10:14:37 -05:00
gamepadshift Gamepad & GamepadShift: Enable ticks while object exists 2020-05-13 10:14:37 -05:00
ipaddress Changes based on Dan's feedback 2020-09-03 16:32:12 -07:00
memorymonitor remove other extraneous files 2020-08-21 19:10:13 -05:00
msgpack handle exttype & chunk long reads 2021-01-18 10:13:16 -08:00
multiterminal Merge tag 'v1.9.3' 2017-11-02 12:41:50 -07:00
network Add license to some obvious files. 2020-07-06 19:16:25 +01:00
os Fix warnings that come from -O3 (I think) 2021-01-20 19:16:56 -08:00
random merge from upstream + wip 2020-11-25 17:52:06 -05:00
rgbmatrix rgbmatrix: Eliminate some duplicated height-calculating code 2021-01-26 14:35:26 -06:00
sdcardio Add initial RP2040 support 2021-01-20 19:16:56 -08:00
sharpdisplay Use movable allocation system for Sharp display framebuffer. 2020-11-28 17:54:34 +01:00
socket modify modnetwork and modusocket for circuitpython 2018-10-04 22:02:25 +10:00
storage Merge pull request #3223 from dhalbert/unmount-before-reset 2020-07-29 10:47:24 -07:00
struct struct.pack_into incorrect buffer size check 2019-01-21 11:45:38 -05:00
terminalio fix terminalio not clearing on construct 2019-08-08 14:58:51 -04:00
time merge from upstream + wip 2020-11-25 17:52:06 -05:00
touchio Claim USB pins at startup to prevent overwrites 2020-07-22 14:22:05 -04:00
uheap uheap: Switch to using gc_nbytes to measure allcoation size so we stop undercounting. 2016-11-23 17:32:50 -08:00
usb_cdc Avoid pulling in extra float-uint64 routines 2021-02-21 12:05:03 -05:00
usb_hid support to get HID OUT report 2020-08-19 20:18:17 +08:00
usb_midi Fix align32_size(). 2020-11-28 17:54:34 +01:00
ustack Fix up end of file and trailing whitespace. 2020-06-03 10:56:35 +01:00
vectorio use top-left heuristic for vectorio.Polygon 2020-07-28 23:10:59 -07:00
wiznet Add license to some obvious files. 2020-07-06 19:16:25 +01:00