Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

[Performance] PL9K is terribly slow #1382

Open
Martmists-GH opened this issue Nov 21, 2019 · 2 comments
Open

[Performance] PL9K is terribly slow #1382

Martmists-GH opened this issue Nov 21, 2019 · 2 comments

Comments

@Martmists-GH
Copy link

Martmists-GH commented Nov 21, 2019

Your Hardware

512GB PCIe NVMe Three Layer Cell SSD

Virtualization

Native Linux (Arch x86_64)

Terminal

Termite (latest)

How Fast is Fast

********************************************************************
                      Prompt Benchmark Results
********************************************************************
Warmup duration      8s
Benchmark duration   5.442s
Benchmarked prompts  1
Time per prompt      5442.32ms  <-- prompt latency (lower is better)
********************************************************************

Root cause seems to be the battery prompt.
Settings:

POWERLEVEL9K_BATTERY_BACKGROUND="black"
POWERLEVEL9K_BATTERY_LOW_FOREGROUND="red"
POWERLEVEL9K_BATTERY_CHARGING_FOREGROUND="yellow"
POWERLEVEL9K_BATTERY_CHARGED_FOREGROUND="green"
POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND="green"
POWERLEVEL9K_BATTERY_LOW_THRESHOLD=15
POWERLEVEL9K_BATTERY_VERBOSE=false
POWERLEVEL9K_BATTERY_STAGES=('\uf244 ' '\uf243 ' 
                             '\uf243 ' '\uf243 ' 
                             '\uf242 ' '\uf242 ' 
                             '\uf241 ' '\uf241 ' 
                             '\uf241 ' '\uf240 ')

Cause seems to be acpi -b being slow, unknown why.

@romkatv
Copy link

romkatv commented Nov 21, 2019

Back in 2008 there was an app for iPhone called I Am Rich. It costed $999.99 and didn't do anything.

The application is described as "a work of art with no hidden function at all", with its only purpose being to show other people that they were able to afford it.

I had a similar idea for prompt segments that would do nothing useful except expressing users' virtues. By sporting I Am Generous segment in your prompt you can show everyone how generous you are with screen real estate. Do you have laid back personality, living an unhurried life? Let everyone know with I Am Patient segment that takes 5 seconds to load. Send the supercharged I Am Generous AND Patient message with the exclusive battery segment!

@Syphdias
Copy link
Member

I don't know why acpi -b is slow. As far as I understand its doings it mainly reads a few files from your sysfs (which is not located on any disk but in memory).
The requirement for acpi was removed on the next branch and replaced with reading exactly those files needed for identifying battery status directly. I'm not clear on the timeline of merging next into master.

Could you test if you are having the same slowdown issue with the battery segment on next?

@romkatv Maybe you could open a pull request to add such a segment? I'm sure it would be of great value for lots of people 😆.

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

No branches or pull requests

3 participants