Using GetCurrentMethod In (supposedly) High-performance Code?

Sep 23, 2009

For logging purposes, some methods in our application include the following line:Dim Log As ILog = GetLog(Reflection.MethodBase.GetCurrentMethod().DeclaringType)I have what might be described as an irrational fear of reflection, which I try to keep in check. However, calls like this in methods that are executed potentially a hundred times a second concern me. I don't know as much as I should about reflection; but from looking briefly over the documentation, it looks to me like I could replace the following with:Dim Log As ILog = GetLog(Me.GetType())My question is three-fold:Does Me.GetType() actually return the same Type as GetCurrentMethod().DeclaringType? Does Me.GetType() actually do anything differently from GetCurrentMethod().DeclaringType, or is it doing the same thing under the hood?

View 3 Replies


ADVERTISEMENT

High-Performance TLS With .NET?

Sep 6, 2010

I'm working on a project that calls for high-performance networking with TLS encryption in VB.NET. The stock SSLStream sucks rotten eggs; its 'asynchronous' read/write operations aren't async at all, meaning that they'll operate parallel to each other and to the main thread but that it offers absolutely nothing that resembles async read/read and write/write, which means that reads are totally synchronous to each other and writes are too (only 1 read and only 1 write can be done at a time).

I've done a lot of reading on this failing and it seems like MS has no intention of ever fixing this.Hoping a whole lot not to have to write my own TLS implementation. I've tried the Mentalis open source SSL suite, which will NOT compile. I've tried SocketWrench tools which will not compile under VS 2010 (and whose documentation indicates it's in fact synchronous on its async threads too; can only do 1 async read and 1 async write at a time).

What I want/need is an SSL/TLS implementation that actually works with DotNET that actually allows me to do multiple asynch reads/writes over a TCP/IP transport stream. Anybody have any experience or recommendations on 3rd party toolkits or alternate methods of SSLStream I/O?

View 1 Replies

Creating Game & Struggling With High Score Code

May 7, 2012

I am creating a type of pacman game, I have entered the code for everything else, but I am struggling with the code for the high score,[code]

View 2 Replies

Passing MethodBase.GetCurrentMethod() To Another Function

Dec 9, 2011

This maybe academic but I'd like to be able to pass the MethodBase.GetCurrentMethod() to another function. That way I could split apart the different parameters in one place. What I'm currently doing is something like this...

Sub SomeSub()
Try
'Some code that does work for the app...

[Code].....

View 1 Replies

C# - Improving Code And UI Performance?

May 22, 2010

I am dealing with a situation that I need some help with here. I need to improve performance on functionality that records and updates UI with user selection info. What my code current does is

'This is called to update the Database each time the user 'makes a new selection on the UI

Private Sub OnFilterChanged(String newReviewValueToAdd)
AddRecentViewToDB(newReviewValueToAdd)
UpdateRecentViewsUI()
PageReviewGrid.Rebind()'Call Grid Rebind
End Sub

[Code]...

View 2 Replies

Best Code For Performance To Check If A .net Arraylist Have Two Or More Items With Same Value?

Mar 23, 2012

I don't want check if an item with a value exists in the arraylist,I want to know the best code for performance to get how many occurrences of the same item with the same value exists in an arraylist.

View 2 Replies

Code Handover Performance Metrics For Any Mobile?

May 26, 2009

I want to handover Mobile from one cell to other cell.for that i get the location of object and increment its location till it reaches the requred destination.Now i need to implement the latency rate, Elapsed.the time it started HO,successfull handover and handover failure rate.

View 1 Replies

VS 2010 Express Related To Performance With Too Much Text In Code

Apr 4, 2012

I want to test out a code line with about 50,000 characters over about 7 lines, but VB takes about 2-3 minute breaks for every line of code I change and it crashes every 1-5th try. I moved the code into a public shared sub in a new class, and closed the class tab, but still VB can't resist checking though the code all the time.Is there any way I can prevent VB from checking that class/code?

View 11 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

Timing Code - Measure The Performance Of Seven Sorting Algorithms In A Single VB 2008 Program

Sep 15, 2010

I'm trying to measure the performance of seven sorting algorithms in a single VB 2008 program. I've tried using a Timer componend, the Stopwatch, and DateTime.Ticks but nothing works. The following simple code produces a result of about 500 (milliseconds), which is correct, but when I change 500 to 1000, I get a ridiculous result like 0 or 8.

[Code]...

View 11 Replies

Calculate New High Score?

Apr 27, 2009

I need to calculate the high score and am having trouble storing a value that represents the previous high score, and the comparator funcion.

Public n_sErrorTitle As String = "Entry Error"
'Count the number of entered scores
Dim intCount As Integer

[code]....

View 3 Replies

Execution Time Too High?

Aug 15, 2011

PFB the code for a search button where when a user enters a text in the text box ,it takes the keyword compares it with an xls which has 1600 rows and 16 columns with keywords.If the keywords match, it has to full the 3rd column where the name is specified.Its running but its taking more than 20-25 mins for processing.I knw searching 1600 rows and 16 columns will take time but pls advice if i can make this process a lil faster.

[Code]...

View 13 Replies

Making A High Score?

Apr 1, 2010

how can i save a high score in toolstrip textbox or listbox?

View 7 Replies

Teach VB High School?

Jan 22, 2006

Where can I find some books that might be used at the High School level to teach students programming using Visual Basic from the ground up, assuming no knowledge of programming?

View 5 Replies

VS 2008 High And Low Levels

Dec 15, 2009

whats the difference with high and low level of programming

View 1 Replies

VS 2008 Progressbar Value Going To High

Jul 12, 2009

I made a game and i made a hp bar.So i made a Heal button but when the value is more then the Maximum value it crash.Any way to fix that? Like something to bypass that go go back to the Maximum Value?

View 7 Replies

.net - High Speed Circular Buffer?

Jun 8, 2012

I have been asked to improve the memory efficiency of an application that is used for high speed data acquisition. After running the VS memory profiler several times and scanning the projects for obvious issues I came to the following conclusion: despite using a fixed size circular buffer for storing acquired sample points, the RAM usage increases relative to the polling period. For example: polling data for one signal at 2 microseconds can use 5 times more memory (private bytes) than when running at 50 microseconds ... even though the buffer size is the same.

The circular buffer is an array of SamplePoint objects. Each of these objects contains an array of Shorts (16 bit) for corresponding data per signal and one date object (8 bytes) for the time stamp. For efficiency, the circular buffer is Redimmed only once every time it begins polling and filled with empty sample points which are then "assigned".

Also, it seems that when we stop and run the application it hogs even more memory each time as though the Redim is not releasing the previous array. My questions boil down to the following: What is most memory efficient way of implementing a circular buffer containing managed objects which have arrays?Also, how and why is memory usage increasing with a fixed size array with different polling speeds? Does the garbage collector not have time? Do local variables get disposed of IMMEDIATELY when a sub or function exits?These are some of the doubts and concerns that I would like to rule out before proceeding.

[Code]...

View 1 Replies

Create A High Scores Board?

Aug 20, 2011

I am trying to create a high scores board - currently i was experimenting with just typing a number into a textbox and having it automatically order the numbers (in labels) from largest to smallest however i cannot get them all to work. either just the first and second (label) works or the second and third display the same number or the second decreases in value even though it shouldn't[code]...

View 7 Replies

Find The High And Low Numbers From 5 Different Textboxes?

Oct 28, 2010

I have two functions to find the high and low numbers from 5 different textboxes. I want the high in one label (which I have) an the low in another. I cannot seem to get the low number to be anything other than 0. Here is the code:

[Code]...

View 6 Replies

High Speed Socket Communication In .NET?

Aug 9, 2009

I'm having some doubts on which communication protocol/platform would be better for my current development. The focus is on communication performance, and while reliability matters, I can handle a some packet loss. UDP sounds like the correct choice, but then the following question came up:

"What would be better, using a UDP socket directly in .NET, or using a UDP socket implemented in unmanaged C++ with a wrapper to .NET?"I'm quite sure that C++ is faster than .NET, and while the communication might be faster, I'm not sure if that performance improvement is not lost with all the C++-to-.NET wrapping?

Some info about the project I'll be using this on:

- The core of the project will be all made in VB.NET.

- There'll be a high packet sending/receiving volume (about 100-200/sec).

- There'll be many clients requesting data to the server.

- Network communication will be over a GB-LAN.

- Data is time sensitive, and some packet loss is accepted.

- Running on .NET 3.5.

View 3 Replies

Save A High Quality Jpeg?

Sep 2, 2011

I want to make a wallpaper changer because windows high compresses the the image so you see artifacts even if already use a jpeg or even a really high quality png or bmp.

I know what I need to do for all of it I just need to know how to save an image to a jpeg without it being compressed. I have tried using the encoderparamters and getcodecinfo aswell as setting the quality to 100 but I still get a really bad looking image in the end.

Is there a way where I can save an image to a jpeg without getting the crappy image quality like with visual basic?

View 7 Replies

Spikes Appear Using DrawEllipse When Pen Thickness Goes High

Oct 21, 2011

I have a graphics program and in it I use DrawEllipse plenty and when the pen thickness gets high like around 12 pixels or above you start to see these spikes. I'm using a PictureBox so double buffering is being used. Is there anything I can do to get rid of the "spikes". In the screenshot at top the pen thickness is at 19 and is 28 in the lower.

View 10 Replies

Storing High Scores Online

May 6, 2012

I'm working on a video game in VB .NET and I was wondering if there is any way to store its high scores online.If there is any way to do this, that would be great, but otherwise, I'd like to know what would be the best method of locally storing high scores on a single computer.

View 1 Replies

TCP Client In High Volume Application?

Jan 16, 2012

I have several services that use UDP messages to send out XML status information which is displayed in an application with a UDP listener. This works well. Some of our services are installed at a different site. The UDP messaging does not cross over the routers. Therefore, I wrote a TCP-UDP forwarder service that listens for the UDP messages at the remote site, then forwards them via TCP to a partner service in our local office. That partner service then re-sends the messages via UDP so we may monitor them.

My problem is that the method that sends the messages via TCP appears to be dropping a lot of the XML messages. When the service gets a UDP message, it enqueues it in a queue object for processing. The enqueue statement is enclosed in a synclock object. A separate thread dequeues the message using the same synclock object and sends it via TCP. Originally, I had the code written so that the TCP Send method instantiates the TCPClient, opens it, does a GetSteam, sends the message with a BinaryWriter, closes the writer, closes the stream, closes the client.

Next, I updated the code to declare the TCPClient at the module level. The send method checked to see if the TCPClient variable was nothing and, if it was nothing, instantiated it and connected it. If it was already instantiated, I just tried to re-use it. I close the TCPClient when the service runs the OnStop method. This way did not work. I get "The operation is not allowed on non-connected sockets." errors.

What is the best strategy for implementing a TCP sender that works in a high volume environment. I only have four services sending UDP messages that need to be forwarded at this time. I eventually will have many more.

View 4 Replies

Transfer High Files From 1 Pc To Other Using LAN / Internet?

Jun 16, 2012

I am trying to make file transfer program in vb.net 2008 for big files eg. 10 GB.i was able to code simple socket program to transfer files with small size by using Sockets but if the file is large then "File.ReadAllBytes(ComboBox1.Text)" command will not work cause it use lot of memory & if the file is really big i.e. 10 GB it give not enough memory error, so i made a loop that sends data in small amounts, but this give me a larger file size with repeated data at end of the file.

[code]...

View 7 Replies

Windows Service Adn High CPU Usage?

Nov 2, 2010

I am working on a windows service and I am looking for a better solution to an issue with high CPU usage. The service needs to only 'run' every minute or two to gather some db data and do some light processing. Right now I have it running in a separate thread in the service application using the BackgroundWorker. In that thread, I do a Thread.Sleep(30000) after each db iteration. This has taken care of the CPU issue (obvious) but I am let thinking there is a better way. This works fine, I can still cancel the service without issue etc. however it feels wrong. Blocking that thread seems bad.

That being said, what is the best way to actually do this? I don't want the loop to just constantly run, I only want it to do work on a somewhat regular time frame. Would running this in a timer_elapsed event handler be a better way?

View 1 Replies

Bitmap - How To Create High Quality Icons

May 13, 2012

I need to create high quality icons for my current project in vb.net

This is my code so far,

Private Sub CreateIcon(ByVal bitmapName As String)
Try
Dim fi As New System.IO.FileInfo(bitmapName)

[Code].....

But the problem is it only gives me a very low quality icon at the end. how to make a higher quality image?

View 1 Replies

Game Programming :: Sorting High Scores?

Sep 10, 2009

I am Writing a Program in Visual Basic 2008 for my High Schools Advanced Higher Coursework Project... The Game its self runs perfectly and i can display the highscores. i just need some help showing 10 hi-scorers and in ascending order.Currently i am using this code for viewing them.

Code:
Private Sub HiScores_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim TmpHiScore As String 'Temporarly stores the data in file "HiScores.lol".
Dim intTempo As Integer = 1 'Stores the length of variable TmpHiScore.

[code]....

The hiscores them selfs are stored in a personalised text document and they are all on the one line. the format of this is NAME:SCORE,NAME:SCORE,NAME:SCORE and so on!

View 3 Replies

Low Priority Process Not Idle Although CPU Load Is High?

Mar 9, 2011

I have a small problem with process priorities (Win Server 2003 Standard, 8 Core, 16GB RAM). My VB.NET 2005 program starts a process like this:

Dim WithEvents proc As New Process
Sub Main()
proc.StartInfo.FileName = "blastx.exe"[code].....

In this case, blastx.exe runs on 4 cores.I would expect that my started process is idle and has 0% CPU usage while the system is under full load (I simulate this with prime95, 8 worker threads) and only runs if there are free resources. But it generates 25% cpu load and prime95 only 75% instead of expected 0%/100%. In the task manager, I can see that my process has the lowest priority and prime95 has the normal priority.

View 1 Replies

Make High Graphical Application Smooth?

Jun 22, 2010

I have used flash(.swf) animation & high quality graphical image there in my vb.net application. But problem is that sometimes when I click on menu it shows small line under it & take time to load it. It shows line under menu when load another forms though there is no line under that menu. I have 25 forms & every form has high quality image(image size is 1280*1024). Is there any way to get rid of this problem? Is there any way to make my application smooth though its high graphical & animated?

View 1 Replies







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