Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Measure performance of tebako packages against plain Ruby scripts #1

Closed
maxirmx opened this issue Feb 15, 2022 · 17 comments
Closed

Measure performance of tebako packages against plain Ruby scripts #1

maxirmx opened this issue Feb 15, 2022 · 17 comments
Assignees
Labels
enhancement New feature or request

Comments

@maxirmx
Copy link
Member

maxirmx commented Feb 15, 2022

Tebako benchmarking
Tebako needs benchmarking environment that can be run against the ruby-packer and ocra
compute time (tebako architecture vs ruby-packer)
read/write time (due to DwarFS instead of SqashFS)

and although to support improvements like tamatebako/tebako#74

Originally posted by @maxirmx in tamatebako/tebako#45 (comment)

@ronaldtse ronaldtse added the enhancement New feature or request label Jan 10, 2023
@ronaldtse
Copy link

ronaldtse commented Jan 10, 2023

@ronaldtse ronaldtse changed the title Tebako benchmarking Create environment for tebako benchmarks Jan 10, 2023
@maxirmx
Copy link
Member Author

maxirmx commented Oct 30, 2023

We would like to run benchmarking for three configurations:

  • Simple gem without native extensions ** fontist ??? or one of its components**
  • Simple gem with native extension emf2svg
  • Complex application metanorma

For each configuration we will compare timing of loacally installed gem on Ubuntu, MacOs and Windows against tebako/aibika package.

@ronaldtse
Copy link

Simple gem without native extensions

fontist uses the excavate gem which uses a lot of native extensions.

coradoc is in pure Ruby and has good specs.

Let's use coradoc?

Simple but slightly more complex gem that depends on native extensions

vectory uses the emf2svg gem so it uses "some" native extensions, maybe it is a good candidate for "in between "simple gem with native extension" and "complex application".

@maxirmx maxirmx transferred this issue from tamatebako/tebako Nov 12, 2023
@maxirmx
Copy link
Member Author

maxirmx commented Nov 12, 2023

Revised plan

@maxirmx maxirmx self-assigned this Nov 12, 2023
@maxirmx maxirmx changed the title Create environment for tebako benchmarks Tebako benchmarking: measure performance of tebako packages against plain Ruby scripts Nov 15, 2023
@maxirmx maxirmx changed the title Tebako benchmarking: measure performance of tebako packages against plain Ruby scripts Measure performance of tebako packages against plain Ruby scripts Nov 15, 2023
@maxirmx
Copy link
Member Author

maxirmx commented Nov 15, 2023

Vectory gem has not been released to rubygems. There is version 0.1.0 only and it does nothing.
It can be installed from git source of course but I found that tebako does not support such gems: tamatebako/tebako#119
So I will test against emf2svg for now

@ronaldtse
Copy link

Ping @alexeymorozov to release vectory.

@alexeymorozov
Copy link

vectory is released (v0.2.0). Thanks to @CAMOBAP!

@ronaldtse
Copy link

Thanks @maxirmx @alexeymorozov and @CAMOBAP !

@maxirmx
Copy link
Member Author

maxirmx commented Nov 22, 2023

Hi, @ronaldtse @CAMOBAP

Any comments are much appreciated: Benchmarking results

@CAMOBAP
Copy link

CAMOBAP commented Nov 22, 2023

@maxirmx just to to be on the same page (and make sure that I got the result's right) even with "decompression" tamatebako perform really well, right?

How do you think it it make sense to benchmark on windows/linux too?

P.S. If need I can help with benchmarking on darwin-x86_64

@ronaldtse
Copy link

How do you think it it make sense to benchmark on windows/linux too?

Definitely the next step!

Thank you @maxirmx on the awesome results!

Can you please help write a blog post on these benchmark results?

@ronaldtse
Copy link

One of the things we wish to do is to avoid writing to/reading from the FS for native extensions, so that we can use libdwarfs in memory...

@maxirmx
Copy link
Member Author

maxirmx commented Nov 23, 2023

@maxirmx just to to be on the same page (and make sure that I got the result's right) even with "decompression" tamatebako perform really well, right?

How do you think it it make sense to benchmark on windows/linux too?

P.S. If need I can help with benchmarking on darwin-x86_64

Well, I read these results in a following way:

  • Tebako package parses Ruby code faster then native interpreter. I think that reading from memory / decompressing is faster then reading from disk, even from SSD
  • External file processing is not noticebly slower for Tebako package despite of additional abstraction layer introduced by Tebako
  • Tebako package initialization adds a 'penalty' time needed to read a fairly big file that conatains Ruby standard lib. The application not necessarily uses the whole library but we still need to map it to application memory address space on startup.
  • Any native extension or other native code like Java jars in tebako add initialization time because we are decompressing them to temp and loading again

@ronaldtse, I will do a blog post out of these thoughts,

We do not have Tebako Windows version. I tried twice with Msys but coud not resolve linking issues. I am going to try native (Microsoft). If it works I will do benchmarking. Testing Aibika (Ocra) does not make sense imho. On the client side it is just a self extracting archieve.

I have darwin-x86_64 box, thank you for an idea, I will run benchmarking on it as well.
I do not have Linux box will do tests on Windows Subsystem for Linux

@CAMOBAP
Copy link

CAMOBAP commented Nov 23, 2023

@maxirmx maybe you also can share/add some information about tools and environment preparation?

I never do such benchmarking myself and have some abstract understanding that we need isolate process somehow (reduce effect of other processes) and reduce impact of memory cache somehow

@maxirmx
Copy link
Member Author

maxirmx commented Nov 23, 2023

I believe that for metanorma the following statement is true:
Processing with tebako package will take the same time as original code plus 3-4 seconds

@maxirmx
Copy link
Member Author

maxirmx commented Nov 23, 2023

@maxirmx maybe you also can share/add some information about tools and environment preparation?

I never do such benchmarking myself and have some abstract understanding that we need isolate process somehow (reduce effect of other processes) and reduce impact of memory cache somehow

OS kernel measures resources

On Unix-like sytems there is time utility that gives you 'true' time
Just add system time and user time

The trick is to call /usr/bin/time because bash has its own time command that provides different statistics

image

@maxirmx
Copy link
Member Author

maxirmx commented Nov 24, 2023

All credits related to excellent package performance go to @mhx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

4 participants