Time for another Vienna Ruby Meetup! ๐
It's been three months since the last meetup. To make up for it, we got three wonderful talks covering a wide range of topics this time.
Thank you to Meister for hosting us!
Time for another Vienna Ruby Meetup! ๐
It's been three months since the last meetup. To make up for it, we got three wonderful talks covering a wide range of topics this time.
Thank you to Meister for hosting us!
Released #HexaPDF 1.4.1 with some fixes - see hexapdf.gettalong.org/documentatio...
You can't generally use an embedded font to add new content (because it usually misses parts in the font data structure; even if usable it might be missing characters).
Viewers work around this by loading the same font from the system paths.
With HexaPDF you need to specify the font yourself.
Yes!
But did you know that you can even parse arbitrary strings? ๐
Example: github.com/gettalong/he... (used for interleaving and handling file names and options).
Maybe bind ALT-C to a command that sends CTRL-C? Or do something like this: unix.stackexchange.com/questions/78...
* KDE lets you configure which short-cut switches between applications (ALT-Tab) and which between their windows (Alt-`).
* The built-in KDE krunner application is sufficient as launcher for my needs.
* Clipboard history just works in KDE.
* Vim GUI -> gvim
If you are using KDE, you should be able to just configure this system-wide for all KDE based apps.
Or just use BreakVer www.taoensso.com/break-versio... and break things like before ๐
So, I now have implemented a basic template system for VersaDok.
However, using ERB as preprocessor instead of the built-in template system is faster in most cases (even though the larger source doc needs to be parsed every time) because AST nodes need to be rendered many times more.
Thanks for the great meetup! And thanks to @hansschnedlitz.com for organizing it and doing the cool Ruby quiz!
And now the code is available at github.com/gettalong/ve...
It is not yet finished and not really polished etc. but already in a good state.
This will be the basis for still more easily creating PDF documents with HexaPDF ๐
Worked now! And just released the new version - see hexapdf.gettalong.org/documentatio...
Once rubygems.org sends me the password reset e-mail that I already requested a few times, I can release a new version of #HexaPDF
Array#[]=(e.g. ary[-10, 10] = EMPTY_ARRAY) won't create an additional array but is slower then Array#pop, so I'm staying with the latter.
Full benchmark info here gist.github.com/gettalong/b8...
Without YJIT on Ruby 3.4.1 Warming up -------------------------------------- kramdown 259.422 i/s - 270.000 times in 1.040775s (3.85ms/i) versadok 1.158k i/s - 1.265k times in 1.091970s (863.22ฮผs/i) Calculating ------------------------------------- kramdown 276.681 i/s - 778.000 times in 2.811901s (3.61ms/i) versadok 1.138k i/s - 3.475k times in 3.052762s (878.49ฮผs/i) Comparison: versadok: 1138.3 i/s kramdown: 276.7 i/s - 4.11x slower With YJIT on Ruby 3.4.1 Warming up -------------------------------------- kramdown 334.871 i/s - 336.000 times in 1.003372s (2.99ms/i) versadok 1.853k i/s - 1.969k times in 1.062396s (539.56ฮผs/i) Calculating ------------------------------------- kramdown 315.374 i/s - 1.004k times in 3.183520s (3.17ms/i) versadok 1.822k i/s - 5.560k times in 3.052272s (548.97ฮผs/i) Comparison: versadok: 1821.6 i/s kramdown: 315.4 i/s - 5.78x slower
So I have been working on something lately, lightweight markup related.
Turns out it's at least 4 times faster than kramdown when parsing the same document (n.b. a bit of an apple to banana comparison as kramdown can do much more at the moment but still ๐คฏ)
The benchmark YAML file for benchmark-driver
Warming up -------------------------------------- pop 5.802M i/s - 6.040M times in 1.041085s (172.36ns/i, 187clocks/i) slice! 4.235M i/s - 4.459M times in 1.052689s (236.11ns/i, 625clocks/i) []= 5.158M i/s - 5.168M times in 1.001836s (193.86ns/i, 211clocks/i) Calculating ------------------------------------- pop 5.946M i/s - 17.406M times in 2.927538s (168.19ns/i, 426clocks/i) slice! 4.100M i/s - 12.706M times in 3.098945s (243.90ns/i, 738clocks/i) []= 5.415M i/s - 15.475M times in 2.857926s (184.68ns/i, 808clocks/i) Comparison: pop: 5945557.8 i/s []=: 5414702.4 i/s - 1.10x slower slice!: 4100124.2 i/s - 1.45x slower
Ah, I forgot up that - thank you! You can further optimize it by using a constant empty array and doing `array[from, size] = EMPTY_ARRAY`.
I did a benchmark comparing pop, slice! and your method using benchmark-driver. Interestingly pop was faster even though it creates arrays.
So, Ruby friends, how do I remove count number of trailing elements from an array *without* creating a new result array?
There is Array#pop(count) but that creates an array I don't need or want ;-)
@itext.bsky.social Congrats on the release of 9.1! ๐
The table rendering speed-up is great! Is the source code for the benchmark available somewhere?
Image of 10 line annotations with different styles
Coming with the next release to #HexaPDF: Line annotation appearance generation. Other annotation types will follow.
Can also recommend weasyprint if you need HTML/CSS -> PDF.
If you want more quality and better conversion, a commercial solution based on PrincePDF is available via www.europdf.eu
And a heads up from me: There will be a markup-to-PDF pipeline for HexaPDF in the near future :-)
It seems that Ruby getting faster with each release is now the norm. As no one is pointing it out anymore ๐
New release of hexapdf-extras to make it compatible with HexaPDF 1.0.
The API docs now also have a visual example of a Swiss QR bill - hexapdf-extras.gettalong.org/api/HexaPDF/...
I use unary + for normal UTF-8 encoded strings and "literal".b for binary ones.
๐ T-24 hours until #AdventOfCode 2024! ๐
Yes, I also think so. When I wanted to formulate the versioning scheme for HexaPDF, I came across BreakVer ๐
Understood ๐
I also kept HexaPDF on 0.x versions for a long time (8 years) but decided to change it to 1.0 this October, now following BreakVer instead of SemVer.
What do you do in case of breaking changes? Just a highlighted entry in the changelog?
I have found that BreakVer (www.taoensso.com/break-versio...) is the versioning scheme I'm most comfortable with.
New version of kramdown released!
kramdown.gettalong.org/news.html
Initial post.