Back to Forum | View unanswered posts | View active topics
Topic review - minimize overhead when returning objects from procedures |
Author |
Message |
|
|
Post subject: |
Re: minimize overhead when returning objects from procedures |
|
|
special rules for ring/qring: - assignment does not copy - nameof(basering) is always a local variable name even if defined in another procedure - if there are several names for the current barering, removing nameof(basering) sets nameof(basering) to one of the others (so nameof(basering is always defind as long as there is any basering)
Jack wrote: If that is really so bad, could this be prevented by the language itself? No, it is like converting module to matrix and vice versa: quite useful and sometimes necessary but should not be done too often. Or like shooting yourself in the foot:: sometimes useful, one can still walk, but generally not recommended.
And: reference is an experimental feature: it can/will be removed/changed/renamed etc.
special rules for ring/qring: - assignment does not copy - nameof(basering) is always a local variable name even if defined in another procedure - if there are several names for the current barering, removing nameof(basering) sets nameof(basering) to one of the others (so nameof(basering is always defind as long as there is any basering)
Jack wrote: If that is really so bad, could this be prevented by the language itself? No, it is like converting module to matrix and vice versa: quite useful and sometimes necessary but should not be done too often. Or like shooting yourself in the foot:: sometimes useful, one can still walk, but generally not recommended.
And: reference is an experimental feature: it can/will be removed/changed/renamed etc.
|
|
|
|
Posted: Tue Oct 15, 2013 9:47 am |
|
|
|
|
|
Post subject: |
Re: there are special rules for rings |
|
|
hannes wrote: For ring/qring reference should not be used: there are special rules for rings which do not apply for references!
Could you step a little bit more into detail: which specials rules for rings do not apply when using references? If that is really so bad, could this be prevented by the language itself? Jack
[quote="hannes"] For ring/qring reference should not be used: there are special rules for rings which do not apply for references!
[/quote]
Could you step a little bit more into detail: which specials rules for rings do not apply when using references?
If that is really so bad, could this be prevented by the language itself?
Jack
|
|
|
|
Posted: Mon Oct 14, 2013 3:40 pm |
|
|
|
|
|
Post subject: |
Re: minimize overhead when returning objects from procedures |
|
|
For usual types: it depends. The time consuming operations are the same in nature and count (clean up the old content, move the new one to the destination) if return is compared to reference.
For ring/qring reference should not be used: there are special rules for rings which do not apply for references!
If you are looking for the fastest method with minimal memory foot print, the construction of the object as global one may be the best method but this has other negative aspects.
For usual types: it depends. The time consuming operations are the same in nature and count (clean up the old content, move the new one to the destination) if return is compared to reference.
For ring/qring reference should not be used: there are special rules for rings which do not apply for references!
If you are looking for the fastest method with minimal memory foot print, the construction of the object as global one may be the best method but this has other negative aspects.
|
|
|
|
Posted: Fri Oct 11, 2013 11:32 am |
|
|
|
|
|
Post subject: |
minimize overhead when returning objects from procedures |
|
|
What is a reasonable method in Singular ( less copying, less memory usage footprint ) to return rings and other objects from procedures if there are several calling levels
- use return() or - update a passed list reference parameter? or - < put your approach here>
What is a reasonable method in Singular ( less copying, less memory usage footprint ) to return rings and other objects from procedures if there are several calling levels
- use return() or - update a passed list reference parameter? or - < put your approach here>
|
|
|
|
Posted: Thu Oct 10, 2013 12:35 pm |
|
|
|
|
|
It is currently Fri May 13, 2022 10:58 am
|
|