ceroma
589011f956
Feature/improve performance of portfolio snapshot computation
After doing some perf analysis on the portfolio snapshot computation, this line turned out to be the biggest offender on my machine (Raspberry Pi 4).
My current DB consists of 5189 activities and 478 different symbols. The majority (about 400) of the symbols represent single `INTEREST` data points.
This line runs for each `SymbolProfile`, and deep-cloning is very expensive. Specially if most of the time (in my case) it ends up filtering out just one element out of the entire clone. On my machine, this line averaged 280ms per invocation, amounting to over 2 minutes during a snapshot computation.
After this diff, this line averaged 1.5ms per symbol, with a peak of 56ms for my symbol with the highest number of activities (1500). The total time spent filtering and deep-cloning is now less than a second (~750ms).
Per my understanding of the code, this change should preserve the same behavior as before, but I'm not too familiar with TypeScript so please feel free to be very pedantic in the review.
Test Plan:
Check that result of portfolio snapshot computation is the same before and after this diff:
1. Flush portfolio snapshot cache:
```
$ docker exec -it ghostfolio-redis-1 redis-cli --pass $REDIS_PASSWORD del "portfolio-snapshot-f9e4c63e-4b8e-46fc-b6ed-75ca0205f12b"
```
2. Open Accounts to trigger snapshot calculation
3. Dump portfolio snapshot to a file:
```
$ docker exec -it ghostfolio-redis-1 redis-cli --pass $REDIS_PASSWORD --no-auth-warning get "portfolio-snapshot-f9e4c63e-4b8e-46fc-b6ed-75ca0205f12b" | python -c "import json, sys; json.dump(json.loads(json.loads(json.load(sys.stdin))), sys.stdout, indent=2, sort_keys=True)" > snapshot-before.json
```
4. Apply this patch
5. Repeat steps 1-3
6. Compare results, check everything matches except for expiration time:
```
$ diff snapshot-before.json snapshot-after.json
2c2
< "expiration": 1727423725104,
---
> "expiration": 1727424454187,
```
1 year ago
Thomas Kaul
bb445ddf2e
Feature/improve experimental chart in account detail dialog ( #3813 )
* Improve chart in account detail dialog
* Update changelog
1 year ago
Thomas Kaul
4a97e2bb54
Feature/align holdings and regions of public page with allocations page ( #3815 )
* Align holdings and regions of public page with allocations page
* Update changelog
1 year ago
Thomas Kaul
e301dc5612
Feature/add horizontal lines to separate delete actions in menus ( #3805 )
* Add horizontal lines to separate delete action
* Update changelog
1 year ago
Thomas Kaul
e7f10ad4ad
Bugfix/fix typo and update date of Hacktoberfest 2024 blog post ( #3811 )
* Fix typo and update date
1 year ago
Thomas Kaul
46fb075ecb
Feature/improve language localization for de 20240921 ( #3804 )
* Update translations
* Update changelog
1 year ago
Thomas Kaul
98e9b5d895
Feature/consider user language in sharable portfolio link ( #3806 )
* Consider user’s language in sharable portfolio link
* Update changelog
1 year ago
Thomas Kaul
f59e8c8798
Feature/add feature graphic for hacktoberfest 2024 blog post ( #3800 )
* Add feature graphic
1 year ago
Thomas Kaul
be09acdb24
Feature/expose concurrency of data gathering processor as environment variable ( #3799 )
* Expose concurrency of data gathering processor
* PROCESSOR_CONCURRENCY_GATHER_ASSET_PROFILE
* PROCESSOR_CONCURRENCY_GATHER_HISTORICAL_MARKET_DATA
* Update changelog
1 year ago
Thomas Kaul
6f227e677c
Feature/refactor environment variable access in create user of user service ( #3797 )
* Refactor environment variable access
1 year ago
Thomas Kaul
e918970feb
Feature/expose concurrency of portfolio snapshot calculation as environment variable ( #3796 )
* Expose PROCESSOR_CONCURRENCY_PORTFOLIO_SNAPSHOT
* Update changelog
1 year ago
Thomas Kaul
20d709380a
Feature/add no auto-renewal hint to account membership page ( #3795 )
* Add hint
1 year ago
Thomas Kaul
7053aba2da
Feature/add portfolio performance metrics to public page ( #3793 )
* Add portfolio performance metrics
* Update changelog
1 year ago
Thomas Kaul
583c14128b
Feature/extend public api with portfolio performance metrics endpoint ( #3762 )
* Extend Public API with portfolio performance metrics endpoint
* Update changelog
1 year ago
Thomas Kaul
9b07b19523
Feature/improve usability of create or update access dialog ( #3791 )
* Improve usability
* Dialog height
* Always show permission selector
* Update changelog
1 year ago
Thomas Kaul
7761e4d712
Feature/add hacktoberfest 2024 blog post ( #3790 )
* Add blog post: Hacktoberfest 2024
* Update changelog
1 year ago
Thomas Kaul
3cd77523a1
Feature/improve loading indicator of accounts table ( #3761 )
* Improve loading indicator
* Update changelog
1 year ago
Thomas Kaul
2bd14b135c
Feature/extract locales 20240919 ( #3785 )
1 year ago
Thomas Kaul
f0df8a5254
Feature/add snake-case hint to localized routes ( #3783 )
* Add snake-case hint to localized routes
1 year ago
Thomas Kaul
cb472c0884
Feature/improve ghostfolio po polsku ( #3782 )
* Improve Ghostfolio po polsku
1 year ago
karolsol
d1f6601c5e
Feature/Improve language localization for pl ( #3780 )
* Update translations
* Update changelog
1 year ago
Thomas Kaul
97467a3809
Feature/improve language localization for de 20240917 ( #3778 )
* Update translations
* Update changelog
1 year ago
Thomas Kaul
4865aa1665
Feature/add fallback in get quotes of eod historical data service ( #3776 )
* Add fallback to previousClose in getQuotes()
* Update changelog
1 year ago
Shaunak Das
520c176cd6
Feature/add copy link to clipboard action to access table ( #3768 )
* Add copy link to clipboard action
* Update changelog
1 year ago
Thomas Kaul
df9a0ec35a
Feature/support bonds in import dividend dialog ( #3775 )
* Support bonds
* Update changelog
1 year ago
Thomas Kaul
d703088611
Feature/improve ux of toggle component ( #3769 )
* Improve usability via cursor styles
* Update changelog
1 year ago
Nikolai
38ac3d387b
Feature/extend market data endpoint by lastMarketPrice ( #3752 )
* Extend market data endpoint by lastMarketPrice
* Integrate last market price in admin market data
* Update changelog
---------
Co-authored-by: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
1 year ago
Thomas Kaul
fbf377f67f
Feature/set up rule settings dialog ( #3771 )
1 year ago
Thomas Kaul
3de192c65e
Feature/expose thresholds in rule settings ( #3770 )
1 year ago
Thomas Kaul
9fb80e5067
Feature/remove accounts from holding endpoint ( #3765 )
* Clean up accounts
1 year ago
Shaunak Das
323cfbfcaa
Feature/introduce filters in account endpoint ( #3764 )
* Introduce filters in acount endpoint
* Integrate endpoint in holding detail dialog
* Update changelog
---------
Co-authored-by: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
1 year ago
Thomas Kaul
0ef2b82852
Bugfix/fix destructuring in activities filters ( #3756 )
* Provide default value during destructuring
* Update changelog
1 year ago
Thomas Kaul
403ee2741d
Feature/set up portfolio snapshot queue ( #3725 )
* Set up portfolio snapshot queue
* Update changelog
1 year ago
Shaunak Das
383a02519a
Feature/extend filters of order endpoint ( #3743 )
* Extend filters of order endpoint
* Update changelog
---------
Co-authored-by: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
1 year ago
FrozenPasta
9edffd100e
Feature/improve language localization for fr ( #3724 )
* Update translations
* Update changelog
1 year ago
Thomas Kaul
6db881b08f
Feature/optimize admin control panel endpoint using promise.all ( #3741 )
* Optimize by using Promise.all()
* Update changelog
1 year ago
Thomas Kaul
557a0bf808
Feature/optimize info endpoint using promise.all ( #3742 )
* Optimize by using Promise.all()
* Update changelog
1 year ago
Andrea
bdb3a8f1dc
Feature/improve language localization for Italian ( #3744 )
* Update translations
* Update changelog
1 year ago
Thomas Kaul
9cd4321bd0
Feature/extract users from admin control panel endpoint to dedicated endpoint ( #3740 )
* Introduce GET api/v1/admin/user endpoint
* Update changelog
1 year ago
Shaunak Das
1bc2b47452
Feature/setup skeleton loader for data tables ( #3735 )
* Setup skeleton loader for data tables
* Update changelog
1 year ago
Thomas Kaul
8c322b4e81
Bugfix/fix historical market data gathering in yahoo finance service ( #3737 )
* Switch from historical() to chart()
* Update changelog
1 year ago
Thomas Kaul
1204240ed0
Bugfix/fix exception in admin market data detail component ( #3731 )
* Add check for dateOfFirstActivity
* Update changelog
1 year ago
Thomas Kaul
df5e2f5f0e
Feature/extract common CACHE_TTL as constants ( #3722 )
Extract CACHE_TTL
* CACHE_TTL_NO_CACHE
* CACHE_TTL_INFINITE
1 year ago
Thomas Kaul
fb44933c9c
Feature/improve error logs in scraper configuration test ( #3730 )
* Improve error logs
* Update changelog
1 year ago
Shaunak Das
7ea9061852
Feature/execute scraper configuration instantly ( #3723 )
* Execute scraper configuration instantly
* Update changelog
---------
Co-authored-by: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
1 year ago
Daniel Idem
8018236942
Bugfix/fix carousel component ( #3709 )
* Fix carousel component
* Update changelog
1 year ago
Thomas Kaul
c48e4ec4c6
Feature/improve usage of portfolio calculator in holding endpoint ( #3727 )
* Improve usage of portfolio calculator
1 year ago
Thomas Kaul
a6d9f5dd69
Bugfix/load data once on portfolio activities page ( #3726 )
* Fetch activities only once
* Update changelog
1 year ago
Thomas Kaul
8fab73f122
Feature/update OSS friends ( #3718 )
1 year ago
Thomas Kaul
adcddae44e
Encode redis password ( #3720 )
1 year ago