26

Re: Virtual method + Exceptions in A C ++

semen.s.semen wrote:

....
And most likely the necessary methods in the fullness of time become not virtual

It as so?
There was virtual.... Time...... And already not virtual?
It in an adjacent topic the word virtual is considered. Give will not be anew?

27

Re: Virtual method + Exceptions in A C ++

Leonid Kudryavtsev wrote:

it is passed...
It as so?
There was virtual.... Time...... And already not virtual?
It in an adjacent topic the word virtual is considered. Give will not be anew?

Yes there was virtual and suddenly women and became not virtual

28

Re: Virtual method + Exceptions in A C ++

Basil A. Sidorov wrote:

P.S.
You truth think, what developers JVM it is such suckers who couples s for any hogwash stir up?

In Java and C# the heap of checks - on type, on storage is fastened... It too an additional overhead charge.

29

Re: Virtual method + Exceptions in A C ++

Leonid Kudryavtsev wrote:

There was virtual.... Time...... And already not virtual?

... And already built in.
One of the elementary, though, certainly, not always possible  JIT.

30

Re: Virtual method + Exceptions in A C ++

rdb_dev wrote:

it is passed...
In Java and C# the heap of checks - on type, on storage is fastened... It too an additional overhead charge.

JIT all unnecessary disconnects
There only one harm - GC

31

Re: Virtual method + Exceptions in A C ++

semen.s.semen wrote:

yes who would argue
And not virtual are?

C# Language Specification 5.0 , paragraph 1.6.6.3 (Static and instance methods).

32

Re: Virtual method + Exceptions in A C ++

semen.s.semen wrote:

....
JIT all unnecessary disconnects
...

Earlier in Russia for the tsar  hoped. The tsar the father commands - and all becomes good
Now on JIT. Similar the tsar-batjushka is not quoted any more ((((

Basil A. Sidorov wrote:

it is passed...
... And already built in.
One of the elementary, though, certainly, not always possible  JIT.

What virtual to make normal, it is necessary to know 100 % object type. .. Here is faster "not always possible". It is possible only for recently created copies of objects in the same area of visibility More likely. IMHO
P.S.
sql.ru  in a sport lotto. We wait, when at last there will be a subject about the Bermudas triangle

33

Re: Virtual method + Exceptions in A C ++

rdb_dev wrote:

a heap of checks - on type, on storage... It too an additional overhead charge.

I beg you - dig in  and do not climb there, where you not . Well here at all .
P.S.
Certainly, the suckers developing any hogwash live in caves, at candles...
They do not know light of the true spilling from pages of a forum...

34

Re: Virtual method + Exceptions in A C ++

rdb_dev wrote:

it is passed...
So it also will be a C ++. In structures on Si methods you will not declare.

So there above about With instead of With ++))

35

Re: Virtual method + Exceptions in A C ++

About exceptions I will fairly confess what not in course whence brakes because of them (educate to whom not laziness), and about the virtual methods already wrote, I will repeat, to read the address of passage and to pass to this address it is the elementary operation, almost free, i.e. productivity does not affect almost.
Another matter that instead of a call of not virtual method its code  in a call place, here - yes, advantages more, is not required the push/priest of registers in the stack. But also it not panacea if the caused code contains more  than "return...".
now principal brakes because of multi-threaded access to the general data, as consequence synchronization of caches of kernels  etc., is the big brakes than the above described problems.

36

Re: Virtual method + Exceptions in A C ++

Dima T wrote:

About exceptions I will fairly confess what not in course whence brakes because of them (educate to whom not
Laziness)

https://stackoverflow.com/questions/156 … arf-vs-seh
https://gcc.gnu.org/wiki/WindowsGCCImprovements

37

Re: Virtual method + Exceptions in A C ++

semen.s.semen wrote:

... "In  the project do not use...

In  the project at first do the correct logic, on demanded from the task and a deal language. And is then profiled and removed (read correspond) those places which are critical up the time of performance.
If initially to begin with rigid postulates it is possible not to make out (behind wood of postulates) about more harmonous logic or to solve not that task, with asinine obstinacy.
For example there is a recommendation about development of cycles. I hope you do not start to program with  a loop body specified kol-in time??? smile))
(Round)

38

Re: Virtual method + Exceptions in A C ++

In Google on a row of projects strictly it is required  exceptions and to leave from the virtual methods

39

Re: Virtual method + Exceptions in A C ++

semen.s.semen wrote:

... On a row of projects...

Keywords...
I.e. FROM the TASK. Completely with it it agree... At first the task, all remaining - is secondary...
In due time communicated with children on trading platforms - they there refused objects of synchronization, at a certain interconnection architecture.
The head allowed to think, instead of it is stupid  a forehead on demand...
The architecture is primary. Optimization is secondary.
(Round)

40

Re: Virtual method + Exceptions in A C ++

semen.s.semen wrote:

In Google on a row of projects strictly it is required  exceptions and to leave from
The virtual methods

If in  Go the virtual methods and exceptions is intolerable brake... It
Google problem.

41

Re: Virtual method + Exceptions in A C ++

semen.s.semen wrote:

There there are not virtual methods?

Is not present

semen.s.semen wrote:

It was a question about ultra low latency projects with struggle for  and even nanoseconds
These are two factors (the virtual methods and exceptions) without which basically it is possible to manage and which import an overhead projector to productivity

Let's understand. In the assembler it is possible to see that not the virtual call it is simple a call, and the virtual call is one calculation of offset, and then a call. I.e. differs on pair instructions. If speech about picoseconds, then yes, differently  as to me it is thought.
With exceptions it is more difficult, in a point try addresses of outputs are remembered, and in case of an exceptional situation, passages simply there become. Well and there still should  be called (well they will anyway be called), therefore too an overhead projector there I do not see.

42

Re: Virtual method + Exceptions in A C ++

semen.s.semen wrote:

Rushed...
Oh in vain I created this subject)

Just

43

Re: Virtual method + Exceptions in A C ++

rdb_dev wrote:

it is passed...
I do not remember. The last time communicated with Java about 10 years ago.

No, there not virtual methods are not present.

44

Re: Virtual method + Exceptions in A C ++

Dima T wrote:

About exceptions I will fairly confess what not in course whence because of them (educate to whom not laziness)

I read brakes at Mejersa.
If briefly in pluses, the object created on a stack, exists only in the field of () visibility, and for object destruction answers , automatically caused by the compiler "on a closing parenthesis".
The exception "tears" a stack, "abandoning" many areas of visibility, the code, organizing calls  therefore is necessary.
Besides, for support of operation with object in the catch-block, the object should be copied that too does not reduce code amount and execution time.
Because of copying restrictions in this case Mejers recommends to intercept always an exception on an object reference.
P.S.
In Java where the garbage collector is engaged in clearing of storage of objects, problems are not present this.
The object "was lost" because on it there is no (acyclic) link? The garbage collector will be tidied up. In due course.
But, for the same reason, it is impossible to organize implicit clearing of resources in  which there is no also all cleaning becomes in explicit finally-blocks.

45

Re: Virtual method + Exceptions in A C ++

MasterZiv wrote:

Is not present, there not virtual methods are not present.

In Java, not virtual is any method with modifiers private or final. Simply on determination.
P.S.
If you do not know something about unfamiliar to you to the environment, it does not mean yet that "anything such" in this environment is not present.

46

Re: Virtual method + Exceptions in A C ++

Basil A. Sidorov wrote:

not virtual is any method with modifiers private or final

Static methods too not virtual.
Moreover, by a call . (), the method will be selected on declared, instead of on actual variable type.

47

Re: Virtual method + Exceptions in A C ++

Basil A. Sidorov wrote:

Because of copying restrictions in this case Mejers recommends to intercept always an exception on an object reference.

Well not because of same...

48

Re: Virtual method + Exceptions in A C ++

Basil A. Sidorov wrote:

In Java where the garbage collector is engaged in clearing of storage of objects, problems are not present this.
The object "was lost" because on it there is no (acyclic) link? The garbage collector will be tidied up. In due course.
But, for the same reason, it is impossible to organize implicit clearing of resources in  which there is no also all cleaning becomes in explicit finally-blocks.

THIS problem is not present. But there are OTHER problems.
Call of finally-blocks.
Necessity of garbage collection.

49

Re: Virtual method + Exceptions in A C ++

Basil A. Sidorov wrote:

it is passed...
In Java, not virtual is any method with modifiers private or final. Simply on determination.
P.S.
If you do not know something about unfamiliar to you to the environment, it does not mean yet that "anything such" in this environment is not present.

So I know.
There all methods virtual.

50

Re: Virtual method + Exceptions in A C ++

Chapter 6. The Java Virtual Machine Instruction Sets
https://docs.oracle.com/javase/specs/jv … vms-6.html
There is:
invokedynamic
invokeinterface
invokespecial
invokestatic
invokevirtual
If "all methods virtual", what for it is so much instructions?)))