If XA knows the file size it is reading to the network in advance, it is a very clever trick to send the file size to the receiver XB as well. NOTE XB - RECEIVER MAKE MARK WRITING COPY M T COPY T F NOTE TEST EOM FROM `T` TJMP WRITING NOTE DELETE EOM FROM FILE SEEK -1 VOID F Sending „Packet Size“ Remember: If T is 0, it is evaluated to false – all other values will evaluate to true. The receiver XB now copies the message to T, from where it is written into the file and is also executable from TJMP or FJMP. This only works if you know for sure that the file you are reading from never contains the symbol 0, as XA will use this as its „End Of Message“ message ( EOM): NOTE XA - SENDER GRAB 199 MARK READING COPY F M TEST EOF FJMP READING NOTE EOF, SEND EOM COPY 0 M If you do not want to think about timing, the receiving XB can test for a marker which tells it that the end of the message has been reached. …with XB having to wait one operation less than before: NOTE XB - RECEIVER MAKE MARK WRITING COPY M F NOOP TEST MRD TJMP WRITINGīy a rule of thumb the number of instructions in your receiver loop after your last read from M and before doing TEST MRD has to be as many instructions as it takes the sender to reach its next write to M after its last write to M. If the job of XA is to just read its file and die afterwards, your programme could be written even more compact: NOTE XA - SENDER GRAB 199 MARK READING COPY F M JUMP READING NOTE CRASH AND BURN AT END OF FILE NOTE XB - RECEIVER MAKE MARK WRITING COPY M F NOOP NOOP TEST MRD TJMP WRITING One solution for timing issues is to add additional NOOP commands in your writing loop, telling your receiver to wait until the sender is back online. ![]() Before writing to M it needs to be empty, before reading from M the corresponding write operation has to be finished. Transfers via the M register are not instantaneous. This seems to be rather well designed, but most often ends up in XB never finishing its job because there is nothing waiting in M when TEST MRD is executed. …where XB reads from M and writes these messages to another file: NOTE XB - RECEIVER MAKE MARK WRITING COPY M F TEST MRD TJMP WRITINGĪs you can see, XA tests for the end of file ( EOF), while XB tests for receivable messages ( MRD). Exa XA reads from a file and sends them to the network register M… NOTE XA - SENDER GRAB 199 MARK READING COPY F M TEST EOF FJMP READING Timing problems can ruin the proper execution of your Axiom code.Ĭonsider these two Exas trading messages via the M register. Unrolling loops can be desirable for loops of a known length or an unknown but probably long length.Sending and receiving messages in Exapunks is a tricky business. you can do part A faster or part B faster but you have to pick one), think about which optimization would help more in the longest-running case. I think cycle count is based on the longest of your 100 test runs, so if a problem has tradeoffs (i.e. ![]() If work can be done separately, then maybe you can parallelize it! REPL and the M register are your friend. Identify parts of calculations or general processes that have to be done together, versus parts that can be done separately. Best example of this is Equity First Bank - you can shave a few cycles at the start by getting your EXAs where they need to be a little quicker, maybe, but when the problem takes a minimum of thousands of cycles to complete and most of that is spent in loops, you obviously can't make a serious dent in your cycles without focusing on making that loop wayyyy faster. Identify the portion of problems that occupies the most time and focus on optimizing that. Since these are general tips I won't spoil them, but a couple things I've figured out in general: Anyone want to spoiler a discussion on how they came to a good optimization with a particular mission? I find optimizing space/line count easier so I tend to focus on that, I get a bit lost trying to lower my cycles. I'd love some tips for optimizing cycle counts.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |