Selection Type Of Variables Speed Up The Code Execution?

Feb 15, 2012

"Does the selection type of variables speed up the code execution in VB.NET?"For example, I have two same exactly same projects where the first project is running with all Single variables and the other project which running with all Double variables.Is there any difference in term of the speed of code execution?This is because I'm working on a project which is very critical in term of the speed of execution. However, I'm using Double variables for most part of the code.

View 4 Replies


ADVERTISEMENT

Sql Server - SSRS Code Shared Variables And Simultaneous Report Execution?

Dec 28, 2009

I've found out that if two instances of an SSRS report run at the same time, any Code variables declared at the class level (not inside a function) can collide. I suspect this may be the cause of our report failures and I'm working up a potential fix.The reason we're using the Code portion of SSRS at all is for things like custom group and page header calculation. The code is called from expressions in TextBoxes and returns what the current label should be. The code needs to maintain state to remember what the last header value was in order return it when unknown or to store the new header value for reuse

View 11 Replies

C# - Does The Size Of The EXE Affect The Execution Speed

Apr 15, 2011

I'm going to create some command line tools that make use of some large library DLL's. For security reasons I plan to embed the DLL's in the command line's EXE. Example:Suppose the CL's (command line tool) functionality is to just copy a file from A to B. The procedure to do this is included in a 100MB library DLL. If I would just take out the lines of code from the DLL and paste them in the CL's code then the CL would only be 10Kb.But I don't want to do that, so I embed the full library in the CL's EXE, which will make it 101MB in size.I once read somewhere (cannot remember where) that Windows would only use the part of the EXE that's actually used. So if that's true then it shouldn't matter if the EXE size is 10Kb, 100MB or 1GB.I own the code of the DLL, so if the best solution is to not include the whole DLL but just only link to or include those code files, of the DLL project, that are used by the CL then I will go that way.will the 10Kb CL run faster and consume less memory than the 101MB CL?

View 2 Replies

Increase Speed Of Execution In .NET 2008?

Aug 10, 2009

i am trying to complete a project. My task is to read large TXT files (300 files, 2.2 GB in total) read the customers inside, perform some data calculation and write each customer data to a separate txt file.

I made a code in VB6, it runs fine, however it takes 8 days to run on a quadcore processor, utilizing 20-30% of the CPU. Now I upgraded the code and am running on VB.NET 2008, the latest version. The speed still remains the same, and the CPU usage is also about the same.

Anyway I can make this process faster. I have a quadcore PC with 8GB of ram, possible to maybe make VB utilize all the CPU say 100%? so it executes atleast 2 to 3 times faster.

[Code]...

View 15 Replies

VS 2008 : Slow Execution Speed During Windows Startup?

Mar 30, 2009

For some reason, .NET applications that I've written seem to have issues if they're launched when Windows starts (by being in the Startup folder for instance). An application that can finish in 3/10 of a second if one launches it normally may seriously take 45-90 seconds to finish if it was launched when Windows loads. Even if I just manually wait 30 seconds after login and launch the program, it'll complete virtually instantly while a copy launched at startup is still struggling along, so it isn't just that Windows is still loading...this continues AFTER that finishes and all HDD activity stops.Writing something to disk using an IO.anything goes at about 20KB/s during this event.

View 7 Replies

WCF Service Running A Background Thread To Speed Up Execution Time

Nov 14, 2011

I have a per-call WCF service that serves a number of clients. I'm looking to speed up the services by running some background processes so they don't block or slow down the main function of the services.

One example is that the main function needs to return a set of data, while the background thread needs to record some statistics based on the parameter(s).

Code:

Public Function GetAccountDetails(id As Integer) As AccountDetails
Dim retVal As New AccountDetails
Dim a As New Accounts

[Code]....

If I use this background thread to record the statistic it doesn't block the main thread from returning the data to the client.

It's been working well in test scenarios, but my question is, are there any dangers with leaving this thread to execute without Joining it before returning the data to the client? Could there potentially be any loss of statistic data? Could there be potential memory problems on the server side?

View 1 Replies

Any Way For A Class To Prevent Outside Code From Declaring Variables Of Its Type?

Jan 6, 2011

Is it possible for a class of exposing a type for function returns, without allowing users of that class to create variables of that type? A couple usage scenarios:A Fluent interface on a large class; a statement like "foo=bar.WithX(5).WithY(9).WithZ(19);" would be inefficient if it had to create three new instances of the class, but could be much more efficient if the WithX could create one instance, and the other statements could simply use it.A class may wish to support a statement like "foo[19].x = 9;" even when foo itself isn't an array, and does not hold the data in class instances that can be exposed to the public; one way to do that is to have foo[19] return a struct which holds a reference to 'foo' and the value '19', and has a member property 'x' which could call "foo.SetXValue(19, 9);" Such a struct could have a conversion operator to convert itself to the "apparent" type of foo[19].In both of these scenarios, storing the value returned by a method or property into a variable and then using it more than once would cause strange behavior. It would be desirable if the designer of the class exposing such methods or properties could ensure that callers wouldn't be able to use them more than once. Is there any practical way to accomplish that?In formulating a question, it's difficult sometimes to draw the line between complicated usage cases, and simpler usage cases which aren't quite so important. Here's another usage case, and one closer to the one I'd be most interested in (though I'm also interested in Fluent chaining; being able to have something behave like a C++ reference to a value type would be nice, but probably too much work to bother with).I have a type which is somewhat like the Windows registry, in that it is a hierarchical collection of items, each of which may have a string value, an integer value, and/or a nested collection of items. I wish to be able to support the following types of usage:[code]As for the Fluent interface, my thought would be to have the WithXXX properties return a new instance of a derived class which shadows (not overrides!) the WithXXX properties with versions that simply modify the current instance. The return object from WithXXX would be known to be of the derived class, and would thus use the shadowed WithXXX methods, but once it was assigned to a variable, it would be regarded as an instance of the base class, so the next WithXXX would create a new instance.

C++ a stronger concept of value types than C# or vb.net, including the very useful concept of references to value types; it ensures that references to value types cannot be persisted outside the scope of the type in question. Unsafe code in C# can use pointers to value types, but they don't have the protections offered by C++ references.

View 3 Replies

Variables Would Improve Script Execution Time?

Jun 20, 2012

I was updating an old .aspx.vb script that was originally written with dynamically typed variables, like this:

Dim price I updated them to the following format (along with some IsDBNull checks to compensate):

Dim price As String After doing this to all of my variables, the script appeared to run noticeably faster. Is this a real effect of static typing, or is it just a coincidence?

View 1 Replies

Size Of Compiled Code Into MSIL Necessarily Correlate To Code Speed?

Nov 24, 2010

I have been playing around with different types of native code operations in Visual Basic and then inspecting the code with Reflector to see what kind of MSIL is produced. For example, I wondered, in a one line If-Then-Else different than an If-Then-Else split onto multiple lines, ie.

[Code]...

View 3 Replies

Detect The RAM Speed And Type?

Apr 20, 2012

How do you detect the RAM speed and type?

E.g. DDR3, PC3 10600, 1333Mhz

I already know how to detect slots, total ram etc...

View 1 Replies

Retrieve Declared Type For Value Type Variables?

Sep 22, 2009

I have an object that I know was originally declared was an enum, but I need tothe specificnum type. I'm aware of the GetType method and it appears to work correctly, but I can't figure out how to go from there to a direct type comparison For reference types, you can use Typeof(object1) Is Class1, but this doesn't seem to work for value types.

View 3 Replies

End The Execution Of The Rest Of The Code?

Sep 2, 2009

i am getting an input from the user and i m checking in try catch statement. what i want to do is when the exception is caught i want to stop executing the rest of the code. my code is as below

Public Class AddForm
Private Sub Add_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Add.Click
Dim inc As Integer[code]......

View 4 Replies

Getting The Dynamic Code Execution?

Aug 23, 2010

i'm building a basic server program that I want to recieve commands and execute them sent from a client program and I'm using my home network to test it out. I've got no problem with the communication between the client and server programs and have used a simple Send Text function to communicate to the server program which simply brings up whatever text was sent in a message box.

I've decided that constantly updating the program and transferring the new EXE file just doesnt work as I have to keep starting and stopping the server program to do that just to update the list of commands it recieves. So say for example I've got a button on my client program that tells the server to open the cd-rom draw on that computer, it sends this in the form of simple text openCDdraw" and when the server recieves this, it pops open the cd draw and so on and so on... but I thought a better way of doing this may be to say have the commands listed in a SQL database and when the server recieves a message it searches through the database to find the correct command and executes the code associated with the command.

Now I can retrieve the information fine in to a string variable ("Dim a as string, a = dr.getvalue(3)") but where do I go for there? This is the problem see. My apologies if I've gone a bit long winded on this one but thought it necessary to explain what I'm doing. I've heard of dynamic code execution but when I tried a project I found on the internet it had been coded in C# and I don't know any C nor do I want to as I'm a VB veteran and have updated myself with the way of .NET now so am not going to start all over again with learning C. Does anyone know of an easier way of doing this? Static code is so easy to do because it is typed straight into the coding sections and I had already thought about creating loads of subs/functions to execute each command but again that involves updating the EXE file every time so there must be a better and easier way of doing it.

Can I also just point out that this little project i'm working on is not for a TROJAN or whatever that old NETBUS program used to be called, it is simply so I know how to do it and can use it for other things that I'm working on and through. Also I'd just like to know how to retrieve and execute code from a database or text file.

View 17 Replies

Completely Stop Code Execution?

Feb 6, 2012

How can I completely stop code execution?

Also, how can I hide a form and keep all information saved so I can bring it back up again?

For instance, I have form1 with "alpha" written in a textbox. Now when I hide form1 (Me.Hide), I would like to be able to bring form1 back with "alpha" still written in the textbox.

Currently, I hide it, and when I show it again, the textbox is empty.

View 10 Replies

Try Catch Not Stopping Execution Of Code?

Jul 6, 2011

I have been experiencing a problem with one of my Try Catch blocks. Specifically, I have a block of code that inserts data into a db using a stored procedure. There is a problem within the code getting one of the parameters to the SP. I know what the problem is and how to fix it. My issue is that the Try Catch should be stopping any further execution of code once it catches the error. I have verified that the error is being caught and that it sends the exception to my label used for error reprorting. However, instead of stopping future execution and displaying the error it rolls over the label assignment and continues to the next piece of code in the calling procedure. In essence, it is as if there is no error occuring at all.To give everyone a point of reference, I call a sub-routine from a button click event. Within the sub-routine I have my Try Catch block with the SP code. I am NOT using Try Catch Finally. It is simply Try the SP Catch ex as Exception and End Try.

View 2 Replies

Pause The Execution Of Code In An Event Handler?

Mar 9, 2009

how to pause the execution of code in an event handler.

For instance in a forms load event how can I have the rest of the programs features continue to run but wait 5 seconds before the code in the load event handler is executed?

View 3 Replies

String.equals() And Apostrophe - Execution Code ?

Oct 27, 2010

I just ran into what I consider a very strange issue in the execution of some code that I thought I had completely well-understood.

Basically, I was using this kind of notation:

If strOne.equals(strTwo) Then

rather than

If strOne = strTwo Then

I came from a c and java background, and using the '=' operator for comparison has always made me cringe, so I've used the .equals() comparison function thinking that it was equivalent. But just now some of my code broke. It encountered a string containing "Eagle's Nest: Dawn Patrol", used the .equals() to compare it to "Eagle's Nest: Dawn Patrol" and declared them not equal. I changed the code to use '=' rather than '.equals()' and it declared them equal. I also did this:

If strOne.Replace("'", "").Equals(strTwo.Replace("'", "")) Then

And again, it declared them equal.

This has me a little rattled because my code is filled with the use of .equals(), and I've used it assuming that it was no different than writing strOne = strTwo. I've scanned the interweb looking for information about this. I have not found any information about odd interactions between the apostrophe (or other) character(s) and .equals(). Microsoft's documentation does not hint at any subtle differences. how .equals() differs from '='

View 4 Replies

VS 2010 - Threading - Button To Stop Execution Of Code

Apr 22, 2011

I am working on an app and I am a bit confused w/ threading. I understand the point of threading but I am not getting when to use a background worker thread vs. a standard thread vs. a thread pool. Can someone shed some light on when to use which? Right now, I am trying code an app that does stuff initially in a sequential order and then eventually must thread (otherwise it takes forever). The problem I am having w/ the sequential stuff (and threading later) is that I need a button to be able to stop execution of code. [Code]

I did the background worker on this first sequential operation because when I tried w/ out it, the text box didn't update at all until the web page contents were retrieved. Basically, the text box change of "Starting." doesn't show up until the web page is finished processing even though the assignment to the text box happens before that code.

View 11 Replies

VS 2010 Stop Button Code Execution At Some Point?

Feb 26, 2012

Is there any way to stop the execution of the code that's under a button if for example a certain condition is met?

View 5 Replies

Get Code To Execute Up To US(microsecond) Speed?

Nov 16, 2009

im having a speed issue with a puzzle solution generator i am developing. its currently running fine.. but i would love to have it tick faster then 1 millisecond.is there any way i could get my code to execute up to uS(microsecond) speed? or even faster heh. i just need a continuous loop faster then a timer that can update the UI, or form?

View 7 Replies

VS 2010 - Calculation Download Speed With My Code

Nov 24, 2011

For some reason my code is a little buggy, and i really would like a speed calculator with my program.

'Download progress bar kode
Private Sub WC_DownloadProgressChanged(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs) Handles WC.DownloadProgressChanged

[CODE]...

View 14 Replies

Assigning Function Value Instead Of Using Return Keyword, And Its Effect On Synchronised Code Execution?

Apr 13, 2011

I am wondering if there is a difference between using

Public Function Foo() As Double
Return 3.0
End Function

[code].....

View 2 Replies

How To Enable Toggle Type Selection On DataGridView

Jan 15, 2010

I'm trying to enable toggle type selection on rows of a datagridview, i'm developing my project in Visual Basic .NET.

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
With DataGridView1
.Columns.Add("Column1", "Column1")
.Rows.Add(4)
[Code] .....

View 2 Replies

Image Converting - User Selection For Type

Feb 21, 2009

I an working on image converting program. I need to convert a file that the user selects in an openfiledialog to the following file types in a folder that the user selects:
.ICO
.PNG
.JPEG
.BMP
.GIF
The user will select which type they want to convert the image to.

View 5 Replies

VS 2010 Check Selection Is Image Type?

Dec 14, 2011

Is there any easy way to check if a selection made by a user from the browser is an image type and not any other file type. I could check for extension types i.e. bmp, jpg etc but what I would like to know is whether there is a generic term.

View 4 Replies

Check Internet Speed - Download A File Like 1mb Size, Then It Will Calculate The Speed?

Feb 21, 2012

How do i exactly check internet connection speed.I have searched around google and found out a method w/c will Download a file like 1mb size, then it will calculate the speed.

View 1 Replies

Check The Bandwidth (download Speed And Upload Speed) Of A User In .net Or Php?

Dec 31, 2010

how do i check the bandwidth (download speed and possible upload speed) of a user in vb.net or php that uses my app or visits my site resp?

View 1 Replies

VS 2010 Calculate DownLoad Speed And UpLoad Speed Kb/s And Graph

Nov 30, 2010

I have a codes that calculates DownLoad speed and UpLoad speed kb/s. I would like to implement this kind. I also want to put such kind of graph. Any article or links where can I start building my own like that.

View 2 Replies

Calculate Internet Download Speed And Upload Speed

Jul 29, 2009

i want to monitor the speed at which my system is currently Downloading and uploading. I dont have any idea how will it can be done.

View 6 Replies

VS 2008 Thread Performance - Processor Not Running On Full Speed With The First Code?

Mar 10, 2011

Not really asking for code, but I'm interested in knowing the basics of "thread performance".For example, you try to copy a bitmap in a pixel by pixel operation. (Is slow, but it is a nice example)

[code]...

This is, of course, very buggy and causes a lot of violation errors etc. But that doesn't matter right now. How come the multi-threading way is so much faster than the regular routine? Is the processor not running on full speed with the first code, and is it working harder on the second?I find it weird to see this type of "threading performance increase", as if every single thread gets their own piece of processor speed allocated like it is a new process

View 12 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved