-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Performance decreasing after eval() calls #19013
Comments
This is expected you are creating more and more types. |
Can you explain? Thanks. |
each eval creates a new function and the compiler is optimized for the opposite case. |
Probably a duplicate of #18446 |
Is it possible to fix this somehow by changing my code or this is special |
Yes, #18446 looks very similar to me too. |
I would try to use closures instead of |
This example is simple, but in my code i use many ASTs, modify them in real time and recompile using |
@tmptrash I know this isn't a real fix for this issue, but I managed to implement a simple interpreter for ASTs for my own use-case, which is pretty fast and is stable in terms of memory usage (sub-linear memory growth per new "function", with growth decreasing over time). For initial compilation, it In the meantime, I'll be taking Jeff's suggestion and try to profile calls to |
Thanks for advice, but it's really huge peace of work for me :( It's simplier just to reset the app from time to time... |
Any updates regarding this issue? |
I'm afraid that this is not a high priority use case for the time being – we're trying to get the 0.6 release in good shape by end of month. Honestly, even in the pre-1.0 time frame it's hard to see this getting prioritized, which means that it will get investigated if someone really wants to do it... |
:( |
@tmptrash, I know this isn't the answer you want, but note that @StefanKarpinski's response isn't that Julia couldn't optimize for this use case: he's just noting that you yourself would probably need to do the work on the compiler to make this happen. I'm pretty confident that a full 100% of the Julia user base would appreciate having another person in the community dedicate themselves to becoming an expert compiler developer. |
Just so. This is a fairly niche use case – one that needs to be driven forward by someone who has need for it. That person could be you. |
I really want to contribute, but in real life i'm just a JavaScript developer :-D And It's hard for me to fix compiler's code :( I only found a workaround by reloading the process and continue with a backup... Anyway i'm waiting for a good news :) |
Master: julia> loop()
times: 100
times: 164
times: 162
ERROR (unhandled task failure): MethodError: no method matching (::##1887#1888)(::Task)
The applicable method may be too new: running in world age 22491, while current world is 22929.
Closest candidates are:
#1887(::Any) at REPL[45]:7 (method too new to be called from this world context.)
Stacktrace:
[1] born at ./REPL[44]:3 [inlined]
[2] (::##10#13{Task})() at ./REPL[45]:13 # hangs here, then ^C
|
OP example would need to be updated with an |
Closing as duplicate of #18446 |
I use tasks in my app and generate a lot of code with
eval
function. And I found that, every nexteval
call slows down application a little bit. Look at this code (and my comment also):Here is an output:
and 2 minutes later:
After few minutes of running,
times
will be equal to zero.So, can you guys explain me why eval() makes these delays?
Thanks.
The text was updated successfully, but these errors were encountered: