Post a reply
Username:
Note:If not registered, provide any username. For more comfort, register here.
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) :( :o :shock: :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen:
Font size:
Font colour
Options:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation of post
To prevent automated posts the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.
Confirmation code:
Enter the code exactly as it appears. All letters are case insensitive, there is no zero.
   

Topic review - minimize overhead when returning objects from procedures
Author Message
  Post subject:  Re: minimize overhead when returning objects from procedures  Reply with quote
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.
Post Posted: Tue Oct 15, 2013 9:47 am
  Post subject:  Re: there are special rules for rings  Reply with quote
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
Post Posted: Mon Oct 14, 2013 3:40 pm
  Post subject:  Re: minimize overhead when returning objects from procedures  Reply with quote
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.
Post Posted: Fri Oct 11, 2013 11:32 am
  Post subject:  minimize overhead when returning objects from procedures  Reply with quote
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>
Post Posted: Thu Oct 10, 2013 12:35 pm


It is currently Tue Dec 12, 2017 4:44 am
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group