Last active
May 17, 2022 22:21
-
-
Save interregna/ad3ea2a33412c2daa4048020ecc007d1 to your computer and use it in GitHub Desktop.
comparison of boxed and unboxed memory usage in J
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gen =. {{ | |
nobox =: (40 + ? y # 30) { a. | |
box =: <"0 (40 + ? y # 30) { a. | |
'' | |
}} | |
relative_size =. {{ | |
gen y | |
%/ 7!:5 'box';'nobox' | |
}}"0 | |
load'plot' | |
plot_plot_ relative_size 100 * >: i.1000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
x-axis: count of characters / 100
y-axis: size in bytes of boxed vs unboxed