ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 25 Apr 2024 18:58:48 +0200Is there a function in SageMath that gives the actual size of a variable not of a pointer to the variable? I used "getsizeof" function but the size it showed is very small comparing to the long of the equation is.https://ask.sagemath.org/question/77070/is-there-a-function-in-sagemath-that-gives-the-actual-size-of-a-variable-not-of-a-pointer-to-the-variable-i-used-getsizeof-function-but-the-size-it/ I used "get sizeof" function in order to provide me with the size of equations that are stored in the memory, but the size it provided is not reasonable comparing to the length of the equations.Wed, 24 Apr 2024 23:28:29 +0200https://ask.sagemath.org/question/77070/is-there-a-function-in-sagemath-that-gives-the-actual-size-of-a-variable-not-of-a-pointer-to-the-variable-i-used-getsizeof-function-but-the-size-it/Comment by Emmanuel Charpentier for <p>I used "get sizeof" function in order to provide me with the size of equations that are stored in the memory, but the size it provided is not reasonable comparing to the length of the equations.</p>
https://ask.sagemath.org/question/77070/is-there-a-function-in-sagemath-that-gives-the-actual-size-of-a-variable-not-of-a-pointer-to-the-variable-i-used-getsizeof-function-but-the-size-it/?comment=77084#post-id-77084FWIW, the same thng happens on Python.Thu, 25 Apr 2024 18:58:48 +0200https://ask.sagemath.org/question/77070/is-there-a-function-in-sagemath-that-gives-the-actual-size-of-a-variable-not-of-a-pointer-to-the-variable-i-used-getsizeof-function-but-the-size-it/?comment=77084#post-id-77084Comment by aqnora21 for <p>I used "get sizeof" function in order to provide me with the size of equations that are stored in the memory, but the size it provided is not reasonable comparing to the length of the equations.</p>
https://ask.sagemath.org/question/77070/is-there-a-function-in-sagemath-that-gives-the-actual-size-of-a-variable-not-of-a-pointer-to-the-variable-i-used-getsizeof-function-but-the-size-it/?comment=77080#post-id-77080.
# Measure and display the size of each function in P
for i, func in enumerate(P):
size_in_bytes = sys.getsizeof(func)
show(f"Size of P[{i}] (function for state {all_states[i]}): {size_in_bytes} bytes")
I am looking for alternative command of "getsizeof" as it is not measuring the actual size of my functions P. it gives all functions have same size 56 bytes which it can't be as there length are differentThu, 25 Apr 2024 13:06:51 +0200https://ask.sagemath.org/question/77070/is-there-a-function-in-sagemath-that-gives-the-actual-size-of-a-variable-not-of-a-pointer-to-the-variable-i-used-getsizeof-function-but-the-size-it/?comment=77080#post-id-77080Comment by Max Alekseyev for <p>I used "get sizeof" function in order to provide me with the size of equations that are stored in the memory, but the size it provided is not reasonable comparing to the length of the equations.</p>
https://ask.sagemath.org/question/77070/is-there-a-function-in-sagemath-that-gives-the-actual-size-of-a-variable-not-of-a-pointer-to-the-variable-i-used-getsizeof-function-but-the-size-it/?comment=77071#post-id-77071Please provide an actual code illustrating the question.Thu, 25 Apr 2024 01:55:36 +0200https://ask.sagemath.org/question/77070/is-there-a-function-in-sagemath-that-gives-the-actual-size-of-a-variable-not-of-a-pointer-to-the-variable-i-used-getsizeof-function-but-the-size-it/?comment=77071#post-id-77071