explain : The series of information system practice notes are the problems that the author has encountered in his research and development , Maybe simple and subtle , But it's often a problem . The author collects some typical ones , describe , Sum up and share .

Abstract : This paper describes the docking configuration and situation of some information systems or platforms , Let's share it with you .

Text

Catalogue of series essays : Information system practice notes  (http://www.cnblogs.com/taichu/p/5305603.html

author : Too early

Reprint note : Please indicate the original author , Connect , Source .

Text

In the author's practice , In some cases ( For example, development GIS Map application ), Client's JS Code often calls GIS Map engine API.

There are some API Provide JS Interface ( edition ), That's the most convenient , Some offer things like FLEX Programming interface API, Let you JS Call in , It can be , But we have the following situations , Share it .

Our client is based on GIS Map application , use JS Code calls FLEX Of API Interface , Need to pass through FLEX In the GIS On the map ( place )2 Ten thousand objects (Object).

Method A( Old method ):

  1. stay JS in , Get... Through the business layer 2 Information data of 10000 devices , Such as arrays DEV[20000];
  2. stay JS in , Package information data into hashmap(key -> value);
  3. stay JS in , take hashmap Data structure from JS Pass in Flex: JS --> Flex;
  4. stay Flex in , Get the incoming hashmap structure , And circularly displayed in GIS On the map ;
  5. stay Flex in , adopt hashmap Structure provides key check value Service for :val = devicehashmap.get(key);

Performance evaluation & analysis :

  1. Steps in 2,3,4 It takes 20 About seconds , The amount of data is 2 m device; The main step is 3 slower ;
  2. preliminary estimates ,JS It's made up of hashmap Structure takes time , But not much ; It's a pity that this high-level structure is very important to JS/Flex It's a burden , The necessary checks and conversions need to be done when passing in , So it's slower ;
  3. in addition , in consideration of JS/Flex The mutual call structure is more complex , If you pass a high-level structure , It is easy for the two systems to be inconsistent in parsing, which will cause extra overhead ;

( remarks : In fact, I've tried some methods A Variants , Is in the JS Here, start the cycle 2 Ten thousand times , Pass one device message at a time to Flex And in GIS The map shows Object, Although the amount of data is very small each time , But back and forth JS/Flex2 Ten thousand times , Less efficient , So I gave up , No more discussion here )

Method B( The new method ):

  1. stay JS in , Get... Through the business layer 2 Information data of 10000 devices , Such as arrays DEV[20000];
  2. stay JS in , Packaging information data into long strings String( With convention structure / similar JSON);
  3. stay JS in , take String from JS Pass in Flex: JS --> Flex;
  4. stay Flex in , Get in String, And the resolution is reduced to hashmap, And circularly displayed in GIS On the map ;
  5. stay Flex in , adopt hashmap Structure provides key check value Service for :val = devicehashmap.get(key);

Performance evaluation & analysis :

  1. Steps in 3 It takes 1 About seconds ( It's actually 500ms about ), The amount of data is 2 m device;
  2. preliminary estimates , Classic data structure String, It's interoperable in most systems , And get the simplest support and parsing ( For example, most of them are bytes Byte array , The last one is the mark , Or have a little elegant head structure and so on ), So deliver String It greatly reduces the time cost . And yes JS Side , Splicing String It's better than assembly hashmap Faster ; stay Flex Side , Self analysis String Assemble your own haspmap( It's not understanding JS Of hashmap structure ) Very soon .
  3. Overall, the steps 1 To 5 Consumed in 1 About seconds , Meet the requirements ;

( remarks : I'm actually trying a few other GIS When the engine , We use JS/API Interface , I haven't met the above problems , This is actually very important for technology selection .)

summary :

  1. A lot of times , We develop a system , Realized A and B Call and operate each other , It's just an achievement . More often, the actual application scenario must have data pressure and performance requirements , And once you get performance ,“ You can use ” It's not enough , Also need to consider “ feasible ”;
  2. Find a practical one from many methods , It's the ultimate goal . In fact, it requires an in-depth study of the understanding and comparison of various methods . But time is limited , Limited experience , Limited manpower , So we can only try at a limited cost , And constantly optimize , This may also be advocated by iterative development or agile development .
  3. I have talked about performance optimization in the previous space , As long as there are performance bottlenecks , As long as it doesn't reach the physical level ( theory ) Computable performance boundaries , You can find the right way to optimize .
  4. in addition , Technology selection is also very important , For a few of the things we're dealing with right now GIS engine , Support JSAPI None of them had similar problems , Instead of JS Of API Interfaces require extra research , Try and optimize . This is also a case worth thinking about for technology selection .

Information system practice notes 6-JS call Flex More related articles about the performance problem of

  1. 2016-04-25- Information system practice notes 6-JS call Flex An example of the performance problem of

    layout: post title: 2016-04-25- Information system practice notes 6-JS call Flex An example of the performance problem of key: 20160425 tags: GIS JS FLEX Technology selection performance API ...

  2. Information system practice notes 5-CACHE Design an example

    explain : The series of information system practice notes are the problems that the author has encountered in his research and development , Maybe simple and subtle , But it's often a problem . The author collects some typical ones , describe , Sum up and share . Abstract : This paper describes some of the information systems that I have been in contact with ...

  3. 2016-04-25- Information system practice notes 5-CACHE Design an example

    layout: post title: 2016-04-25- Information system practice notes 5-CACHE Design an example key: 20160425 tags: Business scene CACHE Systems analysis The system design cache modi ...

  4. 【FLEX course 】#007 How to make JS call SWF The method in

    HTML in ,JS How to call SWF The encapsulated code in it ? There are some things Flex It can't be done , You need to call JS To achieve . eg: When the browser form is closed , Pop up a dialog box , Prompt the user to exit ? Or whether to save the current operation ...

  5. [iOS Hybrid practice :UIWebView in Html of use JS call OC Method ,OC perform JS Code ]

    principle : 1.JS call OC Every time webview All jumps are executed by iOS To intercept , Execute the following function to get the system permission . So it can be transferred to the system according to the jump information , Perform corresponding functions , Such as opening photo albums and so on . // Every request in the web page is triggered ...

  6. JS And Flex Interaction :html Medium js And flex Medium actionScript signal communication

    Flex And JavaScript Problems of interaction , Let's share , It mainly includes Flex call JavaScript The functions in and JavaScript call Flex The function of two parts of the content . Flex And JavaScript ...

  7. js Call stack mechanism and ES6 Tail call optimization introduction

    The English name of the call stack is Call Stack, You've heard of it more or less , But for js How the call stack works and how to take advantage of this feature at work , Most people may not have done further research , This content can be said to be the so-called foundation for our front end ...

  8. JS call Android、Ios Native controls

    I talked with you in my last blog , About JS And Android.Ios Detailed code implementation of communication between native controls , Let's talk about it today JS call Android.Ios The similarities and differences of communication , In order to help us in hybrid development , ...

  9. How to use JS Call a segment SQL sentence

    How to use JS Call a segment SQL sentence , This kind of requirement is in the report form . Data platform development is very common . Based on the report platform FineReport Development as an example , For example, after clicking a button , To determine the number of databases , Then decide what to do next . So how can this be done backstage ? ...

Random recommendation

  1. Java Login test

    package test001; import java.io.BufferedReader; import java.io.FileOutputStream; import java.io.IOEx ...

  2. oracle database Split string return result set function

    CREATE OR REPLACE FUNCTION "UFN_SPLIT" (      p_list varchar2,      p_sep varchar2 := ',' ...

  3. ubuntu 18.04 install mysql 8.0

    1. Download configuration ( Otherwise, it's just mysql5.7): wget https://repo.mysql.com//mysql-apt-config_0.8.10-1_all.deb 2. Update configuration : sudo ...

  4. Redis Analysis of inspection points

    Catalog 1. Redis data structure 1. Common data structure 2. Advanced data structure 2. Redis Distributed lock 1. Redis Principle of distributed lock 2. If in setnx After performing expire The previous process was unexpected crash Or heavy ...

  5. NodeManager Introduce

    Link to the original text : http://blog.csdn.net/zhangzhebjut/article/details/37730013 Reference documents : https://blog.csdn.net/u013384 ...

  6. Shiro Introduce

    Preface This article mainly explains the following knowledge points : The basics of rights management Model The concept of coarse-grained and fine-grained review URL The implementation of interception Shiro Introduction and simple introduction to One .Shiro Basic knowledge of I'm learning Shiro Before this framework , First of all, we need to ...

  7. ps Use layers to merge cuts

    1. New layer 2. Merge the layers of the map to be cut and the new blank layer 3 Circle it with a square tool to get a cut 4.ctrl+c Copy ,ctrl+n newly build ,ctrl+v Copy the past 5, Cutaway

  8. 4.Java Basics :Java Object memory management mechanism

    1. Use new Create objects , Allocate object space in heap memory . initialization : 2. Define local variables in the method stack , Eat and use references to objects in heap memory : 3. Method returns after execution , Stack memory is released automatically , Local variable destruction : 4. If an object in heap memory does not have a variable to refer to it , ...

  9. Oracle PLSQL Demo - 11. Define Baotou [Define PACKAGE]

    CREATE OR REPLACE PACKAGE temp_package_demo is v_demo ); PROCEDURE p_demo_1(userid NUMBER DEFAULT v_ ...

  10. 【Leetcode】【Medium】Permutations

    Given a collection of numbers, return all possible permutations. For example,[1,2,3] have the follow ...