Comments (7)
from hledger-vscode.
I'm not a coder, but I believe this is the code which the Atom add-on uses:
https://github.com/4ourbit/language-ledger/blob/master/lib/language-ledger.coffee#L46-L91
from hledger-vscode.
from hledger-vscode.
from hledger-vscode.
And as per @simonmichael, hledger check
(or perhaps hledger check parseable
) would be the fastest / most appropriate command for checking validity.
from hledger-vscode.
Looks like hledger-flycheck emacs plugin invokes "hledger check" on the shell: https://github.com/DamienCassou/flycheck-hledger/blob/master/flycheck-hledger.el#L63
Thanks for the pointers. Let's try some benchmarks on my shiny new M1 (which should be a bit faster than my other laptop):
$ hyperfine "hledger check" "hledger check parseable" "hledger bal" "hledger stats"
Benchmark #1: hledger check
Time (mean ± σ): 471.3 ms ± 5.1 ms [User: 438.8 ms, System: 26.9 ms]
Range (min … max): 465.7 ms … 477.8 ms 10 runs
Benchmark #2: hledger check parseable
Time (mean ± σ): 471.5 ms ± 6.0 ms [User: 439.8 ms, System: 26.4 ms]
Range (min … max): 465.1 ms … 480.2 ms 10 runs
Benchmark #3: hledger bal
Time (mean ± σ): 582.1 ms ± 6.0 ms [User: 545.0 ms, System: 30.8 ms]
Range (min … max): 575.4 ms … 593.4 ms 10 runs
Benchmark #4: hledger stats
Time (mean ± σ): 559.5 ms ± 4.8 ms [User: 527.9 ms, System: 26.1 ms]
Range (min … max): 555.9 ms … 568.2 ms 10 runs
Summary
'hledger check' ran
1.00 ± 0.02 times faster than 'hledger check parseable'
1.19 ± 0.02 times faster than 'hledger stats'
1.24 ± 0.02 times faster than 'hledger bal'
Looks like hledger check
and hledger check parseable
are about the same speed, both 19% faster than stats
and 24% faster than bal
.
Some stats about my journal:
$ hledger stats
...
Transactions span : 2008-05-19 to 2022-09-04 (5221 days)
Last transaction : 2022-09-03 (3 days ago)
Transactions : 15529 (3.0 per day)
...
Run time (throughput) : 0.57s (27471 txns/s)
I imagine it'd be near-instant if I split by year. I don't really want to split by year though.
Maybe to be quick, an extension could use hledger check
on the currently-edited individual file along with --ignore-assertions
, because none of my individual files balance correctly without other files. I was a bit surprised that check
and check parseable
apply the balance assertions (I would have guessed that's beyond the scope of parsing?).
from hledger-vscode.
from hledger-vscode.
Related Issues (14)
- Currency codes get highlighted in the middle of posting descriptions
- Tests failing after vscode-textmate update HOT 4
- Can't run tests: unable to compile typescript
- Timedot support HOT 1
- Unable to install on Arch Linux (needs to be published on Open VSX) HOT 3
- [Feature Request] Journal Prettifier HOT 5
- Syntax coloring for effective dates HOT 11
- Currency symbols don't get highlighted if not followed by a number HOT 4
- Syntax highlighting for "revenue" in addition to "income" HOT 1
- Hashtags in transaction descriptions are being highlighted as comments HOT 1
- Generalize account syntax HOT 20
- Consider using vscode-tmgrammar-test for tests
- Can't compile oniguruma dependency HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hledger-vscode.