TAILIEUCHUNG - HandBooks Professional Java-C-Scrip-SQL part 125

Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 125', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | I resolved to improve the speed of this conversion from 1300 microseconds 12 character string as much as was practical before proposing further hardware upgrades to the system. The first problem was to determine which operation was consuming the most CPU time. Examination of the code Figure disclosed that the toupper function was being called for every character in the string every time the character was being examined . This seemed an obvious place to start. First version of ascii_to_Radix40 routine from intro Figure codelist The purpose of writing the loop in this way was to avoid making changes to the input string after all it was an input variable. However a more efficient way to leave the input string unaltered was to make a copy of the input string and convert the copy to uppercase as indicated in Figure . This reduced the time to 650 microseconds 12 character string but I suspected that more savings were possible. Second version of ascii_to_Radix40 routine from intro Figure codelist Another possible area of improvement was to reduce the use of dynamic string allocation to get storage for the copy of the string to be converted to uppercase. In my application most of the strings would be less than 100 characters so I decided to allocate room for a string of 99 characters plus the required null at the end on the stack and to call the dynamic allocation routine only if the string was larger than that. However this change didn t affect the time significantly so I removed it. I couldn t see any obvious way to increase the speed of this routine further until I noticed that if the data had about the same number of occurrences of each character the loop to figure out the code for a single character would be executed an average of 20 times per character Could this be dispensed with Yes by allocating 256 bytes for a table of conversion Then I could index into the .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.