summaryrefslogtreecommitdiffstats
path: root/src/utils/gen_util.rs
AgeCommit message (Collapse)Author
2024-01-01refactor: move around configuration-related files (#1370)Clement Tsang
* rename general utils file * refactor: move around some configuration files * more shuffling around * fix some ugly formatting
2023-11-27other: preallocate space for ellipsis (#1336)Clement Tsang
2023-11-27refactor: iteratively detect ASCII and build string when truncating (#1334)Clement Tsang
* refactor: iteratively detect ASCII and build string when truncating * more tests * test going by usize * Revert "test going by usize" This reverts commit 4fe71260e70696a0bb5907c97a2ca049fc23214c.
2023-11-24refactor: add fast branch if the string is short enough to not be truncated ↵Clement Tsang
(#1333) * refactor: add fast branch if the entire string is definitely not truncated * update comments
2023-11-23refactor: add fast branch for ascii-only string truncate (#1330)Clement Tsang
This is just a first attempt to speed up what looked like a hot spot in samply's profiling results. Benchmark code and results here: https://gist.github.com/ClementTsang/e242f12f7e1d1902ed414dcc18c3b321
2023-11-19other: add additional clamping functions on numeric types (#1324)Clement Tsang
* other: add additional clamping functions on numeric types * add tests and replace one usage
2023-11-15refactor: clean up some query code and some ascii-only string comparisons ↵Clement Tsang
(#1316) * refactor: update some stuff in the query code * do some eq_ignore_ascii work * tests * some docs, and rename files
2023-11-15chore: fix certain uninlined string format uses (#1310)Yuri Astrakhan
* Fixed uninlined args First ran this, and fixed a few more similar issues by hand ``` cargo clippy --workspace --fix --benches --tests --bins -- -A clippy::all -W clippy::uninlined_format_args ``` Note that in a few cases, format args were passed by ref - which is actually a tiny perf hit - compiler would not be able to optimize them. * revert change here since it contains a non-inlineable variable I'm not a fan of using it partially here * revert given the other formats above/below I would prefer keeping it like this --------- Co-authored-by: Clement Tsang <34804052+ClementTsang@users.noreply.github.com>
2023-10-22chore: Minor cleanup - remove un-needed ident qualifiers (#1307)Yuri Astrakhan
Keep code a bit tidier and consistent (i.e. if an identifier already has a `use` entry above, why in some cases still prove a full path to it?)
2023-05-31deps: bump ratatui to 0.21.0 (#1178)Clement Tsang
2023-03-03refactor: migrate memory collection to sysinfo for all platforms (#1036)Clement Tsang
* cleanup * refactor: remove heim memory code * add missing updates, remove heim memory feature * restrict export visibility * some refactoring, remove smol * gpu feature
2022-12-31bug: fix search scrolling with wider Unicode characters. (#938)Clement Tsang
This should help make search scrolling more reliable larger Unicode characters like CJK/flag characters.
2022-12-05bug: fix incorrect text width calculation (#925)Clement Tsang
* bug: fix incorrect text calculation * actual fix, add tests * appease clippy * add link to inspiration
2022-11-29other: slightly reduce the CPU time spent for draws (#918)Clement Tsang
* other: group all dataset draws in a time chart We used to draw each data set separately as a new canvas. Now, in one canvas, we draw all datasets. Note that this changes how dataset lines are drawn - rather than drawing one on top of another, it now draws kinda all at once. This effect is *kinda* a bit better IMO, but it might also look a bit more cluttered. * other: optimize truncate_text Flamegraphs showed that this area seems to be a bit heavy at times with some inefficient use of iterators and collection. This change should hopefully optimize this a bit by reducing some collections or reallocations. There can also be some further optimizations with less allocations from callers. * Reduce some redundant draws
2022-11-20other: clean up some strings (#904)Clement Tsang
* other: clean up some strings * formatting
2022-11-17other: deduplicate sorts, always sort proc by PID first (#898)Clement Tsang
* other: deduplicate sorts, sort proc by PID by default * add proc test * remove sort in Windows * fix tree * fix test * Remove mut * Add comment on sorting processes
2022-10-12refactor: tables V2 (#749)Clement Tsang
* refactor: move to new data table implementation * more work towards refactor * move disk and temp over, fix longstanding bug with disk and temp if removing the last value and selected * work towards porting over CPU work towards porting over CPU fix typo partially port over cpu, fix some potentially inefficient concat_string calls more work towards cpu widget migration some refactoring * sortable data sortable data more refactoring some sort refactoring more refactoringgggg column refactoring renaming and reorganizing more refactoring regarding column logic add sort arrows again * move over sort menu * port over process port over process precommit temp temp two, remember to squash work fix broken ltr calculation and CPU hiding add back row styling temp fix a bunch of issues, get proc working more fixes around click fix frozen issues * fix dd process killing * revert some of the persistent config changes from #257 * fix colouring for trees * fix missing entries in tree * keep columns if there is no data * add and remove tests * Fix ellipsis
2022-05-15refactor: simplify partial ordering fn, clean up codeClementTsang
2022-05-15refactor: remove redundant get_ordering fn, add testsClementTsang
2022-05-15bug: fix issues with macos and windows during refactorClementTsang
2022-05-15refactor: more work towards unifying process codeClementTsang
A bunch of work towards also refactoring how the process widget gathers and converts data.
2021-04-04feature: Rework network y-axis, linear interpolation for off-screen data (#437)Clement Tsang
Rewrite of the y-axis labeling and scaling for the network widget, along with more customization. This still has one step to be optimized (cache results so we don't have to recalculate the legend each time), but will be done in another PR for sake of this one being too large already. Furthermore, this change adds linear interpolation at the 0 point in the case a data point shoots too far back - this seems to have lead to ugly gaps to the left of graphs in some cases, because the left hand limit was not big enough for the data point. We address this by grabbing values just outside the time range and linearly interpolating at the leftmost limit. This affects all graph widgets (CPU, mem, network). This can be optimized, and will hopefully be prior to release in a separate change.
2020-09-06feature: Adds tree view (#223)Clement Tsang
Adds a tree process view to bottom. Currently uses a pretty jank method of column width setting, should get fixed in #225.
2020-08-28feature: Adaptive network widget (#206)Clement Tsang
Allows the network widget graph to grow/shrink with current data, rather than using a static size.
2020-03-02Refactoring.ClementTsang
2020-02-01Optimizing processes...ClementTsang
2020-01-07Formatting changes to be a bit more strict on line lengthClementTsang
2019-12-28Rearrange to fit legend and extra info.ClementTsang
2019-12-27Some cleaning to avoid duplicate codeClementTsang