Skip to content

Optimize SVG icons #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Optimize SVG icons #57

wants to merge 1 commit into from

Conversation

zpc0
Copy link

@zpc0 zpc0 commented Jun 5, 2025

using SVGO with --pretty option.

Copy link

codecov bot commented Jun 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.15%. Comparing base (36cf7ec) to head (aa4fdf6).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #57      +/-   ##
==========================================
- Coverage   79.46%   79.15%   -0.32%     
==========================================
  Files          23       23              
  Lines        2518     2518              
==========================================
- Hits         2001     1993       -8     
- Misses        517      525       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marmarek
Copy link
Member

marmarek commented Jun 6, 2025

What is the point of this change? Small difference in file size shouldn't really matter as it's loaded from local disk, not over the network. And this PR removes also a bunch of metadata (including license) from some of the icons, and in few cases changes also default icon size. And the formatting change will be un-done the next time icon is edited anyway...

If there is some reason to prefer smaller files anyway (or if I missed some other side effects), IMO better to not touch the source in the repo, but add the conversion to the build process.

@marmarek
Copy link
Member

marmarek commented Jun 6, 2025

The above comment applies to other similar PRs too: QubesOS/qubes-desktop-linux-manager#265, QubesOS/qubes-manager#426,

@zpc0
Copy link
Author

zpc0 commented Jun 7, 2025

This PR is just small housekeeping, so it will not fix something or introduce new features. Cleaning redundant SVG codes will save some CPU, Mem, Disk usages, but indeed the difference is small. Feel free to close this if review burden is too much.

And this PR removes also a bunch of metadata (including license) from some of the icons, and in few cases changes also default icon size.

These are my mistakes and not intended. I will fix these problems ASAP if this type of PR can be accepted.

If there is some reason to prefer smaller files anyway (or if I missed some other side effects), IMO better to not touch the source in the repo, but add the conversion to the build process.

I think adding optimization step to build process is not needed, because icon files are not changed frequently, and adding external npm package to build env maybe risky. (There are many cases of npm package's compromise...)

@zpc0 zpc0 force-pushed the optimize-icons branch from 114d6bc to 7e02a42 Compare June 8, 2025 10:23
SVGO with --pretty --multipass option and
removeMetadata: false
cleanupIds: false
removeViewBox: false
@zpc0 zpc0 force-pushed the optimize-icons branch from 7e02a42 to aa4fdf6 Compare June 8, 2025 10:28
@zpc0
Copy link
Author

zpc0 commented Jun 8, 2025

I changed SVGO config to keep metadata, viewbox and id.

@qubesos-bot
Copy link

qubesos-bot commented Jul 5, 2025

OpenQA test summary

Complete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2025072115-4.3&flavor=pull-requests

Test run included the following:

New failures, excluding unstable

Compared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2025061004-4.3&flavor=update

  • system_tests_pvgrub_salt_storage

    • TC_41_HVMGrub_debian-12-xfce: test_000_standalone_vm (error + cleanup)
      raise TimeoutError from exc_val... TimeoutError
  • system_tests_audio

  • system_tests_qwt_win10@hw13

    • windows_install: wait_serial (wait serial expected)
      # wait_serial expected: qr/tKcyh-\d+-/...

    • windows_install: Failed (test died + timed out)
      # Test died: command 'script -e -c 'bash -x /usr/bin/qvm-create-win...

  • system_tests_qwt_win10_seamless@hw13

    • windows_install: wait_serial (wait serial expected)
      # wait_serial expected: qr/4E4Ei-\d+-/...

    • windows_install: Failed (test died + timed out)
      # Test died: command 'script -e -c 'bash -x /usr/bin/qvm-create-win...

  • system_tests_qwt_win11@hw13

    • windows_install: wait_serial (wait serial expected)
      # wait_serial expected: qr/qDqV_-\d+-/...

    • windows_install: Failed (test died + timed out)
      # Test died: command 'script -e -c 'bash -x /usr/bin/qvm-create-win...

  • system_tests_basic_vm_qrexec_gui_ext4

    • TC_20_NonAudio_whonix-gateway-17-pool: test_012_qubes_desktop_run (error + cleanup)
      raise TimeoutError from exc_val... TimeoutError
  • system_tests_dispvm

Failed tests

14 failures
  • system_tests_pvgrub_salt_storage

    • TC_41_HVMGrub_debian-12-xfce: test_000_standalone_vm (error + cleanup)
      raise TimeoutError from exc_val... TimeoutError
  • system_tests_kde_gui_interactive

    • gui_keyboard_layout: wait_serial (wait serial expected)
      # wait_serial expected: "echo -e '[Layout]\nLayoutList=us,de' | sud...

    • gui_keyboard_layout: Failed (test died)
      # Test died: command 'test "$(cd ~user;ls e1*)" = "$(qvm-run -p wor...

  • system_tests_audio

  • system_tests_qwt_win10@hw13

    • windows_install: wait_serial (wait serial expected)
      # wait_serial expected: qr/tKcyh-\d+-/...

    • windows_install: Failed (test died + timed out)
      # Test died: command 'script -e -c 'bash -x /usr/bin/qvm-create-win...

  • system_tests_qwt_win10_seamless@hw13

    • windows_install: wait_serial (wait serial expected)
      # wait_serial expected: qr/4E4Ei-\d+-/...

    • windows_install: Failed (test died + timed out)
      # Test died: command 'script -e -c 'bash -x /usr/bin/qvm-create-win...

  • system_tests_qwt_win11@hw13

    • windows_install: wait_serial (wait serial expected)
      # wait_serial expected: qr/qDqV_-\d+-/...

    • windows_install: Failed (test died + timed out)
      # Test died: command 'script -e -c 'bash -x /usr/bin/qvm-create-win...

  • system_tests_basic_vm_qrexec_gui_ext4

    • TC_20_NonAudio_whonix-gateway-17-pool: test_012_qubes_desktop_run (error + cleanup)
      raise TimeoutError from exc_val... TimeoutError
  • system_tests_dispvm

Fixed failures

Compared to: https://openqa.qubes-os.org/tests/142375#dependencies

11 fixed

Unstable tests

Performance Tests

Performance degradation:

8 performance degradations
  • debian-12-xfce_exec-data-duplex-root: 86.31 🔺 ( previous job: 70.01, degradation: 123.28%)
  • whonix-workstation-17_exec-data-duplex-root: 99.56 🔺 ( previous job: 86.00, degradation: 115.76%)
  • dom0_root_seq1m_q8t1_read 3:read_bandwidth_kb: 209967.00 :small_red_triangle: ( previous job: 289982.00, degradation: 72.41%)
  • dom0_root_rnd4k_q1t1_write 3:write_bandwidth_kb: 276.00 :small_red_triangle: ( previous job: 1840.00, degradation: 15.00%)
  • dom0_varlibqubes_seq1m_q8t1_read 3:read_bandwidth_kb: 217096.00 :small_red_triangle: ( previous job: 289182.00, degradation: 75.07%)
  • dom0_varlibqubes_seq1m_q1t1_read 3:read_bandwidth_kb: 389082.00 :small_red_triangle: ( previous job: 433654.00, degradation: 89.72%)
  • dom0_varlibqubes_rnd4k_q32t1_write 3:write_bandwidth_kb: 5303.00 :small_red_triangle: ( previous job: 8874.00, degradation: 59.76%)
  • dom0_varlibqubes_rnd4k_q1t1_write 3:write_bandwidth_kb: 3281.00 :small_red_triangle: ( previous job: 4420.00, degradation: 74.23%)

Remaining performance tests:

64 tests
  • debian-12-xfce_exec: 6.50 🟢 ( previous job: 8.63, improvement: 75.31%)
  • debian-12-xfce_exec-root: 29.02 🟢 ( previous job: 29.44, improvement: 98.58%)
  • debian-12-xfce_socket: 8.65 🔺 ( previous job: 8.50, degradation: 101.80%)
  • debian-12-xfce_socket-root: 8.48 🔺 ( previous job: 8.31, degradation: 101.95%)
  • debian-12-xfce_exec-data-simplex: 62.86 🟢 ( previous job: 65.51, improvement: 95.96%)
  • debian-12-xfce_exec-data-duplex: 73.23 🟢 ( previous job: 73.55, improvement: 99.57%)
  • debian-12-xfce_socket-data-duplex: 159.08 🟢 ( previous job: 161.35, improvement: 98.59%)
  • fedora-42-xfce_exec: 9.17
  • fedora-42-xfce_exec-root: 57.61
  • fedora-42-xfce_socket: 8.38
  • fedora-42-xfce_socket-root: 8.37
  • fedora-42-xfce_exec-data-simplex: 60.51
  • fedora-42-xfce_exec-data-duplex: 70.40
  • fedora-42-xfce_exec-data-duplex-root: 94.67
  • fedora-42-xfce_socket-data-duplex: 137.76
  • whonix-gateway-17_exec: 7.06 🟢 ( previous job: 7.34, improvement: 96.22%)
  • whonix-gateway-17_exec-root: 38.24 🟢 ( previous job: 39.57, improvement: 96.64%)
  • whonix-gateway-17_socket: 7.70 🟢 ( previous job: 7.85, improvement: 98.06%)
  • whonix-gateway-17_socket-root: 7.75 🟢 ( previous job: 7.89, improvement: 98.14%)
  • whonix-gateway-17_exec-data-simplex: 81.27 🔺 ( previous job: 77.76, degradation: 104.51%)
  • whonix-gateway-17_exec-data-duplex: 79.87 🔺 ( previous job: 78.39, degradation: 101.89%)
  • whonix-gateway-17_exec-data-duplex-root: 91.33 🔺 ( previous job: 90.74, degradation: 100.64%)
  • whonix-gateway-17_socket-data-duplex: 163.47 🔺 ( previous job: 161.95, degradation: 100.94%)
  • whonix-workstation-17_exec: 7.74 🟢 ( previous job: 8.27, improvement: 93.59%)
  • whonix-workstation-17_exec-root: 53.57 🟢 ( previous job: 57.61, improvement: 92.98%)
  • whonix-workstation-17_socket: 8.64 🟢 ( previous job: 8.97, improvement: 96.33%)
  • whonix-workstation-17_socket-root: 8.75 🟢 ( previous job: 9.46, improvement: 92.49%)
  • whonix-workstation-17_exec-data-simplex: 71.46 🟢 ( previous job: 74.54, improvement: 95.87%)
  • whonix-workstation-17_exec-data-duplex: 76.62 🔺 ( previous job: 74.84, degradation: 102.38%)
  • whonix-workstation-17_socket-data-duplex: 152.53 🟢 ( previous job: 160.20, improvement: 95.21%)
  • dom0_root_seq1m_q8t1_write 3:write_bandwidth_kb: 197140.00 :green_circle: ( previous job: 101988.00, improvement: 193.30%)
  • dom0_root_seq1m_q1t1_read 3:read_bandwidth_kb: 232861.00 :green_circle: ( previous job: 14284.00, improvement: 1630.22%)
  • dom0_root_seq1m_q1t1_write 3:write_bandwidth_kb: 153396.00 :green_circle: ( previous job: 32696.00, improvement: 469.16%)
  • dom0_root_rnd4k_q32t1_read 3:read_bandwidth_kb: 19853.00 :green_circle: ( previous job: 17102.00, improvement: 116.09%)
  • dom0_root_rnd4k_q32t1_write 3:write_bandwidth_kb: 2970.00 :green_circle: ( previous job: 1091.00, improvement: 272.23%)
  • dom0_root_rnd4k_q1t1_read 3:read_bandwidth_kb: 11866.00 :green_circle: ( previous job: 11086.00, improvement: 107.04%)
  • dom0_varlibqubes_seq1m_q8t1_write 3:write_bandwidth_kb: 126422.00 :green_circle: ( previous job: 122848.00, improvement: 102.91%)
  • dom0_varlibqubes_seq1m_q1t1_write 3:write_bandwidth_kb: 200223.00 :green_circle: ( previous job: 167872.00, improvement: 119.27%)
  • dom0_varlibqubes_rnd4k_q32t1_read 3:read_bandwidth_kb: 102963.00 :small_red_triangle: ( previous job: 108760.00, degradation: 94.67%)
  • dom0_varlibqubes_rnd4k_q1t1_read 3:read_bandwidth_kb: 7723.00 :green_circle: ( previous job: 6356.00, improvement: 121.51%)
  • fedora-42-xfce_root_seq1m_q8t1_read 3:read_bandwidth_kb: 377185.00
  • fedora-42-xfce_root_seq1m_q8t1_write 3:write_bandwidth_kb: 136506.00
  • fedora-42-xfce_root_seq1m_q1t1_read 3:read_bandwidth_kb: 329948.00
  • fedora-42-xfce_root_seq1m_q1t1_write 3:write_bandwidth_kb: 67605.00
  • fedora-42-xfce_root_rnd4k_q32t1_read 3:read_bandwidth_kb: 80688.00
  • fedora-42-xfce_root_rnd4k_q32t1_write 3:write_bandwidth_kb: 3046.00
  • fedora-42-xfce_root_rnd4k_q1t1_read 3:read_bandwidth_kb: 7479.00
  • fedora-42-xfce_root_rnd4k_q1t1_write 3:write_bandwidth_kb: 891.00
  • fedora-42-xfce_private_seq1m_q8t1_read 3:read_bandwidth_kb: 358855.00
  • fedora-42-xfce_private_seq1m_q8t1_write 3:write_bandwidth_kb: 110852.00
  • fedora-42-xfce_private_seq1m_q1t1_read 3:read_bandwidth_kb: 342336.00
  • fedora-42-xfce_private_seq1m_q1t1_write 3:write_bandwidth_kb: 101173.00
  • fedora-42-xfce_private_rnd4k_q32t1_read 3:read_bandwidth_kb: 88392.00
  • fedora-42-xfce_private_rnd4k_q32t1_write 3:write_bandwidth_kb: 3804.00
  • fedora-42-xfce_private_rnd4k_q1t1_read 3:read_bandwidth_kb: 9031.00
  • fedora-42-xfce_private_rnd4k_q1t1_write 3:write_bandwidth_kb: 842.00
  • fedora-42-xfce_volatile_seq1m_q8t1_read 3:read_bandwidth_kb: 357509.00
  • fedora-42-xfce_volatile_seq1m_q8t1_write 3:write_bandwidth_kb: 119463.00
  • fedora-42-xfce_volatile_seq1m_q1t1_read 3:read_bandwidth_kb: 259035.00
  • fedora-42-xfce_volatile_seq1m_q1t1_write 3:write_bandwidth_kb: 99987.00
  • fedora-42-xfce_volatile_rnd4k_q32t1_read 3:read_bandwidth_kb: 81220.00
  • fedora-42-xfce_volatile_rnd4k_q32t1_write 3:write_bandwidth_kb: 2688.00
  • fedora-42-xfce_volatile_rnd4k_q1t1_read 3:read_bandwidth_kb: 8131.00
  • fedora-42-xfce_volatile_rnd4k_q1t1_write 3:write_bandwidth_kb: 2187.00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants