Fastfetch has bash in it now #2

Closed
opened 2024-06-09 00:13:32 -04:00 by nbrooks211 · 3 comments
Contributor

A recent commit added NIC to fastfetch, while this addition is undoubtedly valuable, the implementation is written in bash which is slow and cringe
Please fix

A recent commit added NIC to fastfetch, while this addition is undoubtedly valuable, the implementation is written in bash which is slow and cringe Please fix
Owner

Hi @nbrooks211,

Thank you for bringing this to our attention. I understand your concerns regarding the performance impact of using Bash for the NIC implementation.

I've conducted a comparison of various implementations of NIC fetching, including Lua, Bash, and Python, and here are the execution times for each:

  • Lua Implementation:

    • Total: 12.15 milliseconds
    • User: 7.86 milliseconds
    • System: 5.88 milliseconds
  • Bash Implementation:

    • Total: 15.86 milliseconds
    • User: 12.42 milliseconds
    • System: 6.78 milliseconds
  • Python Implementation:

    • Total: 44.79 milliseconds
    • User: 37.33 milliseconds
    • System: 7.91 milliseconds

As the results indicate, both the Bash and Lua implementations are fast and perform well within an acceptable range for most users. Additionally, these two languages were chosen because they do not require precompiled binaries, making them more versatile and easier to use across different systems.

Given these findings, while the Bash script does have a slightly higher execution time compared to Lua, it remains a practical and efficient solution. However, we will continue to explore potential optimizations to further enhance performance.

Please let me know if there are any other concerns or suggestions you might have.

Best,
logan2611

Hi @nbrooks211, Thank you for bringing this to our attention. I understand your concerns regarding the performance impact of using Bash for the NIC implementation. I've conducted a comparison of various implementations of NIC fetching, including Lua, Bash, and Python, and here are the execution times for each: - **Lua Implementation:** - Total: 12.15 milliseconds - User: 7.86 milliseconds - System: 5.88 milliseconds - **Bash Implementation:** - Total: 15.86 milliseconds - User: 12.42 milliseconds - System: 6.78 milliseconds - **Python Implementation:** - Total: 44.79 milliseconds - User: 37.33 milliseconds - System: 7.91 milliseconds As the results indicate, both the Bash and Lua implementations are fast and perform well within an acceptable range for most users. Additionally, these two languages were chosen because they do not require precompiled binaries, making them more versatile and easier to use across different systems. Given these findings, while the Bash script does have a slightly higher execution time compared to Lua, it remains a practical and efficient solution. However, we will continue to explore potential optimizations to further enhance performance. Please let me know if there are any other concerns or suggestions you might have. Best, logan2611
logan closed this issue 2024-06-09 01:24:31 -04:00
Author
Contributor

I have made a faster implementation that doesnt require precompiled binawies in C
just have tcc installed and just run the C file (by using ./).

I have made a faster implementation that doesnt require precompiled binawies in C just have tcc installed and just run the C file (by using ./).
4.7 KiB
Owner

Hi @nbrooks211,

Thank you for providing your C implementation. I have tested it, and indeed it performs faster, clocking in at 6.88 milliseconds. The use of #!/bin/tcc -run -lpci effectively achieves the desired behavior of not needing precompiled binaries specific to architecture and distro.

However, it's important to note that TCC only supports x86 architectures. While this solution does improve performance, it sacrifices portability compared to Lua and Bash, which are more versatile across different systems.

Given this limitation, we need to consider the broader user base who might be on different architectures. Thus, while your C implementation is an excellent option for those on x86 systems, we will continue using Lua and Bash for their broader compatibility.

Thank you for your contribution and understanding. Please let me know if there are any other suggestions or concerns you have.

Best,
logan2611

Hi @nbrooks211, Thank you for providing your C implementation. I have tested it, and indeed it performs faster, clocking in at 6.88 milliseconds. The use of `#!/bin/tcc -run -lpci` effectively achieves the desired behavior of not needing precompiled binaries specific to architecture and distro. However, it's important to note that TCC only supports x86 architectures. While this solution does improve performance, it sacrifices portability compared to Lua and Bash, which are more versatile across different systems. Given this limitation, we need to consider the broader user base who might be on different architectures. Thus, while your C implementation is an excellent option for those on x86 systems, we will continue using Lua and Bash for their broader compatibility. Thank you for your contribution and understanding. Please let me know if there are any other suggestions or concerns you have. Best, logan2611
logan closed this issue 2024-06-10 01:59:30 -04:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: logan/dotfiles#2
No description provided.