Sponsored Content
Full Discussion: Weird timing results in C
Top Forums Programming Weird timing results in C Post 302352644 by jim mcnamara on Saturday 12th of September 2009 01:54:05 PM
Old 09-12-2009
With regard to static functions:
I assume this is because the C99 standard says little about implemention of static text other than scope changes -

In large single file programs with a lot of static functions mixed in with auto functions -
I've encounteered really obscure problems in gcc 3.1, cc on HP UX 11.1. For example an auto function not being executed at all. Sounds odd, but it is true. The same "inherited program design" also screwed up optimizations by forcing the complier to make decisions it was not expected to make - according the HP compiler team anyway.

Basically to resolve the problems I had to completely turn off optimzation, and declare all functions static to get correct results. Since a fixed makefile was a requirement for the entire app suite, this meant a big rewrite for several very large programs.

Your problem is nothing like that. It almost HAS to be cache-related Based on what you said about your hardware, if you were to chunk your 125MB of data into 21 ~6MB chunks, then iterate (1,2,3) over each subset chunk the problem would not be there. If it is cache related - and with no other observations to work on that would be my guess.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

scp timing out

having problems using scp in that during peak hours it appears to time out. anyone have similar experiences? any thoughts regarding a solution... (1 Reply)
Discussion started by: jph
1 Replies

2. Shell Programming and Scripting

Timing out a SSH

I need to make it so an autmated process which involves ssh, times out if ssh prompts for a password. Most of the time it shouldnt prompt for a password. But if it does i need it to time it out or get a status and stop the ssh and log that the ssh failed and move onto the next server. Is there any... (9 Replies)
Discussion started by: rcunn87
9 Replies

3. Programming

timing your functions

hi everyone. If you have a function created in your code and you want to find out how long it takes for it to run you can use a struct called gettimeofday(). so lets say we have a function like this int myfunction (int r) { /*some math calculations*/ return answer; } How do i set up... (3 Replies)
Discussion started by: bebop1111116
3 Replies

4. Programming

Help with __builtin_prefetch function and it's timing

Hello there, I just needed to know how to get the timing right when using the gcc __builtin_prefetch() function, that is, how many instructions before the actual utilization of the data should I make the prefetch call. I will be measuring the L1 cache hit rate with valgrind's cachegrind,... (3 Replies)
Discussion started by: Tavo
3 Replies

5. UNIX for Advanced & Expert Users

byte swapping 32-bit float and weird od results

I'm attempting to read a file that is composed of complex 32-bit floating point values on Solaris 10 that came from a 64-bit Red Hat computer. When I first tried reading the file, it looked like there was a byte-swapping problem and after running the od command on the file Solaris and Red Hat... (2 Replies)
Discussion started by: GoDonkeys
2 Replies

6. Shell Programming and Scripting

Can ctag and cscope support recording search results and displaying the history results ?

Hello , When using vim, can ctag and cscope support recording search results and displaying the history results ? Once I jump to one tag, I can use :tnext to jump to next tag, but how can I display the preview search result? (0 Replies)
Discussion started by: 915086731
0 Replies

7. Shell Programming and Scripting

Timing a script

i have a very big script i have that i'd like to add a timeout to. this script runs on a several remote host. i update this script with timeout clause and then copy it over to all the hosts on which it is currently on. basically, i want the timeout to make the script abort/exit if it's... (1 Reply)
Discussion started by: SkySmart
1 Replies

8. Shell Programming and Scripting

Timing the shell script

I have two shell scripts, one written with xargs for parallel processing (p1) and the other written in old school way (p3) . when I execute them, i get the below values. $ time ./p1 real 0m25.36s user 0m0.32s sys 0m0.80s $ time ./p3 real 0m23.25s user 0m6.20s sys ... (4 Replies)
Discussion started by: luhah
4 Replies

9. Red Hat

Hardware and system timing are different

-> We have 2 servers server1 and server2 server. ->server1 is master application and server2 is slave application server. ->output of server1 hardware and slave timing: # hwclock --show Thu 05 Jun 2014 05:34:08 PM SGT -0.465666 seconds # date Thu Jun 5 17:34:16 SGT 2014 # cd... (6 Replies)
Discussion started by: manjusharma128
6 Replies

10. UNIX for Beginners Questions & Answers

Weird 'find' results

Hello and thanks in advance for any help anyone can offer me I'm trying to learn the find command and thought I was understanding it... Apparently I was wrong. I was doing compound searches and I started getting weird results with the -size test. I was trying to do a search on a 1G file owned by... (14 Replies)
Discussion started by: bodisha
14 Replies
LUAC(1) 						      General Commands Manual							   LUAC(1)

NAME
luac - Lua compiler SYNOPSIS
luac [ options ] [ filenames ] DESCRIPTION
luac is the Lua compiler. It translates programs written in the Lua programming language into binary files that can be later loaded and executed. The main advantages of precompiling chunks are: faster loading, protecting source code from accidental user changes, and off-line syntax checking. Pre-compiling does not imply faster execution because in Lua chunks are always compiled into bytecodes before being executed. luac simply allows those bytecodes to be saved in a file for later execution. Pre-compiled chunks are not necessarily smaller than the corresponding source. The main goal in pre-compiling is faster loading. The binary files created by luac are portable only among architectures with the same word size and byte order. luac produces a single output file containing the bytecodes for all source files given. By default, the output file is named luac.out, but you can change this with the -o option. In the command line, you can mix text files containing Lua source and binary files containing precompiled chunks. This is useful to com- bine several precompiled chunks, even from different (but compatible) platforms, into a single precompiled chunk. You can use '-' to indicate the standard input as a source file and '--' to signal the end of options (that is, all remaining arguments will be treated as files even if they start with '-'). The internal format of the binary files produced by luac is likely to change when a new version of Lua is released. So, save the source files of all Lua programs that you precompile. OPTIONS
Options must be separate. -l produce a listing of the compiled bytecode for Lua's virtual machine. Listing bytecodes is useful to learn about Lua's virtual machine. If no files are given, then luac loads luac.out and lists its contents. -o file output to file, instead of the default luac.out. (You can use '-' for standard output, but not on platforms that open standard out- put in text mode.) The output file may be a source file because all files are loaded before the output file is written. Be careful not to overwrite precious files. -p load files but do not generate any output file. Used mainly for syntax checking and for testing precompiled chunks: corrupted files will probably generate errors when loaded. Lua always performs a thorough integrity test on precompiled chunks. Bytecode that passes this test is completely safe, in the sense that it will not break the interpreter. However, there is no guarantee that such code does anything sensible. (None can be given, because the halting problem is unsolvable.) If no files are given, then luac loads luac.out and tests its contents. No messages are displayed if the file passes the integrity test. -s strip debug information before writing the output file. This saves some space in very large chunks, but if errors occur when run- ning a stripped chunk, then the error messages may not contain the full information they usually do. For instance, line numbers and names of local variables are lost. -v show version information. FILES
luac.out default output file SEE ALSO
lua(1) http://www.lua.org/ DIAGNOSTICS
Error messages should be self explanatory. AUTHORS
L. H. de Figueiredo, R. Ierusalimschy and W. Celes $Date: 2006/01/06 16:03:34 $ LUAC(1)
All times are GMT -4. The time now is 10:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy