Question: I have been trying to implement a form without using the form element but no success yet. I have two .php files, **file1.php** and **file2.php**

I tried to implement it using the **onclick** of a button in **file1.php**, but I can't seem to understand how it works:

```
    function submitData(){
    var http = new XMLHttpRequest();
    var url = "file2.php";
    var params = "lorem=ipsum&name=binny";
    http.open("POST", url, true);

    //Send the proper header information along with the request
    http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

    http.onreadystatechange = function() {//Call a function when the state changes.
        if(http.readyState == 4 && http.status == 200) {
            alert(http.responseText);
        }
    }
    http.send(params);
}

```

The function works well, upon the button click it returns the the whole text of **file2.php**. But this is not what I am trying to achieve. I want this button click to get me to **file2.php** and from there I can get the parameters and use them further. When I use the form eleement upon clicking the submit button it will get me to **file2.php** but the above code does not seem to do that. I know I am missing something very obvious here :/ ?

Answer: 
There is no noticeable performance impact when you call `doStuff`.

At runtime, the type of object you are calling `doStuff` on is known *for sure*. At compile time you'd need a giant switch statement because you don't know the type. CLR sees that you are trying to call `doStuff` on `Subclass0679`, goes into that class, and invokes the method. Simple as that. 

Think about it this way. `ToString()` is declared in `Object` and *all* classes inherit `Object`. When you call `ToString()` on something, is it really slow? No.
If you're asking this out of curiosity as a hypothetical question, then fair enough. 

However, if you're trying to prematurely optimise some code and this is the level of decisions you're making, I would highly recommend you concentrate on making your code work first and then use a profiler to identify hotspots as areas to optimise.

Also, super optimised code is usually far less readable and maintainable.

Unless your code is a game engine or perform some enormous calculation, then does it really need to be so optimised? If the code communicates with the outside world at all - network, disk, db etc - then that latency will completely dwarf any imperceptible difference in timing because of using inheritance.