Skip to content

Conversation

portasynthinca3
Copy link
Member

@portasynthinca3 portasynthinca3 commented Mar 5, 2025

What's new

  • Moved some JS modules to the new arg parser: event_loop, storage, gui, gui/file_picker, gui/icon, gpio, serial
  • As a result, reduced the code size of these modules, leading to reduced RAM usage:
    +-----------------+-------+-------+--------+
    | JS Module       |  New  |  Old  | Change |
    +-----------------+-------+-------+--------|
    | event_loop      | 3568  | 4744  | -25%   |
    | storage         | 9104  | 14712 | -38%   |
    | gui             | 5632  | 7616  | -26%   |
    | gui/file_picker | 541   | 829   | -35%   |
    | gui/icon        | 1513  | 2041  | -26%   |
    | gpio            | 4596  | 6136  | -25%   |
    | serial          | 6124  | 8596  | -29%   |
    +-----------------+-------+-------+--------+
    | total           | 31078 | 44674 | -30%   |
    +-----------------+-------+-------+--------+
    
    The net flash usage increase is 128 bytes. The new parser is about 1700 bytes, but that is mostly offset due to the in-flash modules being moved to the new parser as well.

Verification

  • Run unit tests
  • Run the gpio, uart_echo, uart_echo_8e1 and gui demo scripts and verify that they work as intended

Remarks

This PR depends on #4135, please review and merge it before this one.

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

@portasynthinca3 portasynthinca3 added the JS JS Runtime, loader and API label Mar 5, 2025
Copy link

github-actions bot commented Mar 5, 2025

Compiled f7 firmware for commit 71dff656:

@portasynthinca3 portasynthinca3 marked this pull request as ready for review March 5, 2025 08:35
@hedger hedger merged commit dac1457 into dev Apr 4, 2025
11 checks passed
@hedger hedger deleted the portasynthinca3/3963-js-use-js_value branch April 4, 2025 23:17
hedger added a commit to RebornedBrain/flipperzero-firmware that referenced this pull request Apr 5, 2025
* js: value destructuring and tests

* js: temporary fix to see size impact

* js_val: reduce code size 1

* i may be stupid.

* test: js_value args

* Revert "js: temporary fix to see size impact"

This reverts commit f51d726.

* pvs: silence warnings

* style: formatting

* pvs: silence warnings?

* pvs: silence warnings??

* js_value: redesign declaration types for less code

* js: temporary fix to see size impact

* style: formatting

* pvs: fix helpful warnings

* js_value: reduce .rodata size

* pvs: fix helpful warning

* js_value: reduce code size 1

* fix build error

* style: format

* Revert "js: temporary fix to see size impact"

This reverts commit d6a46f0.

* style: format

* js: move to new arg parser

* style: format

---------

Co-authored-by: hedger <hedger@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JS JS Runtime, loader and API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants