How to show Forms in nodes stored in the node tables Mine is shared hosting account with limited CPU usage so I want to minimize CPU and mysql usage. 
I'm generating 100,000s of nodes which contain some information. I also want to add a form in those pages. Since these nodes will be stored in node table how can I generate form on the fly? I think using filters but that'll not use Drupal caching hence it'll affect the shared hosting CPU quota due to this performance issue.

I don't want to use _menu to generate those pages on the fly because 1) it will slow down my site 2) It'll be difficult to use Drupal Taxonomy to classify "these" generated pages on the fly. Generating pages from the node table will be faster and also cacheable.

Another way is to insert the Form code in the nodes at the time of generation with the option that it won't contain/verify dynamically generated tokens(eg without #token) but it'll be security risk for my site.

What is the best way to handle this case?
What do you mean "generate form on the fly"? As in: the form for page "page/form" doesn't exist in a canonical state but is generated based on variables such as date/url/taxonomy? Or is it just the default values for the form etc? 

In anyway: the options to have a form on a page are:


Hardcode HTML into the node content, e.g. &lt;form&gt;&lt;input&gt; etc
Use hook_menu to create the page and use the form API 
Use hook_menu to create the page and use the straight HTML
Use hook_nodeapi to add a form to the content with the Form API
Use hook_nodeapi to add a form to the content using HTML
Use a module such as webforms to add the forms


I would suggest either 2 or 4. When you say that hook_menu generates these plages "on teh fly": that's not true. hook_menu is only run on cache clear, and assuming you're using caching then the generation of forms isn't going to make much difference to your server. This may be a case where you're sweating about optimisation unnecessarily. 

Using Form API gives you a load of tools that you'd otherwise have to handle yourself - validation, submission, sanitising, standardising, etc.