This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // answer to https://quant.stackexchange.com/q/55088/35 | |
| // compile with c++ pcap_udp.cpp -lpcap | |
| #include <iostream> | |
| #include <pcap/pcap.h> | |
| #include <netinet/if_ether.h> | |
| #include <netinet/ip.h> | |
| #include <netinet/udp.h> |
One of the performance difficulties from interpreting a vector language is the accumulated temporaries. Consider:
y = 7 * x + 13
There are two different vector arithmetic operations here; an eager evaluation will perform the multiplication and then the addition. We can visualize this using the assembly language from Empirical's Vector Virtual Machine: