optimization

Website takes a long time to start after solution build

谁说我不能喝 提交于 2021-02-18 06:55:46
问题 In development, our Asp.Net 4 website takes a fairly lengthy time to start after the project libraries are built We do a fair amount of population of statics etc, but not enough to justify the length of time it takes the app to come up (probably 3-4 minutes) We aren't building the website, just the libraries, and batch != true in the compilation element in the .config file. I will try log some diagnostics, but any other pointers would be useful 回答1: You can also try the optimizeCompilations=

Fast(est) way to write a seqence of integer to global memory?

感情迁移 提交于 2021-02-17 19:20:09
问题 The task is very simple, writting a seqence of integer variable to memory: Original code: for (size_t i=0; i<1000*1000*1000; ++i) { data[i]=i; }; Parallelized code: size_t stepsize=len/N; #pragma omp parallel num_threads(N) { int threadIdx=omp_get_thread_num(); size_t istart=stepsize*threadIdx; size_t iend=threadIdx==N-1?len:istart+stepsize; #pragma simd for (size_t i=istart; i<iend; ++i) x[i]=i; }; The performance sucks, it takes 1.6 sec to writing 1G uint64 variables (which is equal to 5GB

Does rustc / cargo have a -march=native equivalent?

99封情书 提交于 2021-02-16 10:21:28
问题 I feel like binary portability isn't really a concern, and so something like -march=native may always be the default behavior. I can't find anything saying one way or the other though. 回答1: As mentioned in the comments, pass the -C target-cpu option to rustc: rustc -C target-cpu=native For more options: $ rustc -C help ... -C target-cpu=val -- select target processor (rustc --print target-cpus for details) ... See How to pass rustc flags to cargo? for more methods of passing the option. I

How can I speed up this For Each loop in VBA?

十年热恋 提交于 2021-02-15 06:46:37
问题 I have an Worksheet_Change macro that hides/unhides rows depending on the choice a user makes in a cell with a data validation list. The code takes a minute to run. It's looping over c.2000 rows. I'd like it to take closer to a few seconds so it becomes a useful user tool. Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) 'Exit the routine early if there is an error On Error GoTo EExit 'Manage Events Application.ScreenUpdating = False Application.DisplayAlerts = False

Keep only the 10 useful bits in 16-bit words

烂漫一生 提交于 2021-02-15 06:11:50
问题 I have _m256i vectors that contain 10-bit words inside 16-bit integers (so 16*16-bit containing only 16*10 useful bits). What is the best/fastest way to extract only those 10-bits and pack them to produce an output bitstream of 10-bit values? 回答1: Here’s my attempt. Have not benchmarked, but I think it should work pretty fast overall: not too many instructions, all of them have 1 cycle of latency on modern processors. Also the stores are efficient, 2 store instructions for 20 bytes of data.

Keep only the 10 useful bits in 16-bit words

半腔热情 提交于 2021-02-15 06:11:49
问题 I have _m256i vectors that contain 10-bit words inside 16-bit integers (so 16*16-bit containing only 16*10 useful bits). What is the best/fastest way to extract only those 10-bits and pack them to produce an output bitstream of 10-bit values? 回答1: Here’s my attempt. Have not benchmarked, but I think it should work pretty fast overall: not too many instructions, all of them have 1 cycle of latency on modern processors. Also the stores are efficient, 2 store instructions for 20 bytes of data.

Keep only the 10 useful bits in 16-bit words

六月ゝ 毕业季﹏ 提交于 2021-02-15 06:11:18
问题 I have _m256i vectors that contain 10-bit words inside 16-bit integers (so 16*16-bit containing only 16*10 useful bits). What is the best/fastest way to extract only those 10-bits and pack them to produce an output bitstream of 10-bit values? 回答1: Here’s my attempt. Have not benchmarked, but I think it should work pretty fast overall: not too many instructions, all of them have 1 cycle of latency on modern processors. Also the stores are efficient, 2 store instructions for 20 bytes of data.

CVC4 minimize/maximize model optimization

不想你离开。 提交于 2021-02-11 18:26:11
问题 Does CVC4 an option to maximize or minimize the result model for bitvectors as Z3 does? Thanks. 回答1: Unfortunately, CVC4 does not (yet) support optimization. For bitvectors, you can always do it yourself using multiple queries and binary search, but it's not built-in. 来源: https://stackoverflow.com/questions/37304885/cvc4-minimize-maximize-model-optimization

CVC4 minimize/maximize model optimization

北慕城南 提交于 2021-02-11 18:26:07
问题 Does CVC4 an option to maximize or minimize the result model for bitvectors as Z3 does? Thanks. 回答1: Unfortunately, CVC4 does not (yet) support optimization. For bitvectors, you can always do it yourself using multiple queries and binary search, but it's not built-in. 来源: https://stackoverflow.com/questions/37304885/cvc4-minimize-maximize-model-optimization

How to manually set Initial Solution in CVXPY using CPLEX solver

痴心易碎 提交于 2021-02-11 15:44:00
问题 I am trying to solver the Unit Commitment problem (MIQP problem) by modelling the problem in CVXPY and using the CPLEX solver. I have been successful in getting everything to work with CVXPY using CPLEX. However, this was for a small system. Now I would like to do the same with a much larger system. Side Note: I have successfully solved the MIQP problem in MATLAB using CPLEX. For larger system in MATLAB, I have used an initial solution from a MILP formulation of the problem and limited the