-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
Generate multiple functions with one instance of CodeGenerator #5
Comments
I'm sorry for slow response, I nothiced this issue today. At first, assign large maxSize to the constructor of CodeGenerator.
|
I avoided creating instances of CodeGenerator on the fly, just create some during program initialization, long initialization time isn't a problem in my case. The solution above might help, but not exactly what I want. Here is my problem: |
Though I can't guess the cost of penalty of instruction cache miss, I try to add reset() method to CodeGenerator to reuse the instance at develop branch. |
It's not just about performance. On ARM CPUs, self-modifying applications have to invalidate instruction cache deliberately. I'm not sure about Intel/AMD CPUs. When multi-core systems, multi-threaded applications, old CPU architectures and all other things come together, things may get nasty. |
Of couse, it is bad to modify the region of code where CPU is running. Intel optimization manual 3.6.9.1 Self-modifying code.
|
Any chance I would generate more than one functions with just one instance of CodeGenerator ?
I need to generate many functions on the fly, but I found the constructor of CodeGenerator has very significant overhead, and is unsuitable to be called repeated.
The text was updated successfully, but these errors were encountered: