Skip to content

Create PDF by streaming data #310

Answered by gettalong
loust333 asked this question in Q&A
Jun 28, 2024 · 1 comments · 13 replies
Discussion options

You must be logged in to vote

I just added the needed require statements and changed #present? and #second to their plain Ruby counterparts. That made the script run-able without Rails, giving your results. Then I commented out the Benchmark.measure lines (56/57 plus their respective end lines).

I haven't looked at 'benchmark-memory' but in my experience all memory measurement tools have some overhead, especially when many objects are involved as in this case. The difference in memory usage on the medium difficulty level was ~200MiB without Benchmark.memory and ~1400MiB with it.

Replies: 1 comment 13 replies

Comment options

You must be logged in to vote
13 replies
@gettalong
Comment options

@gettalong
Comment options

@loust333
Comment options

@gettalong
Comment options

Answer selected by loust333
@loust333
Comment options

@loust333
Comment options

@gettalong
Comment options

@loust333
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants